bt call and pairing dialog. powermgm refactoring

This commit is contained in:
sharandac
2020-08-14 15:40:34 +02:00
parent 174ab77d2f
commit 46122f4c1a
19 changed files with 1145 additions and 173 deletions

View File

@@ -79,11 +79,20 @@ void display_standby( void ) {
dest_brightness = 0;
}
void display_wakeup( void ) {
void display_wakeup( bool silence ) {
TTGOClass *ttgo = TTGOClass::getWatch();
// normal wake up from standby
if ( powermgm_get_event( POWERMGM_PMU_BUTTON | POWERMGM_PMU_BATTERY | POWERMGM_BMA_WAKEUP ) ) {
// wakeup without display
if ( silence ) {
log_i("go silence wakeup");
ttgo->openBL();
ttgo->displayWakeup();
ttgo->bl->adjust( 0 );
brightness = 0;
dest_brightness = 0;
}
// wakeup with display
else {
log_i("go wakeup");
ttgo->openBL();
ttgo->displayWakeup();
@@ -92,16 +101,6 @@ void display_wakeup( void ) {
dest_brightness = display_get_brightness();
motor_vibe( 1 );
}
// silence wakeup request from standby
else if ( powermgm_get_event( POWERMGM_SILENCE_WAKEUP_REQUEST ) ) {
log_i("go silence wakeup");
ttgo->openBL();
ttgo->displayWakeup();
ttgo->bl->adjust( 0 );
brightness = 0;
dest_brightness = 0;
powermgm_set_event( POWERMGM_SILENCE_WAKEUP );
}
}
/*