Skip to content

Commit

Permalink
Optimized display power consumption
Browse files Browse the repository at this point in the history
  • Loading branch information
Anol Paisal committed Jul 12, 2021
1 parent 6b901a5 commit 29c56bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/apps/LoRaMac/periodic-uplink-lpp/SKiM980A/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/boards/SKiM980A/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ void SysTick_Handler( void )

uint8_t GetBoardPowerSource( void )
{
return USB_POWER;
return BATTERY_POWER;
}

/**
Expand Down
7 changes: 5 additions & 2 deletions src/boards/SKiM980A/display-board.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 29c56bd

Please sign in to comment.