From ee1534103bc64f2e2f22d430c404e8f08a5803bb Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 14 Dec 2023 00:31:09 +0100 Subject: [PATCH] make sure to turn off the antenna if entering this state --- armsrc/appmain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 66fdcf3a3..9267ecffd 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -2826,13 +2826,14 @@ void __attribute__((noreturn)) AppMain(void) { usart_init(USART_BAUD_RATE, USART_PARITY); #endif + allow_send_wtx = true; + // This is made as late as possible to ensure enumeration without timeout // against device such as http://www.hobbytronics.co.uk/usb-host-board-v2 // In other words, keep the interval between usb_enable() and the main loop as short as possible. // (AT91F_CDC_Enumerate() will be called in the main loop) usb_disable(); usb_enable(); - allow_send_wtx = true; for (;;) { WDT_HIT(); @@ -2840,6 +2841,7 @@ void __attribute__((noreturn)) AppMain(void) { if (*_stack_start != 0xdeadbeef) { Dbprintf("Stack overflow detected! Please increase stack size, currently %d bytes", (uint32_t)_stack_end - (uint32_t)_stack_start); Dbprintf("Unplug your device now."); + hf_field_off(); while (1); }