diff --git a/src/hardware/wifictl.cpp b/src/hardware/wifictl.cpp index 92d8ac9..7b814fa 100644 --- a/src/hardware/wifictl.cpp +++ b/src/hardware/wifictl.cpp @@ -457,6 +457,12 @@ void wifictl_off( void ) { while( wifictl_get_event( WIFICTL_OFF_REQUEST | WIFICTL_ON_REQUEST ) ) { yield(); } + + if ( !wifictl_get_event( WIFICTL_ACTIVE ) ) { + log_i("wifictl not active"); + return; + } + wifictl_set_event( WIFICTL_OFF_REQUEST ); vTaskResume( _wifictl_Task ); } diff --git a/src/my-ttgo-watch.ino b/src/my-ttgo-watch.ino index 976d97a..4652659 100644 --- a/src/my-ttgo-watch.ino +++ b/src/my-ttgo-watch.ino @@ -86,7 +86,8 @@ void setup() * */ - wifictl_on(); + if (wifictl_get_autoon() && (ttgo->power->isChargeing() || ttgo->power->isVBUSPlug() || (ttgo->power->getBattVoltage() > 3400))) + wifictl_on(); splash_screen_stage_finish( ttgo ); display_set_brightness( display_get_brightness() );