I2C: Various fixes and improvements

Description

  • I2C port selection in pios_board_sensors.c based on AuxMagSettings is incorrect (mixed up), so external i2c mag will not work (on correct port). This affects Sparky2

  • I2C write setup NACK handling on F3 i2c driver is broken, it messes up next valid transacion due to lingering STOPF flag

  • MS5611 initialization code contains unfriendly PIOS_DELAY_WaitmS(20) which messes up other sensors reading when trying to reinitialize missing ms5611 (SPRacingF3 Acro) or hung bus (Sparky2 and F3 boards with I2C connector that exposes internal bus and having external unpowered sensor attached).

Assignee

Vladimir Zidar

Reporter

Vladimir Zidar

Labels

None

Components

Fix versions

Priority

Medium
Configure