AP_BLHeli: added have_telem_data() API

This commit is contained in:
Andrew Tridgell 2020-08-31 12:53:19 +10:00
parent 05f4bf0b32
commit 952a3956a9
2 changed files with 8 additions and 0 deletions

View File

@ -1417,6 +1417,7 @@ void AP_BLHeli::read_telemetry_packet(void)
last_telem[last_telem_esc] = td;
last_telem[last_telem_esc].count++;
received_telem_data = true;
AP_Logger *logger = AP_Logger::get_singleton();
if (logger && logger->logging_enabled()

View File

@ -65,6 +65,11 @@ public:
// return all of the motor frequencies in Hz for dynamic filtering
uint8_t get_motor_frequencies_hz(uint8_t nfreqs, float* freqs) const;
// return true if we have received any telemetry data
bool have_telem_data(void) const {
return received_telem_data;
}
static AP_BLHeli *get_singleton(void) {
return _singleton;
}
@ -228,6 +233,8 @@ private:
uint8_t num_motors;
struct telem_data last_telem[max_motors];
uint32_t received_telem_data;
// last log output to avoid beat frequencies
uint32_t last_log_ms[max_motors];