From 6f3e3a913ae19e08956fe44845e37f986065de96 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Fri, 23 Jul 2021 13:49:47 +0530 Subject: [PATCH] AP_Periph: fix dna wait blink --- Tools/AP_Periph/can.cpp | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/Tools/AP_Periph/can.cpp b/Tools/AP_Periph/can.cpp index 9b887911ba..1d29ffd391 100644 --- a/Tools/AP_Periph/can.cpp +++ b/Tools/AP_Periph/can.cpp @@ -1223,25 +1223,6 @@ static bool can_do_dna(instance_t &ins) } const uint32_t now = AP_HAL::native_millis(); - const uint32_t led_pattern = 0xAAAA; - const uint32_t led_change_period = 50; - static uint8_t led_idx = 0; - static uint32_t last_led_change; - - if ((now - last_led_change > led_change_period) && AP_Periph_FW::no_iface_finished_dna) { - // blink LED in recognisable pattern while waiting for DNA -#ifdef HAL_GPIO_PIN_LED - palWriteLine(HAL_GPIO_PIN_LED, (led_pattern & (1U< led_change_period) && no_iface_finished_dna) { + // blink LED in recognisable pattern while waiting for DNA +#ifdef HAL_GPIO_PIN_LED + palWriteLine(HAL_GPIO_PIN_LED, (led_pattern & (1U< ins.send_next_node_id_allocation_request_at_ms) { can_do_dna(ins); @@ -1437,7 +1439,6 @@ void AP_Periph_FW::can_update() } static uint32_t last_1Hz_ms; - uint32_t now = AP_HAL::native_millis(); if (now - last_1Hz_ms >= 1000) { last_1Hz_ms = now; process1HzTasks(AP_HAL::native_micros64());