Fix Indentation

pull/84/head
KatAst 9 years ago
parent 9dd3eac804
commit cf7635dad7
  1. 40
      esp-link/cgiwifi.c

@ -301,27 +301,33 @@ static ETSTimer resetTimer;
// the connect succeeds, this gets the module in STA-only mode. If it fails, it ensures // the connect succeeds, this gets the module in STA-only mode. If it fails, it ensures
// that the module is in STA+AP mode so the user has a chance to recover. // that the module is in STA+AP mode so the user has a chance to recover.
static void ICACHE_FLASH_ATTR resetTimerCb(void *arg) { static void ICACHE_FLASH_ATTR resetTimerCb(void *arg) {
int x = wifi_station_get_connect_status(); int x = wifi_station_get_connect_status();
int m = wifi_get_opmode() & 0x3; int m = wifi_get_opmode() & 0x3;
DBG("Wifi check: mode=%s status=%d\n", wifiMode[m], x); DBG("Wifi check: mode=%s status=%d\n", wifiMode[m], x);
if(m!=2){ if(m!=2){
if( x == STATION_GOT_IP ){ if ( x == STATION_GOT_IP ) {
if (m != 1) {
#ifdef CHANGE_TO_STA #ifdef CHANGE_TO_STA
if(m != 1) // We're happily connected, go to STA mode
wifi_set_opmode(1); DBG("Wifi got IP. Going into STA mode..\n");
wifi_set_opmode(1);
os_timer_arm(&resetTimer, RESET_TIMEOUT, 0); // check one more time after switching to STA-only
#endif #endif
log_uart(false);
}else{
log_uart(true);
DBG("Enabling/continuing uart log\n");
if (m==1){
wifi_set_opmode(3);
wifi_softap_set_config(&apconf);
}
os_timer_arm(&resetTimer, RESET_TIMEOUT, 0);
}
} }
log_uart(false);
// no more resetTimer at this point, gotta use physical reset to recover if in trouble
} else {
if (m != 3) {
DBG("Wifi connect failed. Going into STA+AP mode..\n");
wifi_set_opmode(3);
wifi_softap_set_config(&apconf);
}
log_uart(true);
DBG("Enabling/continuing uart log\n");
os_timer_arm(&resetTimer, RESET_TIMEOUT, 0);
}
}
} }
// Reassociate timer to delay change of association so the original request can finish // Reassociate timer to delay change of association so the original request can finish

Loading…
Cancel
Save