Skip to content

Commit

Permalink
HAL_ChibiOS: fixed namespace error
Browse files Browse the repository at this point in the history
thanks to Peter for noticing
  • Loading branch information
tridge committed Mar 2, 2018
1 parent 93bd546 commit 9ab695b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions libraries/AP_HAL_ChibiOS/I2CDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

#if HAL_USE_I2C == TRUE

using namespace ChibiOS;
namespace ChibiOS {

class ChibiOS::I2CBus : public ChibiOS::DeviceBus {
class I2CBus : public DeviceBus {
public:
I2CConfig i2ccfg;
uint8_t busnum;
Expand All @@ -46,7 +46,7 @@ class ChibiOS::I2CBus : public ChibiOS::DeviceBus {
static void clear_bus(ioline_t scl_line, uint8_t scl_af);
};

class ChibiOS::I2CDevice : public AP_HAL::I2CDevice {
class I2CDevice : public AP_HAL::I2CDevice {
public:
static I2CDevice *from(AP_HAL::I2CDevice *dev)
{
Expand Down Expand Up @@ -102,7 +102,7 @@ class ChibiOS::I2CDevice : public AP_HAL::I2CDevice {
uint32_t _timeout_ms;
};

class ChibiOS::I2CDeviceManager : public AP_HAL::I2CDeviceManager {
class I2CDeviceManager : public AP_HAL::I2CDeviceManager {
public:
friend class I2CDevice;

Expand All @@ -121,6 +121,7 @@ class ChibiOS::I2CDeviceManager : public AP_HAL::I2CDeviceManager {
bool use_smbus = false,
uint32_t timeout_ms=4) override;
};
}

#endif // HAL_USE_I2C

12 changes: 6 additions & 6 deletions libraries/AP_HAL_ChibiOS/SPIDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

#if HAL_USE_SPI == TRUE

using namespace ChibiOS;
namespace ChibiOS {

class ChibiOS::SPIBus : public ChibiOS::DeviceBus {
class SPIBus : public DeviceBus {
public:
SPIBus(uint8_t bus);
struct spi_dev_s *dev;
Expand All @@ -36,7 +36,7 @@ class ChibiOS::SPIBus : public ChibiOS::DeviceBus {
bool spi_started;
};

struct ChibiOS::SPIDesc {
struct SPIDesc {
SPIDesc(const char *_name, uint8_t _bus,
uint8_t _device, ioline_t _pal_line,
uint16_t _mode, uint32_t _lowspeed, uint32_t _highspeed)
Expand All @@ -56,7 +56,7 @@ struct ChibiOS::SPIDesc {
};


class ChibiOS::SPIDevice : public AP_HAL::SPIDevice {
class SPIDevice : public AP_HAL::SPIDevice {
public:
SPIDevice(SPIBus &_bus, SPIDesc &_device_desc);

Expand Down Expand Up @@ -101,7 +101,7 @@ class ChibiOS::SPIDevice : public AP_HAL::SPIDevice {
uint16_t derive_freq_flag(uint32_t _frequency);
};

class ChibiOS::SPIDeviceManager : public AP_HAL::SPIDeviceManager {
class SPIDeviceManager : public AP_HAL::SPIDeviceManager {
public:
friend class SPIDevice;

Expand All @@ -116,6 +116,6 @@ class ChibiOS::SPIDeviceManager : public AP_HAL::SPIDeviceManager {
static SPIDesc device_table[];
SPIBus *buses;
};

}

#endif // HAL_USE_SPI

0 comments on commit 9ab695b

Please sign in to comment.