From d8959b340058d0d6e0f5cebd760bb83e22ecfa50 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Mon, 11 Feb 2019 16:53:22 +0900 Subject: [PATCH] AP_KDECAN: use AP_Logger::Write_ESC --- libraries/AP_KDECAN/AP_KDECAN.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libraries/AP_KDECAN/AP_KDECAN.cpp b/libraries/AP_KDECAN/AP_KDECAN.cpp index 75bdad090b..dc4912c786 100644 --- a/libraries/AP_KDECAN/AP_KDECAN.cpp +++ b/libraries/AP_KDECAN/AP_KDECAN.cpp @@ -627,16 +627,11 @@ void AP_KDECAN::update() // log ESC telemetry data for (uint8_t i = 0; i < _esc_max_node_id; i++) { if (telem_buffer[i].new_data) { - struct log_Esc pkt = { - LOG_PACKET_HEADER_INIT(uint8_t(LOG_ESC1_MSG+i)), - time_us : telem_buffer[i].time, - rpm : int32_t(telem_buffer[i].rpm * 60UL * 2 / num_poles * 100), - voltage : telem_buffer[i].voltage, - current : telem_buffer[i].current, - temperature : int16_t(telem_buffer[i].temp * 100U), - current_tot : 0 - }; - df->WriteBlock(&pkt, sizeof(pkt)); + df->Write_ESC(i, telem_buffer[i].time, + int32_t(telem_buffer[i].rpm * 60UL * 2 / num_poles * 100), + telem_buffer[i].voltage, + telem_buffer[i].current, + int16_t(telem_buffer[i].temp * 100U), 0); } } }