ads1115 only
Fork of mbed by
Diff: BusOut.h
- Revision:
- 122:f9eeca106725
- Parent:
- 93:e188a91d3eaa
- Child:
- 123:b0220dba8be7
--- a/BusOut.h Wed May 25 16:44:06 2016 +0100 +++ b/BusOut.h Thu Jul 07 14:34:11 2016 +0100 @@ -30,6 +30,8 @@ * * @param p<n> DigitalOut pin to connect to bus bit <n> (p5-p30, NC) * + * @Note Synchronization level: Thread safe + * * @note * It is only required to specify as many pin variables as is required * for the bus; the rest will default to NC (not connected) @@ -63,6 +65,7 @@ * Binary mask of connected pins */ int mask() { + // No lock needed since _nc_mask is not modified outside the constructor return _nc_mask; } @@ -82,6 +85,8 @@ #endif protected: + virtual void lock(); + virtual void unlock(); DigitalOut* _pin[16]; /** Mask of bus's NC pins @@ -90,6 +95,8 @@ */ int _nc_mask; + PlatformMutex _mutex; + /* disallow copy constructor and assignment operators */ private: BusOut(const BusOut&);