Changed to Macro debug

pull/84/head
KatAst 9 years ago
parent 8adfcb6e60
commit 6f4cead199
  1. 20
      esp-link/cgiwifi.c

@ -855,9 +855,9 @@ void ICACHE_FLASH_ATTR wifiInit() {
wifi_station_get_config_default(&stconf); wifi_station_get_config_default(&stconf);
wifi_softap_get_config_default(&apconf); wifi_softap_get_config_default(&apconf);
#ifdef CGIWIFI_DBG
os_printf("Wifi init, mode=%s\n",wifiMode[x]); DBG("Wifi init, mode=%s\n",wifiMode[x]);
#endif
// STATION parameters only on a full flash, because default opmode is 2 // STATION parameters only on a full flash, because default opmode is 2
#if defined(STA_SSID) && defined(STA_PASS) #if defined(STA_SSID) && defined(STA_PASS)
@ -866,9 +866,9 @@ void ICACHE_FLASH_ATTR wifiInit() {
if (os_strlen((char*)stconf.ssid) == 0 && os_strlen((char*)stconf.password) == 0) { if (os_strlen((char*)stconf.ssid) == 0 && os_strlen((char*)stconf.password) == 0) {
os_strncpy((char*)stconf.ssid, VERS_STR(STA_SSID), 32); os_strncpy((char*)stconf.ssid, VERS_STR(STA_SSID), 32);
os_strncpy((char*)stconf.password, VERS_STR(STA_PASS), 64); os_strncpy((char*)stconf.password, VERS_STR(STA_PASS), 64);
#ifdef CGIWIFI_DBG
os_printf("Wifi pre-config trying to connect to AP %s pw %s\n",(char*)stconf.ssid, (char*)stconf.password); DBG("Wifi pre-config trying to connect to AP %s pw %s\n",(char*)stconf.ssid, (char*)stconf.password);
#endif
// wifi_set_phy_mode(2); // limit to 802.11b/g 'cause n is flaky // wifi_set_phy_mode(2); // limit to 802.11b/g 'cause n is flaky
stconf.bssid_set = 0; stconf.bssid_set = 0;
wifi_station_set_config(&stconf); wifi_station_set_config(&stconf);
@ -923,13 +923,11 @@ void ICACHE_FLASH_ATTR wifiInit() {
if(AP_BEACON_INTERVAL >= 100 && AP_BEACON_INTERVAL <= 60000) if(AP_BEACON_INTERVAL >= 100 && AP_BEACON_INTERVAL <= 60000)
apconf.beacon_interval = AP_BEACON_INTERVAL; apconf.beacon_interval = AP_BEACON_INTERVAL;
#endif #endif
// Check save softap config // Check softap config
bool softap_set_conf = wifi_softap_set_config(&apconf); bool softap_set_conf = wifi_softap_set_config(&apconf);
#ifdef CGIWIFI_DBG
// Debug info // Debug info
//os_printf("Wifi AP parameters: %s pw %s\n",(char*)apconf.ssid, (char*)apconf.password);
os_printf("Wifi Soft-AP parameters change: %s\n",softap_set_conf? "success":"fail"); DBG("Wifi Soft-AP parameters change: %s\n",softap_set_conf? "success":"fail");
#endif
#endif // AP_SSID && AP_PASS #endif // AP_SSID && AP_PASS
configWifiIP(); configWifiIP();

Loading…
Cancel
Save