AP_MSP: don't send ESC_SENSOR_DATA when not enabled in build

This commit is contained in:
Andrew Tridgell 2020-08-31 09:21:27 +10:00
parent 449883c7f1
commit c4092ca57a
2 changed files with 8 additions and 0 deletions

View File

@ -62,7 +62,9 @@ void AP_MSP_Telem_Backend::setup_wfq_scheduler(void)
set_scheduler_entry(ALTITUDE, 250, 250); // 4Hz altitude(cm) and velocity(cm/s)
set_scheduler_entry(ANALOG, 250, 250); // 4Hz rssi + batt
set_scheduler_entry(BATTERY_STATE, 500, 500); // 2Hz battery
#ifdef HAVE_AP_BLHELI_SUPPORT
set_scheduler_entry(ESC_SENSOR_DATA, 500, 500); // 2Hz ESC telemetry
#endif
set_scheduler_entry(RTC_DATETIME, 1000, 1000); // 1Hz RTC
}
@ -108,7 +110,9 @@ bool AP_MSP_Telem_Backend::is_packet_ready(uint8_t idx, bool queue_empty)
case ALTITUDE: // Altitude and Vario
case ANALOG: // Rssi, Battery, mAh, Current
case BATTERY_STATE: // voltage, capacity, current, mAh
#ifdef HAVE_AP_BLHELI_SUPPORT
case ESC_SENSOR_DATA: // esc temp + rpm
#endif
case RTC_DATETIME: // RTC
return true;
default:

View File

@ -91,7 +91,9 @@ protected:
ALTITUDE,
ANALOG,
BATTERY_STATE,
#ifdef HAVE_AP_BLHELI_SUPPORT
ESC_SENSOR_DATA,
#endif
RTC_DATETIME,
};
@ -106,7 +108,9 @@ protected:
MSP_ALTITUDE,
MSP_ANALOG,
MSP_BATTERY_STATE,
#ifdef HAVE_AP_BLHELI_SUPPORT
MSP_ESC_SENSOR_DATA,
#endif
MSP_RTC
};