I2CRTOS Driver by Helmut Schmücker. Removed included mbed-rtos library to prevent multiple definition. Make sure to include mbed-rtos library in your program!
Fork of I2cRtosDriver by
Diff: I2CDriver.h
- Revision:
- 2:514105beb343
- Parent:
- 1:90455d5bdd8c
- Child:
- 3:967dde37e712
--- a/I2CDriver.h Sun Apr 14 06:39:04 2013 +0000 +++ b/I2CDriver.h Sun Apr 14 21:42:22 2013 +0000 @@ -86,14 +86,14 @@ void stop(void); /// Wait until the i2c driver becomes available. - void lock() { + void lock() { // if one and the same thread can lock twice, but then it needs also to unlock twice. // exactly what we need here m_channel->mutex.lock(osWaitForever); } /// Unlock the driver that has previously been locked by the same thread - void unlock() { + void unlock() { m_channel->mutex.unlock(); } @@ -134,9 +134,9 @@ static const PinName c_sdas[2]; static const PinName c_scls[2]; - static Channel* s_channels[2]; + static Channel* s_channels[2]; - Channel* m_channel; + Channel* m_channel; static void channel_0_ISR(); static void channel_1_ISR();