Skip to content

Commit 765cb4a

Browse files
committed
build for esp32dev CLI
1 parent 4335c24 commit 765cb4a

File tree

6 files changed

+18
-5
lines changed

6 files changed

+18
-5
lines changed

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ lib_compat_mode = soft ; can be strict once pio detects SleepyDog on RP2040
132132
extends = common:esp32
133133
board = esp32dev
134134
board_build.partitions = default_8MB.csv
135-
build_flags = -DARDUINO_ESP32_DEV -DOFFLINE_MODE_DEBUG -DOFFLINE_MODE_WOKWI
135+
build_flags = -DARDUINO_ESP32_DEV -DOFFLINE_MODE_DEBUG -DOFFLINE_MODE_WOKWI -DBUILD_OFFLINE_ONLY
136136
board_build.filesystem = littlefs
137137
upload_speed = 921600
138138

src/Wippersnapper_V2.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,8 +1241,9 @@ void Wippersnapper_V2::connect() {
12411241
#endif
12421242
// Call the TL signal decoder to parse the incoming JSON data
12431243
callDecodeB2D();
1244-
1244+
#ifndef OFFLINE_MODE_WOKWI
12451245
WsV2._fileSystemV2->WriteFileConfig();
1246+
#endif // OFFLINE_MODE_WOKWI used for CI test simulations, lacks TinyUSB
12461247
WS_DEBUG_PRINTLN("[APP] Hardware configured!");
12471248
// Blink status LED to green to indicate successful configuration
12481249
setStatusLEDColor(0x00A300, WsV2.status_pixel_brightnessV2);

src/Wippersnapper_demo.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Adafruit IO WipperSnapper
2+
// USE ONLY WITH DEVICES WITHOUT A NETWORK ADAPTER LIKE RP2040 PICO
23
//
34
// Adafruit invests time and resources providing this open source code.
45
// Please support Adafruit and open source hardware by purchasing
56
// products from Adafruit!
67
//
7-
// Brent Rubell for Adafruit Industries, 2020-2025
8+
// Brent Rubell for Adafruit Industries, 2025
89
//
910
// All text above must be included in any redistribution.
1011

1112
#include "ws_adapters.h"
12-
ws_adapter_wifi wipper;
13-
13+
ws_adapter_offline wipper;
1414
#define WS_DEBUG // Enable debug output!
1515

1616
void setup() {

src/components/i2c/controller.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,11 @@ bool I2cController::Handle_I2cDeviceAddOrReplace(pb_istream_t *stream) {
767767
// Use the "default" types from the sensor driver
768768
drv->SetSensorTypes(true);
769769
drv->SetPeriod(DEFAULT_SENSOR_PERIOD);
770+
#ifndef OFFLINE_MODE_WOKWI
770771
WsV2._fileSystemV2->AddI2cDeviceToFileConfig(
771772
device_descriptor.i2c_device_address, driverName,
772773
drv->GetSensorTypeStrings(), drv->GetNumSensorTypes());
774+
#endif
773775
did_find_driver = true;
774776
break;
775777
}

src/provisioning/sdcard/ws_sdcard.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ ws_sdcard::ws_sdcard() {
6464
if (!did_init) {
6565
if (InitSdCard(SD_CS_PIN)) {
6666
// Attempt to update the config file with the default pin
67+
#ifndef OFFLINE_MODE_WOKWI
6768
did_init = WsV2._fileSystemV2->AddSDCSPinToFileConfig(SD_CS_PIN);
69+
#else // WOKWI Test Mode
70+
WsV2.pin_sd_cs = 15;
71+
did_init = true;
72+
#endif
6873
}
6974
}
7075

@@ -714,6 +719,7 @@ bool ws_sdcard::ParseFileConfig() {
714719
WS_DEBUG_PRINTLN("[SD] Deserializing config.json...");
715720
JsonDocument &doc = WsV2._fileSystemV2->GetDocCfg();
716721
#else
722+
JsonDocument doc;
717723
// Use test data, not data from the filesystem
718724
if (!_use_test_data) {
719725
WS_DEBUG_PRINTLN("[SD] Parsing Serial Input...");

src/ws_adapters.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ typedef ws_wifi_airlift ws_adapter_wifi;
3030
#define SD_CS_PIN 15
3131
#include "adapters/wifi/ws_wifi_esp8266.h"
3232
typedef ws_wifi_esp8266 ws_adapter_wifi;
33+
#elif defined(ARDUINO_ESP32_DEV) || defined(ESP32_DEV)
34+
#define SD_CS_PIN 15
35+
#include "adapters/wifi/ws_wifi_esp32.h"
36+
typedef ws_wifi_esp32 ws_adapter_offline;
3337
// ESP32 networking adapter
3438
#elif defined(ARDUINO_ARCH_ESP32)
3539
#define SD_CS_PIN 33

0 commit comments

Comments
 (0)