Browse Source

Global: rename bus type enum entries

master
Lucas De Marchi 9 years ago
parent
commit
1f96336f7c
  1. 4
      libraries/AP_HAL/Device.h
  2. 2
      libraries/AP_HAL/I2CDevice.h
  3. 2
      libraries/AP_HAL/SPIDevice.h
  4. 4
      libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp
  5. 4
      libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp

4
libraries/AP_HAL/Device.h

@ -27,8 +27,8 @@ @@ -27,8 +27,8 @@
class AP_HAL::Device {
public:
enum BusType {
I2C,
SPI,
BUS_TYPE_I2C,
BUS_TYPE_SPI,
};
enum Speed {

2
libraries/AP_HAL/I2CDevice.h

@ -27,7 +27,7 @@ namespace AP_HAL { @@ -27,7 +27,7 @@ namespace AP_HAL {
class I2CDevice : public Device {
public:
I2CDevice() : Device(I2C) { }
I2CDevice() : Device(BUS_TYPE_I2C) { }
virtual ~I2CDevice() { }

2
libraries/AP_HAL/SPIDevice.h

@ -27,7 +27,7 @@ namespace AP_HAL { @@ -27,7 +27,7 @@ namespace AP_HAL {
class SPIDevice : public Device {
public:
SPIDevice() : Device(SPI) { }
SPIDevice() : Device(BUS_TYPE_SPI) { }
virtual ~SPIDevice() { }
/* Device implementation */

4
libraries/AP_InertialSensor/AP_InertialSensor_MPU6000.cpp

@ -297,7 +297,7 @@ void AP_InertialSensor_MPU6000::_fifo_enable() @@ -297,7 +297,7 @@ void AP_InertialSensor_MPU6000::_fifo_enable()
bool AP_InertialSensor_MPU6000::_has_auxiliary_bus()
{
return _dev->bus_type != AP_HAL::Device::I2C;
return _dev->bus_type != AP_HAL::Device::BUS_TYPE_I2C;
}
void AP_InertialSensor_MPU6000::start()
@ -610,7 +610,7 @@ bool AP_InertialSensor_MPU6000::_hardware_init(void) @@ -610,7 +610,7 @@ bool AP_InertialSensor_MPU6000::_hardware_init(void)
hal.scheduler->delay(100);
/* bus-dependent initialization */
if (_dev->bus_type == AP_HAL::Device::SPI) {
if (_dev->bus_type == AP_HAL::Device::BUS_TYPE_SPI) {
/* Disable I2C bus if SPI selected (Recommended in Datasheet to be
* done just after the device is reset) */
_register_write(MPUREG_USER_CTRL, BIT_USER_CTRL_I2C_IF_DIS);

4
libraries/AP_InertialSensor/AP_InertialSensor_MPU9250.cpp

@ -276,7 +276,7 @@ bool AP_InertialSensor_MPU9250::_init() @@ -276,7 +276,7 @@ bool AP_InertialSensor_MPU9250::_init()
bool AP_InertialSensor_MPU9250::_has_auxiliary_bus()
{
return _dev->bus_type != AP_HAL::Device::I2C;
return _dev->bus_type != AP_HAL::Device::BUS_TYPE_I2C;
}
void AP_InertialSensor_MPU9250::start()
@ -484,7 +484,7 @@ bool AP_InertialSensor_MPU9250::_hardware_init(void) @@ -484,7 +484,7 @@ bool AP_InertialSensor_MPU9250::_hardware_init(void)
hal.scheduler->delay(100);
/* bus-dependent initialization */
if (_dev->bus_type == AP_HAL::Device::SPI) {
if (_dev->bus_type == AP_HAL::Device::BUS_TYPE_SPI) {
/* Disable I2C bus if SPI selected (Recommended in Datasheet to be
* done just after the device is reset) */
_register_write(MPUREG_USER_CTRL, BIT_USER_CTRL_I2C_IF_DIS);

Loading…
Cancel
Save