Browse Source

AP_HAL_Empty: add semaphore to I2CDriver

mission-4.1.18
Pat Hickey 12 years ago
parent
commit
0db60464f7
  1. 3
      libraries/AP_HAL_Empty/HAL_Empty_Class.cpp
  2. 5
      libraries/AP_HAL_Empty/I2CDriver.h

3
libraries/AP_HAL_Empty/HAL_Empty_Class.cpp

@ -10,7 +10,8 @@ using namespace Empty; @@ -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;

5
libraries/AP_HAL_Empty/I2CDriver.h

@ -6,6 +6,7 @@ @@ -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: @@ -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__

Loading…
Cancel
Save