File tree Expand file tree Collapse file tree 7 files changed +15
-17
lines changed Expand file tree Collapse file tree 7 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ void Wippersnapper_V2::provisionV2() {
101
101
#ifdef USE_TINYUSB
102
102
_fileSystemV2 = new Wippersnapper_FS_V2 ();
103
103
#elif defined(USE_LITTLEFS)
104
- _littleFSV2 = new WipperSnapper_LittleFS ();
104
+ _littleFSV2 = new WipperSnapper_LittleFS_V2 ();
105
105
#endif
106
106
107
107
// Determine if app is in SDLogger mode
Original file line number Diff line number Diff line change 80
80
#include " provisioning/tinyusb/Wippersnapper_FS_V2.h"
81
81
#endif
82
82
#if defined(USE_LITTLEFS)
83
- #include " provisioning/littlefs/WipperSnapper_LittleFS .h"
83
+ #include " provisioning/littlefs/WipperSnapper_LittleFS_V2 .h"
84
84
#endif
85
85
86
86
#define WS_VERSION \
95
95
// Forward declarations (API v1)
96
96
class Wippersnapper_AnalogIO ;
97
97
class Wippersnapper_FS_V2 ;
98
- class WipperSnapper_LittleFS ;
98
+ class WipperSnapper_LittleFS_V2 ;
99
99
class ws_sdcard ;
100
100
#ifdef USE_DISPLAY
101
101
class ws_display_driver ;
@@ -207,7 +207,7 @@ class Wippersnapper_V2 {
207
207
// to free up space on the heap
208
208
Wippersnapper_AnalogIO *_analogIOV2; // /< Instance of analog io class
209
209
Wippersnapper_FS_V2 *_fileSystemV2; // /< Instance of Filesystem (native USB)
210
- WipperSnapper_LittleFS
210
+ WipperSnapper_LittleFS_V2
211
211
*_littleFSV2; // /< Instance of LittleFS Filesystem (non-native USB)
212
212
ws_sdcard *_sdCardV2; // /< Instance of SD card class
213
213
#ifdef USE_DISPLAY
Original file line number Diff line number Diff line change @@ -162,10 +162,9 @@ void WipperSnapper_LittleFS_V2::fsHalt(String msg) {
162
162
*/
163
163
/* *************************************************************************/
164
164
void WipperSnapper_LittleFS_V2::GetSDCSPin () {
165
- File32 file_cfg;
166
165
DeserializationError error;
167
166
// Attempt to open and deserialize the config.json file
168
- file_cfg = LittleFS.open (" /config.json" );
167
+ File file_cfg = LittleFS.open (" /config.json" );
169
168
if (!file_cfg)
170
169
WsV2.pin_sd_cs = 255 ;
171
170
error = deserializeJson (WsV2._config_doc , file_cfg);
Original file line number Diff line number Diff line change 16
16
#define WIPPERSNAPPER_LITTLEFS_V2_H
17
17
18
18
#include " Wippersnapper_V2.h"
19
-
20
19
#include < FS.h>
21
20
#include < LittleFS.h>
22
21
Original file line number Diff line number Diff line change @@ -466,7 +466,7 @@ bool ws_sdcard::CreateNewLogFile() {
466
466
_log_filename = log_filename_buffer;
467
467
468
468
// Attempt to create the new log file
469
- if (!file.open (_log_filename, FILE_WRITE ))
469
+ if (!file.open (_log_filename, O_RDWR | O_CREAT | O_AT_END ))
470
470
return false ;
471
471
WS_DEBUG_PRINT (" [SD] Created new log file on SD card: " );
472
472
WS_DEBUG_PRINTLN (_log_filename);
@@ -802,7 +802,7 @@ bool ws_sdcard::LogJSONDoc(JsonDocument &doc) {
802
802
// Serialize the JSON document
803
803
#ifndef OFFLINE_MODE_DEBUG
804
804
File32 file;
805
- file = _sd.open (_log_filename, FILE_WRITE );
805
+ file = _sd.open (_log_filename, O_RDWR | O_CREAT | O_AT_END );
806
806
if (!file) {
807
807
WS_DEBUG_PRINTLN (
808
808
" [SD] FATAL Error - Unable to open the log file for writing!" );
Original file line number Diff line number Diff line change @@ -69,10 +69,10 @@ void Wippersnapper_Manager::checkAPIVersion(int pinNum) {
69
69
// NOTE: For debugging right now, we are forcing the API version
70
70
readButton = true ;
71
71
if (readButton) { // API version 2 if D12 is high
72
- ws_instance_v2 = new ws_adapter_offline_v2 ();
72
+ ws_instance_v2 = new ws_adapter_wifi_v2 ();
73
73
_api_version = 2 ;
74
74
} else { // API version 1 if D12 is low
75
- ws_instance = new ws_adapter_offline ();
75
+ ws_instance = new ws_adapter_wifi ();
76
76
_api_version = 1 ;
77
77
}
78
78
}
Original file line number Diff line number Diff line change 1
1
#ifndef WIPPERSNAPPER_MANAGER_H
2
2
#define WIPPERSNAPPER_MANAGER_H
3
3
4
- #include " adapters/offline/ws_offline_pico .h"
5
- typedef ws_offline_pico ws_adapter_offline ;
6
- #include " adapters/offline/ws_offline_pico_v2 .h"
7
- typedef ws_offline_pico_v2 ws_adapter_offline_v2 ;
4
+ #include " adapters/wifi/ws_wifi_esp32 .h"
5
+ typedef ws_wifi_esp32 ws_adapter_wifi ;
6
+ #include " adapters/wifi/ws_wifi_esp32_v2 .h"
7
+ typedef ws_wifi_esp32_v2 ws_adapter_wifi_v2 ;
8
8
9
9
/* ***************************************************************************/
10
10
/* !
@@ -27,8 +27,8 @@ class Wippersnapper_Manager {
27
27
void run ();
28
28
29
29
protected:
30
- ws_adapter_offline *ws_instance; // /< Instance of Wippersnapper API v1
31
- ws_adapter_offline_v2 *ws_instance_v2; // /< Instance of Wippersnapper API v2
30
+ ws_adapter_wifi *ws_instance; // /< Instance of Wippersnapper API v1
31
+ ws_adapter_wifi_v2 *ws_instance_v2; // /< Instance of Wippersnapper API v2
32
32
private:
33
33
int _api_version;
34
34
};
You can’t perform that action at this time.
0 commit comments