Skip to content

Commit 8d261ec

Browse files
committed
Allow for SPI1 port to be used on Feather RP2040 Adalogger
1 parent 835b601 commit 8d261ec

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/Wippersnapper_Boards.h

+1
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@
208208
#define USE_STATUS_NEOPIXEL
209209
#define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL
210210
#define STATUS_NEOPIXEL_NUM 1
211+
#define SD_USE_SPI_1
211212
#else
212213
#warning "Board type not identified within Wippersnapper_Boards.h!"
213214
#endif

src/Wippersnapper_demo.ino

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@
1111
#include "ws_adapters.h"
1212
ws_adapter_wifi wipper;
1313
// Uncomment the following line to use the offline adapter for Pico
14-
// ws_adapter_offline wipper;
15-
14+
//ws_adapter_offline wipper;
1615
#define WS_DEBUG // Enable debug output!
1716

1817
void setup() {
1918
Serial.begin(115200);
20-
while (!Serial) delay(10);
19+
while (!Serial)
20+
delay(10);
2121
wipper.provision();
2222
wipper.connect();
2323
}
2424

25-
void loop() {
26-
wipper.run();
27-
}
25+
void loop() { wipper.run(); }

src/provisioning/sdcard/ws_sdcard.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
*/
2121
/**************************************************************************/
2222
ws_sdcard::ws_sdcard()
23+
#ifdef SD_USE_SPI_1
24+
: _sd_spi_cfg(WsV2.pin_sd_cs, DEDICATED_SPI, SPI_SD_CLOCK, &SPI1) {
25+
#else
2326
: _sd_spi_cfg(WsV2.pin_sd_cs, DEDICATED_SPI, SPI_SD_CLOCK) {
27+
#endif
2428
is_mode_offline = false;
2529
_use_test_data = false;
2630
_is_soft_rtc = false;
@@ -38,6 +42,7 @@ ws_sdcard::ws_sdcard()
3842
is_mode_offline = false;
3943
return;
4044
}
45+
4146
// Card initialized - calculate file limits
4247
is_mode_offline = true;
4348
calculateFileLimits();

src/provisioning/sdcard/ws_sdcard.h

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
defined(ARDUINO_ADAFRUIT_FEATHER_ESP32_V2)
2626
#define SPI_SD_CLOCK \
2727
SD_SCK_MHZ(25) ///< For ESP32/Pico silicon rev 3.0, we clock at 25MHz
28+
#elif defined(ARDUINO_ADAFRUIT_FEATHER_RP2040_ADALOGGER)
29+
#define SPI_SD_CLOCK \
30+
SD_SCK_MHZ(16) ///< For the RP2040 adalogger, we clock at 16MHz
2831
#else
2932
#define SPI_SD_CLOCK SD_SCK_MHZ(50) ///< Default SPI clock speed
3033
#endif

0 commit comments

Comments
 (0)