1010#include < ArduinoOcpp/Core/Configuration.h>
1111
1212#if defined(ESP32) && !defined(AO_DEACTIVATE_FLASH)
13- #include " SPIFFS.h"
13+ #include < LITTLEFS.h>
14+ #define USE_FS LITTLEFS
15+ #else
16+ #include < FS.h>
17+ #define USE_FS SPIFFS
1418#endif
1519
1620#define SINGLE_CONNECTOR_ID 1
@@ -284,9 +288,9 @@ bool SmartChargingService::writeProfileToFlash(JsonObject *json, ChargingProfile
284288 profileFN += chargingProfile->getStackLevel ();
285289 profileFN += PROFILE_FN_SUFFIX ;
286290
287- SPIFFS .remove (profileFN);
291+ USE_FS .remove (profileFN);
288292
289- File file = SPIFFS .open (profileFN, " w" );
293+ File file = USE_FS .open (profileFN, " w" );
290294
291295 if (!file) {
292296 Serial.print (F (" [SmartChargingService] Unable to save: could not save profile: " ));
@@ -308,7 +312,7 @@ bool SmartChargingService::writeProfileToFlash(JsonObject *json, ChargingProfile
308312
309313 // BEGIN DEBUG
310314 if (DEBUG_OUT ) {
311- file = SPIFFS .open (profileFN, " r" );
315+ file = USE_FS .open (profileFN, " r" );
312316
313317 Serial.println (file.readStringUntil (' \n ' ));
314318
@@ -351,7 +355,7 @@ bool SmartChargingService::loadProfiles() {
351355 profileFN += iLevel;
352356 profileFN += PROFILE_FN_SUFFIX ;
353357
354- File file = SPIFFS .open (profileFN, " r" );
358+ File file = USE_FS .open (profileFN, " r" );
355359
356360 if (file) {
357361 if (DEBUG_OUT ) Serial.print (F (" [SmartChargingService] Load profile from file: " ));
0 commit comments