diff --git a/src/apps/LoRaMac/periodic-uplink-lpp/SKiM980A/main.c b/src/apps/LoRaMac/periodic-uplink-lpp/SKiM980A/main.c index 052664329..06a391e99 100644 --- a/src/apps/LoRaMac/periodic-uplink-lpp/SKiM980A/main.c +++ b/src/apps/LoRaMac/periodic-uplink-lpp/SKiM980A/main.c @@ -151,7 +151,7 @@ static TimerEvent_t LedBeaconTimer; /*! * Timer to handle the state of Display indicator */ -static TimerEvent_t DisplayTimer; +TimerEvent_t DisplayTimer; static void OnMacProcessNotify( void ); static void OnNvmDataChange( LmHandlerNvmContextStates_t state, uint16_t size ); diff --git a/src/boards/SKiM980A/board.c b/src/boards/SKiM980A/board.c index 3db25a01f..ba5f0b7c4 100644 --- a/src/boards/SKiM980A/board.c +++ b/src/boards/SKiM980A/board.c @@ -625,7 +625,7 @@ void SysTick_Handler( void ) uint8_t GetBoardPowerSource( void ) { - return USB_POWER; + return BATTERY_POWER; } /** diff --git a/src/boards/SKiM980A/display-board.c b/src/boards/SKiM980A/display-board.c index caad5947a..8d57ecbc9 100644 --- a/src/boards/SKiM980A/display-board.c +++ b/src/boards/SKiM980A/display-board.c @@ -41,6 +41,7 @@ uint8_t m_seg_offset = 0; volatile uint8_t BlackImage[Imagesize]; extern PAINT Paint; static bool wkup = 0; +extern TimerEvent_t DisplayTimer; /******************************************************************************** function: reverse a byte data @@ -57,21 +58,23 @@ void DisplayMcuOnKey1Signal( void* context ) { // Wake up if(wkup == 0) { - LpmSetStopMode( LPM_DISPLAY_ID , LPM_ENABLE ); + LpmSetOffMode( LPM_DISPLAY_ID , LPM_ENABLE ); DisplayOff(); wkup = 1; + TimerStop(&DisplayTimer); /*Suspend Tick increment to prevent wakeup by Systick interrupt. Otherwise the Systick interrupt will wake up the device within 1ms (HAL time base)*/ // HAL_SuspendTick(); // LpmEnterStopMode(); } else { - LpmSetStopMode( LPM_DISPLAY_ID , LPM_DISABLE ); + LpmSetOffMode( LPM_DISPLAY_ID , LPM_DISABLE ); wkup = 0; /* Resume Tick interrupt if disabled prior to SLEEP mode entry */ // HAL_ResumeTick(); DisplayInitReg(); DisplayOn(); + TimerStart(&DisplayTimer); } }