From 16f9ddf52fc0a0926554e3ad4804ca357c79376d Mon Sep 17 00:00:00 2001 From: Bob Long Date: Mon, 21 Oct 2024 09:32:22 +1100 Subject: [PATCH 1/6] AP_ESC_Telem: add count and error_count handlers --- libraries/AP_ESC_Telem/AP_ESC_Telem.cpp | 32 +++++++++++++++++++ libraries/AP_ESC_Telem/AP_ESC_Telem.h | 9 ++++++ .../AP_ESC_Telem/AP_ESC_Telem_Backend.cpp | 5 +++ libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.h | 5 +++ 4 files changed, 51 insertions(+) diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp index 30239127fb..27fdb2bf94 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp @@ -326,6 +326,26 @@ bool AP_ESC_Telem::get_consumption_mah(uint8_t esc_index, float& consumption_mah return true; } +// get an individual ESC's packet count if available, returns true on success +bool AP_ESC_Telem::get_count(uint8_t esc_index, uint16_t& count) const +{ + if (esc_index >= ESC_TELEM_MAX_ESCS) { + return false; + } + count = _telem_data[esc_index].count; + return true; +} + +// get an individual ESC's error count if available, returns true on success +bool AP_ESC_Telem::get_error_count(uint8_t esc_index, uint16_t& error_count) const +{ + if (esc_index >= ESC_TELEM_MAX_ESCS) { + return false; + } + error_count = _telem_data[esc_index].error_count; + return true; +} + // get an individual ESC's usage time in seconds if available, returns true on success bool AP_ESC_Telem::get_usage_seconds(uint8_t esc_index, uint32_t& usage_s) const { @@ -562,6 +582,9 @@ void AP_ESC_Telem::update_telem_data(const uint8_t esc_index, const AP_ESC_Telem if (data_mask & AP_ESC_Telem_Backend::TelemetryType::USAGE) { telemdata.usage_s = new_data.usage_s; } + if (data_mask & AP_ESC_Telem_Backend::TelemetryType::ERROR_COUNT) { + telemdata.error_count = new_data.error_count; + } #if AP_EXTENDED_ESC_TELEM_ENABLED if (data_mask & AP_ESC_Telem_Backend::TelemetryType::INPUT_DUTY) { @@ -583,6 +606,15 @@ void AP_ESC_Telem::update_telem_data(const uint8_t esc_index, const AP_ESC_Telem telemdata.last_update_ms = AP_HAL::millis(); } +// callback to increment the error count in the frontend, should be called by the driver when an error occurs +void AP_ESC_Telem::increment_error_count(const uint8_t esc_index) +{ + if (esc_index >= ESC_TELEM_MAX_ESCS) { + return; + } + _telem_data[esc_index].error_count++; +} + // record an update to the RPM together with timestamp, this allows the notch values to be slewed // this should be called by backends when new telemetry values are available void AP_ESC_Telem::update_rpm(const uint8_t esc_index, const float new_rpm, const float error_rate) diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem.h b/libraries/AP_ESC_Telem/AP_ESC_Telem.h index 85ec050952..129a3570fa 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem.h +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem.h @@ -67,6 +67,12 @@ class AP_ESC_Telem { // get an individual ESC's consumption in milli-Ampere.hour if available, returns true on success bool get_consumption_mah(uint8_t esc_index, float& consumption_mah) const; + // get an individual ESC's packet count if available, returns true on success + bool get_count(uint8_t esc_index, uint16_t& count) const; + + // get an individual ESC's error count if available, returns true on success + bool get_error_count(uint8_t esc_index, uint16_t& error_count) const; + #if AP_EXTENDED_ESC_TELEM_ENABLED // get an individual ESC's input duty cycle if available, returns true on success bool get_input_duty(uint8_t esc_index, uint8_t& input_duty) const; @@ -122,6 +128,9 @@ class AP_ESC_Telem { // callback to update the data in the frontend, should be called by the driver when new data is available void update_telem_data(const uint8_t esc_index, const AP_ESC_Telem_Backend::TelemetryData& new_data, const uint16_t data_mask); + // callback to increment the error count in the frontend, should be called by the driver when an error occurs + void increment_error_count(const uint8_t esc_index); + #if AP_SCRIPTING_ENABLED /* set RPM scale factor from script diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp b/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp index a63c0191c5..5d9f1c66cc 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp @@ -45,6 +45,11 @@ void AP_ESC_Telem_Backend::update_telem_data(const uint8_t esc_index, const Tele _frontend->update_telem_data(esc_index, new_data, data_present_mask); } +// callback to increment the error count in the frontend, should be called by the driver when an error occurs +void AP_ESC_Telem_Backend::increment_error_count(const uint8_t esc_index) { + _frontend->increment_error_count(esc_index); +} + /* return true if the data is stale */ diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.h b/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.h index 9f8da7a7f1..0aa511ba6b 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.h +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.h @@ -19,6 +19,7 @@ class AP_ESC_Telem_Backend { uint32_t last_update_ms; // last update time in milliseconds, determines whether active uint16_t types; // telemetry types present uint16_t count; // number of times updated + uint32_t error_count; // number of errors #if AP_EXTENDED_ESC_TELEM_ENABLED uint8_t input_duty; // input duty cycle uint8_t output_duty; // output duty cycle @@ -51,6 +52,7 @@ class AP_ESC_Telem_Backend { USAGE = 1 << 5, TEMPERATURE_EXTERNAL = 1 << 6, MOTOR_TEMPERATURE_EXTERNAL = 1 << 7, + ERROR_COUNT = 1 << 8, #if AP_EXTENDED_ESC_TELEM_ENABLED INPUT_DUTY = 1 << 10, OUTPUT_DUTY = 1 << 11, @@ -72,6 +74,9 @@ class AP_ESC_Telem_Backend { // callback to update the data in the frontend, should be called by the driver when new data is available void update_telem_data(const uint8_t esc_index, const TelemetryData& new_data, const uint16_t data_present_mask); + // callback to increment the error count in the frontend, should be called by the driver when an error occurs + void increment_error_count(const uint8_t esc_index); + private: AP_ESC_Telem* _frontend; }; From 5dd434ac84fd5b5dcb0e5afaf48b9f8c24170620 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Mon, 21 Oct 2024 09:33:12 +1100 Subject: [PATCH 2/6] AP_BLHeli: increment error count on failed reads --- libraries/AP_BLHeli/AP_BLHeli.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/AP_BLHeli/AP_BLHeli.cpp b/libraries/AP_BLHeli/AP_BLHeli.cpp index c8b1fb6199..b6537fc9e4 100644 --- a/libraries/AP_BLHeli/AP_BLHeli.cpp +++ b/libraries/AP_BLHeli/AP_BLHeli.cpp @@ -1454,8 +1454,10 @@ void AP_BLHeli::read_telemetry_packet(void) { #if HAL_WITH_ESC_TELEM uint8_t buf[13]; + const uint8_t motor_idx = motor_map[last_telem_esc]; if (telem_uart->read(buf, telem_packet_size) < telem_packet_size) { // short read, we should have all bytes ready when this function is called + increment_error_count(motor_idx - chan_offset); return; } @@ -1468,11 +1470,11 @@ void AP_BLHeli::read_telemetry_packet(void) if (buf[telem_packet_size-1] != crc) { // bad crc debug("Bad CRC on %u", last_telem_esc); + increment_error_count(motor_idx - chan_offset); return; } // record the previous rpm so that we can slew to the new one uint16_t new_rpm = ((buf[7]<<8) | buf[8]) * 200 / motor_poles; - const uint8_t motor_idx = motor_map[last_telem_esc]; // we have received valid data, mark the ESC as now active hal.rcout->set_active_escs_mask(1<discard_input(); + increment_error_count(motor_map[last_telem_esc] - chan_offset); return; } if (nbytes > 0 && @@ -1615,6 +1618,7 @@ void AP_BLHeli::update_telemetry(void) if (nbytes > 0 && nbytes < telem_packet_size) { // we've waited long enough, discard bytes if we don't have 10 yet telem_uart->discard_input(); + increment_error_count(motor_map[last_telem_esc] - chan_offset); return; } if (nbytes == telem_packet_size) { From 67afc64792152ecc681353c93f4ee6544dd6eb39 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Mon, 21 Oct 2024 09:34:16 +1100 Subject: [PATCH 3/6] HACK: AP_Periph: send ESC count and error count This sends both the count and the error count within the error_count field of the ESC telemetry message. count is held in the lower 16 bits and error count in the upper 16 bits. --- Tools/AP_Periph/can.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tools/AP_Periph/can.cpp b/Tools/AP_Periph/can.cpp index 30ec6e133b..b945032ef4 100644 --- a/Tools/AP_Periph/can.cpp +++ b/Tools/AP_Periph/can.cpp @@ -1705,6 +1705,13 @@ void AP_Periph_FW::esc_telem_update() #endif pkt.error_count = 0; + uint16_t error_count, count; + if (esc_telem.get_count(i, count)) { + pkt.error_count = count; + } + if (esc_telem.get_error_count(i, error_count)) { + pkt.error_count += (error_count & 0xFFFF) << 16; + } uint8_t buffer[UAVCAN_EQUIPMENT_ESC_STATUS_MAX_SIZE] {}; uint16_t total_size = uavcan_equipment_esc_Status_encode(&pkt, buffer, !canfdout()); From 802376799c1b5816f22a0e06abce3829271affc0 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Mon, 21 Oct 2024 09:44:51 +1100 Subject: [PATCH 4/6] AP_ESC_Telem: log error count --- libraries/AP_ESC_Telem/AP_ESC_Telem.cpp | 3 ++- libraries/AP_ESC_Telem/LogStructure.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp index 27fdb2bf94..d393934aa6 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp @@ -684,7 +684,8 @@ void AP_ESC_Telem::update() esc_temp : telemdata.temperature_cdeg, current_tot : telemdata.consumption_mah, motor_temp : telemdata.motor_temp_cdeg, - error_rate : rpmdata.error_rate + error_rate : rpmdata.error_rate, + error_count : telemdata.error_count, }; AP::logger().WriteBlock(&pkt, sizeof(pkt)); diff --git a/libraries/AP_ESC_Telem/LogStructure.h b/libraries/AP_ESC_Telem/LogStructure.h index a3c0dc791c..e7a49d2469 100644 --- a/libraries/AP_ESC_Telem/LogStructure.h +++ b/libraries/AP_ESC_Telem/LogStructure.h @@ -17,6 +17,7 @@ // @Field: CTot: current consumed total mAh // @Field: MotTemp: measured motor temperature in centi-degrees C // @Field: Err: error rate +// @Field: Errc: error count struct PACKED log_Esc { LOG_PACKET_HEADER; uint64_t time_us; @@ -29,8 +30,9 @@ struct PACKED log_Esc { float current_tot; int16_t motor_temp; float error_rate; + uint32_t error_count; }; #define LOG_STRUCTURE_FROM_ESC_TELEM \ { LOG_ESC_MSG, sizeof(log_Esc), \ - "ESC", "QBffffcfcf", "TimeUS,Instance,RPM,RawRPM,Volt,Curr,Temp,CTot,MotTemp,Err", "s#qqvAOaO%", "F-00--BCB-" , true }, + "ESC", "QBffffcfcfI", "TimeUS,Instance,RPM,RawRPM,Volt,Curr,Temp,CTot,MotTemp,Err,ErrC", "s#qqvAOaO%-", "F-00--BCB-0" , true }, From 9cb64241732964df633ae73ae61f807bf079b741 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Mon, 21 Oct 2024 10:47:49 +1100 Subject: [PATCH 5/6] AP_DroneCAN: ESCStatus read error_count --- libraries/AP_DroneCAN/AP_DroneCAN.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/AP_DroneCAN/AP_DroneCAN.cpp b/libraries/AP_DroneCAN/AP_DroneCAN.cpp index 0786b77b2d..89581e6077 100644 --- a/libraries/AP_DroneCAN/AP_DroneCAN.cpp +++ b/libraries/AP_DroneCAN/AP_DroneCAN.cpp @@ -1428,16 +1428,18 @@ void AP_DroneCAN::handle_ESC_status(const CanardRxTransfer& transfer, const uavc .temperature_cdeg = int16_t((KELVIN_TO_C(msg.temperature)) * 100), .voltage = msg.voltage, .current = msg.current, + .error_count = msg.error_count, #if AP_EXTENDED_ESC_TELEM_ENABLED .power_percentage = msg.power_rating_pct, #endif }; - update_rpm(esc_index, msg.rpm, msg.error_count); + update_rpm(esc_index, msg.rpm, 0); update_telem_data(esc_index, t, (isnan(msg.current) ? 0 : AP_ESC_Telem_Backend::TelemetryType::CURRENT) | (isnan(msg.voltage) ? 0 : AP_ESC_Telem_Backend::TelemetryType::VOLTAGE) | (isnan(msg.temperature) ? 0 : AP_ESC_Telem_Backend::TelemetryType::TEMPERATURE) + | AP_ESC_Telem_Backend::TelemetryType::ERROR_COUNT #if AP_EXTENDED_ESC_TELEM_ENABLED | AP_ESC_Telem_Backend::TelemetryType::POWER_PERCENTAGE #endif From f936724ddd2e4d5b72083852e20f4133f8563312 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Tue, 12 Nov 2024 08:40:17 +1100 Subject: [PATCH 6/6] WIP --- .gitignore | 1 + Tools/AP_Periph/can.cpp | 7 ++--- Tools/Carbonix_scripts/carbonix_waf_build.sh | 26 +++++++++---------- libraries/AP_BLHeli/AP_BLHeli.cpp | 8 +++--- libraries/AP_ESC_Telem/AP_ESC_Telem.cpp | 6 ++--- libraries/AP_ESC_Telem/AP_ESC_Telem.h | 4 +-- .../AP_ESC_Telem/AP_ESC_Telem_Backend.cpp | 4 +-- libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.h | 2 +- 8 files changed, 30 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 2769d31790..38884c4846 100644 --- a/.gitignore +++ b/.gitignore @@ -93,6 +93,7 @@ mav.log mav.log.raw mav.parm mission.stg +output/ /defaults.parm /ArduCopter/defaults.parm /ArduPlane/defaults.parm diff --git a/Tools/AP_Periph/can.cpp b/Tools/AP_Periph/can.cpp index b945032ef4..a4f89765b1 100644 --- a/Tools/AP_Periph/can.cpp +++ b/Tools/AP_Periph/can.cpp @@ -1705,12 +1705,13 @@ void AP_Periph_FW::esc_telem_update() #endif pkt.error_count = 0; - uint16_t error_count, count; + uint32_t error_count; + uint16_t count; if (esc_telem.get_count(i, count)) { - pkt.error_count = count; + pkt.error_count = count & 0xFF; } if (esc_telem.get_error_count(i, error_count)) { - pkt.error_count += (error_count & 0xFFFF) << 16; + pkt.error_count += (error_count & 0xFFFFFF) << 8; } uint8_t buffer[UAVCAN_EQUIPMENT_ESC_STATUS_MAX_SIZE] {}; diff --git a/Tools/Carbonix_scripts/carbonix_waf_build.sh b/Tools/Carbonix_scripts/carbonix_waf_build.sh index 82f7a0211e..102eef7469 100755 --- a/Tools/Carbonix_scripts/carbonix_waf_build.sh +++ b/Tools/Carbonix_scripts/carbonix_waf_build.sh @@ -6,18 +6,18 @@ set -e echo "Running distclean..." ./waf distclean -main_boards=("CubeOrange" "CubeOrangePlus" "CubeOrange-Volanti" "CubeOrangePlus-Volanti" "CubeOrange-Ottano" "CubeOrangePlus-Ottano") -for board in "${main_boards[@]}"; do - echo "Compiling ArduPlane for $board..." - ./waf configure --board "$board" -g - ./waf plane -done +# main_boards=("CubeOrange" "CubeOrangePlus" "CubeOrange-Volanti" "CubeOrangePlus-Volanti" "CubeOrange-Ottano" "CubeOrangePlus-Ottano") +# for board in "${main_boards[@]}"; do +# echo "Compiling ArduPlane for $board..." +# ./waf configure --board "$board" -g +# ./waf plane +# done -periph_boards=("CarbonixF405" "CarbonixF405-no-crystal") +periph_boards=("CarbonixF405") # "CarbonixF405-no-crystal") # Build all periph board with custom parameters for board in "${periph_boards[@]}"; do - for file in $(find libraries/AP_HAL_ChibiOS/hwdef/CarbonixCommon/cpn_params/ -name "*.parm"); do + for file in $(find libraries/AP_HAL_ChibiOS/hwdef/CarbonixCommon/cpn_params/Volanti/*-M* -name "*.parm"); do # Extract the filename without the extension filename=$(basename -- "$file") filename="${filename%.*}" @@ -45,10 +45,10 @@ for board in "${periph_boards[@]}"; do done # Build all Default periph board -for board in "${periph_boards[@]}"; do - echo "Compiling AP_Periph for $board..." - ./waf configure --board "$board" -g - ./waf AP_Periph -done +# for board in "${periph_boards[@]}"; do +# echo "Compiling AP_Periph for $board..." +# ./waf configure --board "$board" -g +# ./waf AP_Periph +# done echo "Script completed successfully." diff --git a/libraries/AP_BLHeli/AP_BLHeli.cpp b/libraries/AP_BLHeli/AP_BLHeli.cpp index b6537fc9e4..64d6b09932 100644 --- a/libraries/AP_BLHeli/AP_BLHeli.cpp +++ b/libraries/AP_BLHeli/AP_BLHeli.cpp @@ -1457,7 +1457,7 @@ void AP_BLHeli::read_telemetry_packet(void) const uint8_t motor_idx = motor_map[last_telem_esc]; if (telem_uart->read(buf, telem_packet_size) < telem_packet_size) { // short read, we should have all bytes ready when this function is called - increment_error_count(motor_idx - chan_offset); + // THIS LINE IS NOT ACTUALLY REACHABLE, SO WE DON'T LOG THIS (the caller already checks) return; } @@ -1470,7 +1470,7 @@ void AP_BLHeli::read_telemetry_packet(void) if (buf[telem_packet_size-1] != crc) { // bad crc debug("Bad CRC on %u", last_telem_esc); - increment_error_count(motor_idx - chan_offset); + increment_error_count(motor_idx - chan_offset, 1 << 16); return; } // record the previous rpm so that we can slew to the new one @@ -1602,7 +1602,7 @@ void AP_BLHeli::update_telemetry(void) // if we have more than 10 bytes then we don't know which ESC // they are from. Throw them all away telem_uart->discard_input(); - increment_error_count(motor_map[last_telem_esc] - chan_offset); + increment_error_count(motor_map[last_telem_esc] - chan_offset, 1); return; } if (nbytes > 0 && @@ -1618,7 +1618,7 @@ void AP_BLHeli::update_telemetry(void) if (nbytes > 0 && nbytes < telem_packet_size) { // we've waited long enough, discard bytes if we don't have 10 yet telem_uart->discard_input(); - increment_error_count(motor_map[last_telem_esc] - chan_offset); + increment_error_count(motor_map[last_telem_esc] - chan_offset, 1 << 8); return; } if (nbytes == telem_packet_size) { diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp index d393934aa6..76dca0d13e 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem.cpp @@ -337,7 +337,7 @@ bool AP_ESC_Telem::get_count(uint8_t esc_index, uint16_t& count) const } // get an individual ESC's error count if available, returns true on success -bool AP_ESC_Telem::get_error_count(uint8_t esc_index, uint16_t& error_count) const +bool AP_ESC_Telem::get_error_count(uint8_t esc_index, uint32_t& error_count) const { if (esc_index >= ESC_TELEM_MAX_ESCS) { return false; @@ -607,12 +607,12 @@ void AP_ESC_Telem::update_telem_data(const uint8_t esc_index, const AP_ESC_Telem } // callback to increment the error count in the frontend, should be called by the driver when an error occurs -void AP_ESC_Telem::increment_error_count(const uint8_t esc_index) +void AP_ESC_Telem::increment_error_count(const uint8_t esc_index, const uint32_t amount) { if (esc_index >= ESC_TELEM_MAX_ESCS) { return; } - _telem_data[esc_index].error_count++; + _telem_data[esc_index].error_count += amount; } // record an update to the RPM together with timestamp, this allows the notch values to be slewed diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem.h b/libraries/AP_ESC_Telem/AP_ESC_Telem.h index 129a3570fa..ed125c5bb9 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem.h +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem.h @@ -71,7 +71,7 @@ class AP_ESC_Telem { bool get_count(uint8_t esc_index, uint16_t& count) const; // get an individual ESC's error count if available, returns true on success - bool get_error_count(uint8_t esc_index, uint16_t& error_count) const; + bool get_error_count(uint8_t esc_index, uint32_t& error_count) const; #if AP_EXTENDED_ESC_TELEM_ENABLED // get an individual ESC's input duty cycle if available, returns true on success @@ -129,7 +129,7 @@ class AP_ESC_Telem { void update_telem_data(const uint8_t esc_index, const AP_ESC_Telem_Backend::TelemetryData& new_data, const uint16_t data_mask); // callback to increment the error count in the frontend, should be called by the driver when an error occurs - void increment_error_count(const uint8_t esc_index); + void increment_error_count(const uint8_t esc_index, const uint32_t amount); #if AP_SCRIPTING_ENABLED /* diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp b/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp index 5d9f1c66cc..8733389ae6 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.cpp @@ -46,8 +46,8 @@ void AP_ESC_Telem_Backend::update_telem_data(const uint8_t esc_index, const Tele } // callback to increment the error count in the frontend, should be called by the driver when an error occurs -void AP_ESC_Telem_Backend::increment_error_count(const uint8_t esc_index) { - _frontend->increment_error_count(esc_index); +void AP_ESC_Telem_Backend::increment_error_count(const uint8_t esc_index, const uint32_t amount) { + _frontend->increment_error_count(esc_index, amount); } /* diff --git a/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.h b/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.h index 0aa511ba6b..992afd3c77 100644 --- a/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.h +++ b/libraries/AP_ESC_Telem/AP_ESC_Telem_Backend.h @@ -75,7 +75,7 @@ class AP_ESC_Telem_Backend { void update_telem_data(const uint8_t esc_index, const TelemetryData& new_data, const uint16_t data_present_mask); // callback to increment the error count in the frontend, should be called by the driver when an error occurs - void increment_error_count(const uint8_t esc_index); + void increment_error_count(const uint8_t esc_index, const uint32_t amount); private: AP_ESC_Telem* _frontend;