1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Merge pull request #2629 from mikeller/added_hott_eam_altitude

Added EAM baro altitude to HoTT.
This commit is contained in:
Michael Keller 2017-03-14 08:33:24 +13:00 committed by GitHub
commit 355c7cc215

View file

@ -267,6 +267,14 @@ static inline void hottEAMUpdateBatteryDrawnCapacity(HOTT_EAM_MSG_t *hottEAMMess
hottEAMMessage->batt_cap_H = mAh >> 8;
}
static inline void hottEAMUpdateAltitude(HOTT_EAM_MSG_t *hottEAMMessage)
{
const uint16_t hottEamAltitude = (baro.BaroAlt / 100) + HOTT_EAM_OFFSET_HEIGHT;
hottEAMMessage->altitude_L = hottEamAltitude & 0x00FF;
hottEAMMessage->altitude_H = hottEamAltitude >> 8;
}
void hottPrepareEAMResponse(HOTT_EAM_MSG_t *hottEAMMessage)
{
// Reset alarms
@ -276,6 +284,7 @@ void hottPrepareEAMResponse(HOTT_EAM_MSG_t *hottEAMMessage)
hottEAMUpdateBattery(hottEAMMessage);
hottEAMUpdateCurrentMeter(hottEAMMessage);
hottEAMUpdateBatteryDrawnCapacity(hottEAMMessage);
hottEAMUpdateAltitude(hottEAMMessage);
}
static void hottSerialWrite(uint8_t c)