Skip to content

Commit 9e4d596

Browse files
committed
AP_Baro: ICPM20789: probe takes Device, not I2CDevice
allows reuse of probe method in AP_Baro
1 parent 8deac0c commit 9e4d596

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

libraries/AP_Baro/AP_Baro_ICM20789.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#if AP_BARO_ICM20789_ENABLED
1919

2020
#include <AP_HAL/AP_HAL.h>
21-
#include <AP_HAL/I2CDevice.h>
21+
#include <AP_HAL/Device.h>
2222
#include <utility>
2323

2424
#include <AP_Common/AP_Common.h>
@@ -65,15 +65,15 @@ extern const AP_HAL::HAL &hal;
6565
/*
6666
constructor
6767
*/
68-
AP_Baro_ICM20789::AP_Baro_ICM20789(AP_Baro &baro, AP_HAL::I2CDevice &_dev, AP_HAL::Device &_dev_imu)
68+
AP_Baro_ICM20789::AP_Baro_ICM20789(AP_Baro &baro, AP_HAL::Device &_dev, AP_HAL::Device &_dev_imu)
6969
: AP_Baro_Backend(baro)
7070
, dev(&_dev)
7171
, dev_imu(&_dev_imu)
7272
{
7373
}
7474

7575
AP_Baro_Backend *AP_Baro_ICM20789::probe(AP_Baro &baro,
76-
AP_HAL::I2CDevice &dev,
76+
AP_HAL::Device &dev,
7777
AP_HAL::Device &dev_imu)
7878
{
7979
debug("Probing for ICM20789 baro\n");

libraries/AP_Baro/AP_Baro_ICM20789.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class AP_Baro_ICM20789 : public AP_Baro_Backend
1919
public:
2020
void update() override;
2121

22-
static AP_Baro_Backend *probe(AP_Baro &baro, AP_HAL::I2CDevice &dev, AP_HAL::Device &dev_imu);
22+
static AP_Baro_Backend *probe(AP_Baro &baro, AP_HAL::Device &dev, AP_HAL::Device &dev_imu);
2323

2424
private:
25-
AP_Baro_ICM20789(AP_Baro &baro, AP_HAL::I2CDevice &dev, AP_HAL::Device &dev_imu);
25+
AP_Baro_ICM20789(AP_Baro &baro, AP_HAL::Device &dev, AP_HAL::Device &dev_imu);
2626

2727
bool init();
2828
bool send_cmd16(uint16_t cmd);
@@ -45,7 +45,7 @@ class AP_Baro_ICM20789 : public AP_Baro_Backend
4545

4646
uint8_t instance;
4747

48-
AP_HAL::I2CDevice *dev;
48+
AP_HAL::Device *dev;
4949
AP_HAL::Device *dev_imu;
5050

5151
// time last read command was sent

0 commit comments

Comments
 (0)