ads1115 only
Fork of mbed by
Diff: AnalogIn.h
- Revision:
- 123:b0220dba8be7
- Parent:
- 122:f9eeca106725
--- a/AnalogIn.h Thu Jul 07 14:34:11 2016 +0100 +++ b/AnalogIn.h Fri Aug 12 13:04:35 2016 +0200 @@ -21,6 +21,8 @@ #if DEVICE_ANALOGIN #include "analogin_api.h" +#include "SingletonPtr.h" +#include "PlatformMutex.h" namespace mbed { @@ -83,7 +85,6 @@ return ret; } -#ifdef MBED_OPERATORS /** An operator shorthand for read() * * The float() operator can be used as a shorthand for read() to simplify common code sequences @@ -101,7 +102,6 @@ // Underlying call is thread safe return read(); } -#endif virtual ~AnalogIn() { // Do nothing @@ -110,15 +110,15 @@ protected: virtual void lock() { - _mutex.lock(); + _mutex->lock(); } virtual void unlock() { - _mutex.unlock(); + _mutex->unlock(); } analogin_t _adc; - static PlatformMutex _mutex; + static SingletonPtr<PlatformMutex> _mutex; }; } // namespace mbed