File tree Expand file tree Collapse file tree 5 files changed +29
-4
lines changed Expand file tree Collapse file tree 5 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 125
125
#define BOARD_ID "qtpy-esp32s3"
126
126
#define USE_TINYUSB
127
127
#define USE_STATUS_NEOPIXEL
128
- #define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL
128
+ #define STATUS_NEOPIXEL_PIN PIN_NEOPIXELa
129
129
#elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32S3_N4R2 )
130
130
#define BOARD_ID "qtpy-esp32s3-n4r2"
131
131
#define USE_TINYUSB
132
132
#define USE_STATUS_NEOPIXEL
133
133
#define STATUS_NEOPIXEL_PIN PIN_NEOPIXEL
134
- #define STATUS_NEOPIXEL_NUM 1
134
+ #define STATUS_NEOPIXEL_NUM 1a
135
135
#define USE_PSRAM ///< Board has PSRAM, use it for dynamic memory allocation
136
136
#elif defined(ARDUINO_ADAFRUIT_QTPY_ESP32C3 )
137
137
#define BOARD_ID "qtpy-esp32c3"
Original file line number Diff line number Diff line change @@ -105,7 +105,10 @@ void Wippersnapper_V2::provisionV2() {
105
105
#endif
106
106
107
107
// Are we using sd-card/offline mode?
108
- WsV2._fileSystemV2 ->GetSDCSPin (); // TODO: Implement this for LittleFS TOO
108
+ #ifdef USE_TINYUSB
109
+ _fileSystemV2->GetSDCSPin ();
110
+ // TODO: Implement this for LittleFS TOO and do an elseif for USE_LITTLEFS
111
+ #endif
109
112
if (WsV2._sdCardV2 ->InitSDCard ())
110
113
return ;
111
114
Original file line number Diff line number Diff line change @@ -155,4 +155,25 @@ void WipperSnapper_LittleFS_V2::fsHalt(String msg) {
155
155
}
156
156
}
157
157
158
+ void WipperSnapper_LittleFS_V2::GetSDCSPin () {
159
+
160
+ BRENT YOU WERE HERE YOU WERE HERE !!!
161
+
162
+ File file_cfg = LittleFS.open (" /config.json" );
163
+ if (!file_cfg) {
164
+ WsV2.pin_sd_cs = 255 ;
165
+ return ;
166
+ }
167
+ DeserializationError error = deserializeJson (doc, file_cfg);
168
+ // failed to deserialize the config file, bail out
169
+ if (error) {
170
+ file_cfg.close ();
171
+ WsV2.pin_sd_cs = 255 ;
172
+ return ;
173
+ }
174
+ JsonObject exportedFromDevice = doc[" exportedFromDevice" ];
175
+ WsV2.pin_sd_cs = exportedFromDevice[" sd_cs_pin" ] | 255 ;
176
+ file_cfg.close ();
177
+ }
178
+
158
179
#endif
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ class WipperSnapper_LittleFS_V2 {
34
34
~WipperSnapper_LittleFS_V2 ();
35
35
void parseSecrets ();
36
36
void fsHalt (String msg);
37
+ void GetSDCSPin ();
37
38
};
38
39
extern Wippersnapper_V2 WsV2;
39
40
#endif // WIPPERSNAPPER_LITTLEFS_H
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ Wippersnapper_FS_V2::~Wippersnapper_FS_V2() {
162
162
wipperFatFs_v2.end ();
163
163
}
164
164
165
- void GetSDCSPin () {
165
+ void Wippersnapper_FS_V2:: GetSDCSPin () {
166
166
File32 file_cfg = wipperFatFs_v2.open (" /config.json" );
167
167
if (!file_cfg) {
168
168
WsV2.pin_sd_cs = 255 ;
You can’t perform that action at this time.
0 commit comments