add silence wakeup and touch feedback

This commit is contained in:
sharandac
2020-07-27 16:40:10 +02:00
parent 5bbc6f920d
commit 9458e11983
23 changed files with 178 additions and 69 deletions

View File

@@ -20,7 +20,7 @@ void pmu_setup( TTGOClass *ttgo ) {
// Turn on the IRQ used
ttgo->power->adc1Enable( AXP202_BATT_VOL_ADC1 | AXP202_BATT_CUR_ADC1 | AXP202_VBUS_VOL_ADC1 | AXP202_VBUS_CUR_ADC1, AXP202_ON);
ttgo->power->enableIRQ( AXP202_VBUS_REMOVED_IRQ | AXP202_VBUS_CONNECT_IRQ | AXP202_CHARGING_FINISHED_IRQ, AXP202_ON );
ttgo->power->enableIRQ( AXP202_VBUS_REMOVED_IRQ | AXP202_VBUS_CONNECT_IRQ | AXP202_CHARGING_FINISHED_IRQ | AXP202_TIMER_TIMEOUT_IRQ, AXP202_ON );
ttgo->power->clearIRQ();
// enable coulumb counter
@@ -95,6 +95,14 @@ void pmu_loop( TTGOClass *ttgo ) {
ttgo->power->clearIRQ();
return;
}
if ( ttgo->power->isTimerTimeoutIRQ() ) {
updatetrigger = true;
powermgm_set_event( POWERMGM_SILENCE_WAKEUP_REQUEST );
ttgo->power->clearTimerStatus();
ttgo->power->offTimer();
ttgo->power->clearIRQ();
return;
}
ttgo->power->clearIRQ();
xEventGroupClearBits( pmu_event_handle, PMU_EVENT_AXP_INT );
}