Skip to content

Commit

Permalink
HACK: AP_Periph: send ESC count and error count
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
robertlong13 committed Oct 20, 2024
1 parent a874f24 commit 8c817f2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Tools/AP_Periph/can.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 8c817f2

Please sign in to comment.