testing code
This commit is contained in:
@@ -171,6 +171,11 @@ void pmu_loop( TTGOClass *ttgo ) {
|
||||
*/
|
||||
if ( xEventGroupGetBitsFromISR( pmu_event_handle ) & PMU_EVENT_AXP_INT ) {
|
||||
setCpuFrequencyMhz(240);
|
||||
if ( powermgm_get_event( POWERMGM_PMU_BATTERY | POWERMGM_PMU_BUTTON | POWERMGM_STANDBY_REQUEST ) ) {
|
||||
ttgo->power->clearIRQ();
|
||||
xEventGroupClearBits( pmu_event_handle, PMU_EVENT_AXP_INT );
|
||||
return;
|
||||
}
|
||||
|
||||
ttgo->power->readIRQ();
|
||||
if (ttgo->power->isVbusPlugInIRQ()) {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <WiFi.h>
|
||||
#include "config.h"
|
||||
#include "timesync.h"
|
||||
#include "powermgm.h"
|
||||
|
||||
EventGroupHandle_t time_event_handle = NULL;
|
||||
TaskHandle_t _timesync_Task;
|
||||
@@ -123,6 +124,11 @@ void timesyncToRTC( void ) {
|
||||
}
|
||||
|
||||
void timesync_Task( void * pvParameters ) {
|
||||
if ( powermgm_get_event( POWERMGM_STANDBY | POWERMGM_STANDBY_REQUEST ) ) {
|
||||
log_i("block time sync task");
|
||||
xEventGroupClearBits( time_event_handle, TIME_SYNC_REQUEST );
|
||||
vTaskDelete( NULL );
|
||||
}
|
||||
log_i("start time sync task");
|
||||
|
||||
if ( xEventGroupGetBits( time_event_handle ) & TIME_SYNC_REQUEST ) {
|
||||
|
||||
Reference in New Issue
Block a user