Browse Source

HAL_ChibiOS: enable I2C clearing on F412 board only

may be needed on other boards in the future, but for now we only know
its needed on an I2C 20789, which is rare
master
Andrew Tridgell 7 years ago
parent
commit
aee6462deb
  1. 5
      libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp
  2. 3
      libraries/AP_HAL_ChibiOS/hwdef/skyviper-f412/hwdef.dat

5
libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp

@ -109,8 +109,11 @@ static THD_FUNCTION(main_loop,arg) @@ -109,8 +109,11 @@ static THD_FUNCTION(main_loop,arg)
{
daemon_task = chThdGetSelfX();
//Clear all I2C Buses
#ifdef HAL_I2C_CLEAR_BUS
// Clear all I2C Buses. This can be needed on some boards which
// can get a stuck I2C peripheral on boot
ChibiOS::I2CBus::clear_all();
#endif
ChibiOS::Shared_DMA::init();

3
libraries/AP_HAL_ChibiOS/hwdef/skyviper-f412/hwdef.dat

@ -133,3 +133,6 @@ define HAL_BARO_DEFAULT HAL_BARO_20789_I2C_I2C @@ -133,3 +133,6 @@ define HAL_BARO_DEFAULT HAL_BARO_20789_I2C_I2C
define HAL_BARO_20789_I2C_BUS 1
define HAL_BARO_20789_I2C_ADDR_PRESS 0x63
define HAL_BARO_20789_I2C_ADDR_ICM 0x68
# unstick 20789 on I2C on boot
define HAL_I2C_CLEAR_BUS

Loading…
Cancel
Save