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
This commit is contained in:
Andrew Tridgell 2018-02-07 10:48:36 +11:00
parent 40142e5aef
commit aee6462deb
2 changed files with 7 additions and 1 deletions

View File

@ -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();

View File

@ -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