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:
commit
355c7cc215
1 changed files with 9 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue