AP_HAL_Empty: add semaphore to I2CDriver

This commit is contained in:
Pat Hickey 2013-01-04 16:19:51 -08:00
parent 4c31cc0c2b
commit 0db60464f7
2 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,8 @@ using namespace Empty;
static EmptyUARTDriver uartADriver;
static EmptyUARTDriver uartBDriver;
static EmptyUARTDriver uartCDriver;
static EmptyI2CDriver i2cDriver;
static EmptySemaphore i2cSemaphore;
static EmptyI2CDriver i2cDriver(&i2cSemaphore);
static EmptySPIDeviceManager spiDeviceManager;
static EmptyAnalogIn analogIn;
static EmptyStorage storageDriver;

View File

@ -6,6 +6,7 @@
class Empty::EmptyI2CDriver : public AP_HAL::I2CDriver {
public:
EmptyI2CDriver(AP_HAL::Semaphore* semaphore) : _semaphore(semaphore) {}
void begin();
void end();
void setTimeout(uint16_t ms);
@ -31,6 +32,10 @@ public:
uint8_t lockup_count();
AP_HAL::Semaphore* get_semaphore() { return _semaphore; }
private:
AP_HAL::Semaphore* _semaphore;
};
#endif // __AP_HAL_EMPTY_I2CDRIVER_H__