From 90c2c33b023cc4829a7eee26ce90b8db6ef8c309 Mon Sep 17 00:00:00 2001 From: Gautier Hattenberger Date: Thu, 18 Jan 2018 17:42:03 +0100 Subject: [PATCH] [radio] wait before testing if spektrum receiver should enter bind mode --- .../arch/stm32/subsystems/radio_control/spektrum_arch.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c index 68fcd9250d..f6d765d346 100644 --- a/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c +++ b/sw/airborne/arch/stm32/subsystems/radio_control/spektrum_arch.c @@ -759,6 +759,8 @@ void radio_control_spektrum_try_bind(void) { */ gpio_setup_input_pulldown(SPEKTRUM_BIND_PIN_PORT, SPEKTRUM_BIND_PIN); + sys_time_usleep(10); // wait for electrical level to stabilize + /* exit if the BIND_PIN is low, it needs to be pulled high at startup to initiate bind */ if (gpio_get(SPEKTRUM_BIND_PIN_PORT, SPEKTRUM_BIND_PIN) == 0) { @@ -771,6 +773,8 @@ void radio_control_spektrum_try_bind(void) { */ gpio_setup_input_pullup(SPEKTRUM_BIND_PIN_PORT, SPEKTRUM_BIND_PIN); + sys_time_usleep(10); // wait for electrical level to stabilize + /* exit if the BIND_PIN is high, it needs to be pulled low at startup to initiate bind */ if (gpio_get(SPEKTRUM_BIND_PIN_PORT, SPEKTRUM_BIND_PIN) != 0) {