From 61b5d372c1389c861fec51c9b92d2e841a7809fb Mon Sep 17 00:00:00 2001 From: torsten Date: Tue, 26 Oct 2021 17:14:51 +0200 Subject: [PATCH] AP_FETtecOneWire: reset buf_used if byte is missing due to electrical noise it can now resync --- libraries/AP_FETtecOneWire/AP_FETtecOneWire.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/AP_FETtecOneWire/AP_FETtecOneWire.cpp b/libraries/AP_FETtecOneWire/AP_FETtecOneWire.cpp index 9a5a2dc5b1..156e2a7d0d 100644 --- a/libraries/AP_FETtecOneWire/AP_FETtecOneWire.cpp +++ b/libraries/AP_FETtecOneWire/AP_FETtecOneWire.cpp @@ -606,6 +606,7 @@ void AP_FETtecOneWire::escs_set_values(const uint16_t* motor_values) // No command was yet sent, so no reply is expected and all information // on the receive buffer is either garbage or noise. Discard it _uart->discard_input(); + _receive_buf_used = 0; // send throttle commands to all configured ESCs in a single packet transfer if (transmit(fast_throttle_command, sizeof(fast_throttle_command))) {