From 4585c9fdc1f5b2e6a962cc9d2be02bff5c347073 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 17 Jul 2022 12:56:38 +1000 Subject: [PATCH] AP_EFI: prevent flood of Lutan serial port send request at max 5Hz --- libraries/AP_EFI/AP_EFI_Serial_Lutan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_EFI/AP_EFI_Serial_Lutan.cpp b/libraries/AP_EFI/AP_EFI_Serial_Lutan.cpp index 89eade4ee9..f15e7d6916 100644 --- a/libraries/AP_EFI/AP_EFI_Serial_Lutan.cpp +++ b/libraries/AP_EFI/AP_EFI_Serial_Lutan.cpp @@ -91,7 +91,7 @@ void AP_EFI_Serial_Lutan::update() pkt_nbytes = 0; } } - if (n == 0 || now - last_request_ms > 200) { + if (now - last_request_ms > 200) { last_request_ms = now; port->discard_input(); send_request();