From a575709088bf1aeb935aa58ec95df896e941da80 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sat, 12 Mar 2016 19:12:14 +0100 Subject: [PATCH] Horus power loop fixed if power button is held pressed. --- radio/src/opentx.h | 2 +- radio/src/targets/horus/board_horus.cpp | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 4f827b026..c21dfd7a7 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -311,7 +311,7 @@ #define cli() #define sei() extern void boardInit(); - #if defined(PCBTARANIS) + #if defined(PCBTARANIS) or defined(PCBHORUS) extern void boardOff(); #else #define boardOff() pwrOff(); diff --git a/radio/src/targets/horus/board_horus.cpp b/radio/src/targets/horus/board_horus.cpp index ffb766d4a..9898f2a47 100644 --- a/radio/src/targets/horus/board_horus.cpp +++ b/radio/src/targets/horus/board_horus.cpp @@ -167,7 +167,20 @@ void boardInit() ledBlue(); } -#endif + +void boardOff() +{ + BACKLIGHT_OFF(); + + while (pwrPressed()) { + wdt_reset(); + } + + SysTick->CTRL = 0; // turn off systick + pwrOff(); +} + +#endif // #if !defined(SIMU) #if defined(USB_JOYSTICK) && !defined(SIMU) extern USB_OTG_CORE_HANDLE USB_OTG_dev;