mirror of https://github.com/ArduPilot/ardupilot
AP_Hott_Telem: add and use AP_BATTERY_ENABLED
This commit is contained in:
parent
1f4c129341
commit
7f6cb0eab3
|
@ -109,6 +109,7 @@ void AP_Hott_Telem::send_EAM(void)
|
||||||
uint8_t stop_byte = 0x7D; //#44 stop
|
uint8_t stop_byte = 0x7D; //#44 stop
|
||||||
} msg {};
|
} msg {};
|
||||||
|
|
||||||
|
#if AP_BATTERY_ENABLED
|
||||||
const AP_BattMonitor &battery = AP::battery();
|
const AP_BattMonitor &battery = AP::battery();
|
||||||
if (battery.num_instances() > 0) {
|
if (battery.num_instances() > 0) {
|
||||||
msg.batt1_voltage = uint16_t(battery.voltage(0) * 10);
|
msg.batt1_voltage = uint16_t(battery.voltage(0) * 10);
|
||||||
|
@ -125,6 +126,7 @@ void AP_Hott_Telem::send_EAM(void)
|
||||||
if (battery.consumed_mah(used_mah)) {
|
if (battery.consumed_mah(used_mah)) {
|
||||||
msg.batt_used = used_mah * 0.1;
|
msg.batt_used = used_mah * 0.1;
|
||||||
}
|
}
|
||||||
|
#endif // AP_BATTERY_ENABLED
|
||||||
|
|
||||||
const AP_Baro &baro = AP::baro();
|
const AP_Baro &baro = AP::baro();
|
||||||
msg.temp1 = uint8_t(baro.get_temperature(0) + 20.5);
|
msg.temp1 = uint8_t(baro.get_temperature(0) + 20.5);
|
||||||
|
|
Loading…
Reference in New Issue