Skip to content

Commit

Permalink
Format ESP8266 + tweak pio target
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Nov 27, 2024
1 parent 179286d commit 399f5c4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 6 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,12 @@ extra_scripts = pre:rename_usb_config.py
[env:huzzah]
extends=common:esp8266
board = huzzah
build_flags = -DARDUINO_ESP8266_ADAFRUIT_HUZZAH
board_build.f_cpu = 80000000L
; Arduino CLI uses this from adafruit_ci#ci-wippersnapper
; esp8266:esp8266:huzzah:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200
build_flags =
-DARDUINO_ESP8266_ADAFRUIT_HUZZAH
-DDEBUG_ESP_PORT=Serial
board_build.filesystem = littlefs
upload_port = /dev/cu.SLAB_USBtoUART

Expand Down
9 changes: 4 additions & 5 deletions src/network_interfaces/Wippersnapper_ESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ class Wippersnapper_ESP8266 : public Wippersnapper {
delay(100);
// ESP8266 MUST be in STA mode to avoid device acting as client/server
WiFi.mode(WIFI_STA);
// WiFi.begin(_ssid, _pass);
_status = WS_NET_DISCONNECTED;
delay(100);

Expand All @@ -338,19 +337,19 @@ class Wippersnapper_ESP8266 : public Wippersnapper {

long startRetry = millis();
WS_DEBUG_PRINTLN("CONNECTING");

while (_wifiMulti.run(5000) != WL_CONNECTED &&
millis() - startRetry < 10000) {
millis() - startRetry < 10000) {
// ESP8266 WDT requires yield() during a busy-loop so it doesn't bite
yield();
}

if (WiFi.status() == WL_CONNECTED) {
_status = WS_NET_CONNECTED;
} else {
_status = WS_NET_DISCONNECTED;
}

WS.feedWDT();
}
}
Expand Down

0 comments on commit 399f5c4

Please sign in to comment.