Merge pull request #65 from datacute/stop-wifi-on-reboot

Honor wifi auto-on on reboot
This commit is contained in:
Dirk Broßwick
2020-08-21 14:57:47 +02:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@@ -457,6 +457,12 @@ void wifictl_off( void ) {
while( wifictl_get_event( WIFICTL_OFF_REQUEST | WIFICTL_ON_REQUEST ) ) { while( wifictl_get_event( WIFICTL_OFF_REQUEST | WIFICTL_ON_REQUEST ) ) {
yield(); yield();
} }
if ( !wifictl_get_event( WIFICTL_ACTIVE ) ) {
log_i("wifictl not active");
return;
}
wifictl_set_event( WIFICTL_OFF_REQUEST ); wifictl_set_event( WIFICTL_OFF_REQUEST );
vTaskResume( _wifictl_Task ); vTaskResume( _wifictl_Task );
} }

View File

@@ -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 ); splash_screen_stage_finish( ttgo );
display_set_brightness( display_get_brightness() ); display_set_brightness( display_get_brightness() );