1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 04:45:24 +03:00

Allow disabling of I2C for targets that do not use it.

This commit is contained in:
Dominic Clifton 2014-09-26 01:14:39 +01:00
parent 15cbeff86e
commit 35280abfed
14 changed files with 46 additions and 11 deletions

View file

@ -484,7 +484,11 @@ static bool processOutCommand(uint8_t cmdMSP)
case MSP_STATUS:
headSerialReply(11);
serialize16(cycleTime);
#ifdef USE_I2C
serialize16(i2cGetErrorCounter());
#else
serialize16(0);
#endif
serialize16(sensors(SENSOR_ACC) | sensors(SENSOR_BARO) << 1 | sensors(SENSOR_MAG) << 2 | sensors(SENSOR_GPS) << 3 | sensors(SENSOR_SONAR) << 4);
// OK, so you waste all the fucking time to have BOXNAMES and BOXINDEXES etc, and then you go ahead and serialize enabled shit simply by stuffing all
// the bits in order, instead of setting the enabled bits based on BOXINDEX. WHERE IS THE FUCKING LOGIC IN THIS, FUCKWADS.