From 84ac1ac41d6e8f3ed039696667f4715bbe9c4cb3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 22 Feb 2020 10:07:26 +1100 Subject: [PATCH] AP_Periph: don't probe rangefinder continuously --- Tools/AP_Periph/can.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tools/AP_Periph/can.cpp b/Tools/AP_Periph/can.cpp index ee892b2c9f..889c2f09de 100644 --- a/Tools/AP_Periph/can.cpp +++ b/Tools/AP_Periph/can.cpp @@ -1525,6 +1525,7 @@ void AP_Periph_FW::can_rangefinder_update(void) if (rangefinder.get_type(0) == RangeFinder::Type::NONE) { return; } +#if CAN_PROBE_CONTINUOUS if (rangefinder.num_sensors() == 0) { uint32_t now = AP_HAL::millis(); static uint32_t last_probe_ms; @@ -1533,6 +1534,7 @@ void AP_Periph_FW::can_rangefinder_update(void) rangefinder.init(ROTATION_NONE); } } +#endif uint32_t now = AP_HAL::millis(); static uint32_t last_update_ms; if (now - last_update_ms < 20) {