Skip to content

Commit

Permalink
Add Mutexless Analog classes for interrupt usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Wigu701 committed Nov 19, 2023
1 parent b3aff2c commit 367f569
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/include/mutexless_analog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "mbed.h"

/*
Overloaded Analog pin classes for use in interrupts
Usage is analogous MbedOS Analog classes
*/
class AnalogInMutexless : public AnalogIn {
public:
AnalogInMutexless(PinName pin) : AnalogIn(pin) { }
virtual void lock() { }
virtual void unlock() { }
};

class AnalogOutMutexless : public AnalogOut {
public:
AnalogOutMutexless(PinName pin) : AnalogOut(pin) { }
virtual void lock() { }
virtual void unlock() { }
};

0 comments on commit 367f569

Please sign in to comment.