Skip to content

Commit 13b1496

Browse files
committed
Add Adafruit RP2040 Adalogger to PIO and codebase
1 parent affdf95 commit 13b1496

File tree

8 files changed

+53
-24
lines changed

8 files changed

+53
-24
lines changed

.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ tests/__pycache__/
5555
# These sometimes contain credentials, don't commit them!
5656
src/Wippersnapper_demo_wokwi.ino
5757
data/
58+
examples/Wippersnapper_demo_offline/.theia/
59+
examples/Wippersnapper_demo_offline/.vscode/
60+
examples/Wippersnapper_demo_offline/build/
5861

5962
# Test results
60-
report.xml
63+
report.xml
64+
65+
# VSCode settings
66+
.vscode/settings.json

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
"span": "cpp",
1313
"*.tcc": "cpp",
1414
"list": "cpp",
15-
"unordered_set": "cpp"
15+
"unordered_set": "cpp",
16+
"format": "cpp",
17+
"text_encoding": "cpp",
18+
"regex": "cpp"
1619
},
1720
"C_Cpp.dimInactiveRegions": false,
1821
"dotnet.defaultSolution": "disable",

platformio.ini

+12-3
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,15 @@ build_flags = -DUSE_TINYUSB=1
410410
-DADAFRUIT_METRO_M4_AIRLIFT_LITE
411411
upload_port = /dev/cu.usbmodem1201
412412

413+
[env:raspberrypi_pico]
414+
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop
415+
board = rpipico
416+
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git
417+
board_build.filesystem_size = 0.5m
418+
build_flags = -DUSE_TINYUSB
419+
; Once https://github.com/platformio/platformio-core > 6.1.11 these can be removed
420+
lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library
421+
413422
[env:raspberrypi_pico_2]
414423
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop
415424
board = rpipico2
@@ -419,12 +428,12 @@ build_flags = -DUSE_TINYUSB -DBUILD_OFFLINE_ONLY
419428
; Once https://github.com/platformio/platformio-core > 6.1.11 these can be removed
420429
lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library
421430

422-
[env:raspberrypi_pico]
431+
[env:adafruit_feather_adalogger]
423432
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#develop
424-
board = rpipico
433+
board = adafruit_feather_adalogger
425434
platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git
426435
board_build.filesystem_size = 0.5m
427-
build_flags = -DUSE_TINYUSB
436+
build_flags = -DUSE_TINYUSB -DBUILD_OFFLINE_ONLY
428437
; Once https://github.com/platformio/platformio-core > 6.1.11 these can be removed
429438
lib_ignore = WiFiNINA, WiFi101, Adafruit Zero DMA Library
430439

src/Wippersnapper_Boards.h

+6
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@
202202
#define USE_TINYUSB
203203
#define USE_STATUS_LED
204204
#define STATUS_LED_PIN LED_BUILTIN
205+
#elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040_ADALOGGER)
206+
#define BOARD_ID "feather-rp2040-adalogger"
207+
#define USE_TINYUSB
208+
#define USE_STATUS_NEOPIXEL
209+
#define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL
210+
#define STATUS_NEOPIXEL_NUM 1
205211
#else
206212
#warning "Board type not identified within Wippersnapper_Boards.h!"
207213
#endif

src/Wippersnapper_demo.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// All text above must be included in any redistribution.
1010

1111
#include "ws_adapters.h"
12-
ws_adapter_wifi wipper;
12+
//ws_adapter_wifi wipper;
1313
// Uncomment the following line to use the offline adapter for Pico
14-
// ws_adapter_offline wipper;
14+
ws_adapter_offline wipper;
1515

1616
#define WS_DEBUG // Enable debug output!
1717

src/adapters/offline/ws_offline_pico.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
#ifndef WS_OFFLINE_PICO
1717
#define WS_OFFLINE_PICO
1818

19-
#if defined(ARDUINO_RASPBERRY_PI_PICO) || defined(ARDUINO_RASPBERRY_PI_PICO_2)
19+
#if defined(ARDUINO_RASPBERRY_PI_PICO) || \
20+
defined(ARDUINO_RASPBERRY_PI_PICO_2) || \
21+
defined(ARDUINO_ADAFRUIT_FEATHER_RP2040_ADALOGGER)
2022

2123
#define PICO_CONNECT_TIMEOUT_MS 20000 /*!< Connection timeout (in ms) */
2224
#define PICO_CONNECT_RETRY_DELAY_MS 200 /*!< delay time between retries. */
@@ -170,5 +172,5 @@ class ws_offline_pico : public Wippersnapper_V2 {
170172
}
171173
};
172174

173-
#endif // RASPBERRY_PI_PICO_W
174-
#endif // WS_NONET_PICO_H
175+
#endif // RASPBERRY_PI_PICO
176+
#endif // WS_OFFLINE_PICO

src/provisioning/tinyusb/Wippersnapper_FS.cpp

+14-13
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
defined(ARDUINO_RASPBERRY_PI_PICO_W) || \
2727
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S3_REVTFT) || \
2828
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32S2_REVTFT) || \
29-
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2) || \
30-
defined(ARDUINO_RASPBERRY_PI_PICO) || \
31-
defined(ARDUINO_RASPBERRY_PI_PICO_2)
29+
defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2) || \
30+
defined(ARDUINO_RASPBERRY_PI_PICO) || \
31+
defined(ARDUINO_RASPBERRY_PI_PICO_2) || \
32+
defined(ARDUINO_ADAFRUIT_FEATHER_RP2040_ADALOGGER)
3233
#include "Wippersnapper_FS.h"
3334
// On-board external flash (QSPI or SPI) macros should already
3435
// defined in your board variant if supported
@@ -174,7 +175,7 @@ Wippersnapper_FS::~Wippersnapper_FS() {
174175
config.json file.
175176
*/
176177
/**************************************************************************/
177-
void Wippersnapper_FS::GetSDCSPin() {
178+
void Wippersnapper_FS::GetSDCSPin() {
178179
File32 file_cfg;
179180
DeserializationError error;
180181
// Attempt to open and deserialize the config.json file
@@ -554,16 +555,16 @@ void Wippersnapper_FS::fsHalt(String msg) {
554555
*/
555556
/**************************************************************************/
556557
void Wippersnapper_FS::fsHalt(String msg, ws_led_status_t ledStatusColor) {
557-
TinyUSBDevice.attach();
558-
delay(500);
559-
statusLEDSolid(ledStatusColor);
560-
while (1) {
561-
WS_DEBUG_PRINT("Execution Halted: ");
562-
WS_DEBUG_PRINTLN(msg.c_str());
563-
delay(5000);
564-
yield();
565-
}
558+
TinyUSBDevice.attach();
559+
delay(500);
560+
statusLEDSolid(ledStatusColor);
561+
while (1) {
562+
WS_DEBUG_PRINT("Execution Halted: ");
563+
WS_DEBUG_PRINTLN(msg.c_str());
564+
delay(5000);
565+
yield();
566566
}
567+
}
567568

568569
#ifdef ARDUINO_FUNHOUSE_ESP32S2
569570
/**************************************************************************/

src/ws_adapters.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ typedef ws_wifi_ninafw ws_adapter_wifi;
4343
/**
4444
* The following are adapters for use without networking functionality.
4545
*/
46-
#elif defined(ARDUINO_RASPBERRY_PI_PICO_2) || defined(ARDUINO_RASPBERRY_PI_PICO)
46+
#elif defined(ARDUINO_RASPBERRY_PI_PICO_2) || \
47+
defined(ARDUINO_RASPBERRY_PI_PICO) || \
48+
defined(ARDUINO_ADAFRUIT_FEATHER_RP2040_ADALOGGER)
4749
#include "adapters/offline/ws_offline_pico.h"
4850
typedef ws_offline_pico ws_adapter_offline;
4951
#else

0 commit comments

Comments
 (0)