Skip to content

Commit 2917f84

Browse files
committed
Update to support latest esp32 core git and 2.0 release
Add base for ESP32-S2 in platformIO but not working yet - ok for arduino Remove littleFS as external lib - now part of 2.0 Add esp32 detection in [ESP420] report
1 parent b14efce commit 2917f84

34 files changed

+82
-9834
lines changed

.github/ci/prepare-libs.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ cp -r ./libraries/TFT_eSPI-1.4.11 $HOME/arduino_ide/libraries/
1414
cp -r ./libraries/lv_arduino-2.0.3 $HOME/arduino_ide/libraries/
1515
cp -r ./libraries/ESP8266-Arduino-Lua-0.0.30 $HOME/arduino_ide/libraries/
1616
cp -r ./libraries/BMx280MI-1.2.0 $HOME/arduino_ide/libraries/
17-
cp -r ./libraries/LITTLEFS-1.0.5 $HOME/arduino_ide/libraries/
1817
#TODO add SDFat libraries according version and target
1918

Notes.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ESP32:
2+
* be sure pyserial is installed: python -m pip install pyserial
3+
4+
Linux:
5+
* add user to dialout group
6+
* check https://docs.platformio.org/en/latest//faq.html#platformio-udev-rules
7+
8+
PlatformIO :
9+
* upload speed may need to be lower to 460800 if head packet error
10+
11+
Arduino :
12+
* upload speed may need to be lower to 460800 if head packet error
13+
14+
15+

esp3d/src/core/espcmd/ESP420.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ bool Commands::ESP420(const char* cmd_params, level_authenticate_type auth_type,
152152
} else {
153153
output->print (": ");
154154
}
155+
#ifdef FILESYSTEM_FEATURE
155156
output->print(ESP_FileSystem::formatBytes (ESP.getFreeHeap()).c_str());
157+
#else
158+
output->print(ESP.getFreeHeap());
159+
#endif//FILESYSTEM_FEATURE
156160

157161
#ifdef ARDUINO_ARCH_ESP32
158162
#ifdef BOARD_HAS_PSRAM
@@ -193,7 +197,11 @@ bool Commands::ESP420(const char* cmd_params, level_authenticate_type auth_type,
193197
} else {
194198
output->print (": ");
195199
}
200+
#ifdef FILESYSTEM_FEATURE
196201
output->print(ESP_FileSystem::formatBytes (ESP.getFlashChipSize()).c_str());
202+
#else
203+
output->print(ESP.getFlashChipSize());
204+
#endif//FILESYSTEM_FEATURE
197205
if (!plain) {
198206
output->print ("\"}");
199207
} else {

esp3d/src/core/settings_esp3d.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,11 +1277,21 @@ String Settings_ESP3D::IPtoString(uint32_t ip_int)
12771277
const char * Settings_ESP3D::TargetBoard()
12781278
{
12791279
#ifdef ARDUINO_ARCH_ESP32
1280+
# if CONFIG_IDF_TARGET_ESP32
1281+
# define TYPE_BOARD "ESP32"
1282+
# elif CONFIG_IDF_TARGET_ESP32S2
1283+
# define TYPE_BOARD "ESP32-S2"
1284+
# elif CONFIG_IDF_TARGET_ESP32S3
1285+
# define TYPE_BOARD "ESP32-S3"
1286+
# elif CONFIG_IDF_TARGET_ESP32C3
1287+
# define TYPE_BOARD "ESP32-C3"
1288+
# endif
12801289
#ifdef BOARD_HAS_PSRAM
1281-
return "ESP32 (PSRAM)";
1290+
#define IS_PSRAM " (PSRAM)"
12821291
#else
1283-
return "ESP32";
1292+
#define IS_PSRAM ""
12841293
#endif //BOARD_HAS_PSRAM
1294+
return TYPE_BOARD IS_PSRAM;
12851295
#endif //ARDUINO_ARCH_ESP32
12861296
#ifdef ARDUINO_ARCH_ESP8266
12871297
return "ESP82XX";

esp3d/src/modules/filesystem/flash/littlefs_esp32_filesystem.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,35 @@ littlefs_esp32_filesystem.cpp - ESP3D littlefs filesystem configuration class
2222
#include "../esp_filesystem.h"
2323
#include "../../../core/genLinkedList.h"
2424
#include <FS.h>
25-
#include <LITTLEFS.h>
25+
#include <LittleFS.h>
2626

2727
extern File tFile_handle[ESP_MAX_OPENHANDLE];
2828

2929
bool ESP_FileSystem::begin()
3030
{
31-
_started = LITTLEFS.begin(true);
31+
_started = LittleFS.begin(true);
3232
return _started;
3333
}
3434

3535
void ESP_FileSystem::end()
3636
{
37-
LITTLEFS.end();
37+
LittleFS.end();
3838
_started = false;
3939
}
4040

4141
size_t ESP_FileSystem::freeBytes()
4242
{
43-
return (LITTLEFS.totalBytes() - LITTLEFS.usedBytes());
43+
return (LittleFS.totalBytes() - LittleFS.usedBytes());
4444
}
4545

4646
size_t ESP_FileSystem::totalBytes()
4747
{
48-
return LITTLEFS.totalBytes();
48+
return LittleFS.totalBytes();
4949
}
5050

5151
size_t ESP_FileSystem::usedBytes()
5252
{
53-
return LITTLEFS.usedBytes();
53+
return LittleFS.usedBytes();
5454
}
5555

5656
uint ESP_FileSystem::maxPathLength()
@@ -60,7 +60,7 @@ uint ESP_FileSystem::maxPathLength()
6060

6161
bool ESP_FileSystem::rename(const char *oldpath, const char *newpath)
6262
{
63-
return LITTLEFS.rename(oldpath,newpath);
63+
return LittleFS.rename(oldpath,newpath);
6464
}
6565

6666
const char * ESP_FileSystem::FilesystemName()
@@ -70,7 +70,7 @@ const char * ESP_FileSystem::FilesystemName()
7070

7171
bool ESP_FileSystem::format()
7272
{
73-
bool res = LITTLEFS.format();
73+
bool res = LittleFS.format();
7474
if (res) {
7575
res = begin();
7676
}
@@ -90,7 +90,7 @@ ESP_File ESP_FileSystem::open(const char* path, uint8_t mode)
9090
log_esp3d("%s is invalid path", path);
9191
return ESP_File();
9292
}
93-
File tmp = LITTLEFS.open(path, (mode == ESP_FILE_READ)?FILE_READ:(mode == ESP_FILE_WRITE)?FILE_WRITE:FILE_APPEND);
93+
File tmp = LittleFS.open(path, (mode == ESP_FILE_READ)?FILE_READ:(mode == ESP_FILE_WRITE)?FILE_WRITE:FILE_APPEND);
9494
if(tmp) {
9595
ESP_File esptmp(&tmp, tmp.isDirectory(),(mode == ESP_FILE_READ)?false:true, path);
9696
log_esp3d("%s is a %s", path,tmp.isDirectory()?"Dir":"File");
@@ -108,7 +108,7 @@ bool ESP_FileSystem::exists(const char* path)
108108
if (strcmp(path, "/") == 0) {
109109
return _started;
110110
}
111-
res = LITTLEFS.exists(path);
111+
res = LittleFS.exists(path);
112112
if (!res) {
113113
ESP_File root = ESP_FileSystem::open(path, ESP_FILE_READ);
114114
if (root) {
@@ -121,7 +121,7 @@ bool ESP_FileSystem::exists(const char* path)
121121

122122
bool ESP_FileSystem::remove(const char *path)
123123
{
124-
return LITTLEFS.remove(path);
124+
return LittleFS.remove(path);
125125
}
126126

127127
bool ESP_FileSystem::mkdir(const char *path)
@@ -135,7 +135,7 @@ bool ESP_FileSystem::mkdir(const char *path)
135135
p.remove(p.length()-1);
136136
}
137137
}
138-
return LITTLEFS.mkdir(p);
138+
return LittleFS.mkdir(p);
139139
}
140140

141141
bool ESP_FileSystem::rmdir(const char *path)
@@ -157,7 +157,7 @@ bool ESP_FileSystem::rmdir(const char *path)
157157
GenLinkedList<String > pathlist;
158158
pathlist.push(p);
159159
while (pathlist.count() > 0) {
160-
File dir = LITTLEFS.open(pathlist.getLast().c_str());
160+
File dir = LittleFS.open(pathlist.getLast().c_str());
161161
File f = dir.openNextFile();
162162
bool candelete = true;
163163
while (f) {
@@ -168,14 +168,14 @@ bool ESP_FileSystem::rmdir(const char *path)
168168
f.close();
169169
f = File();
170170
} else {
171-
LITTLEFS.remove(f.name());
171+
LittleFS.remove(f.name());
172172
f.close();
173173
f = dir.openNextFile();
174174
}
175175
}
176176
if (candelete) {
177177
if (pathlist.getLast() !="/") {
178-
res = LITTLEFS.rmdir(pathlist.getLast().c_str());
178+
res = LittleFS.rmdir(pathlist.getLast().c_str());
179179
}
180180
pathlist.pop();
181181
}
@@ -260,7 +260,7 @@ void ESP_File::close()
260260
//reopen if mode = write
261261
//udate size + date
262262
if (_iswritemode && !_isdir) {
263-
File ftmp = LITTLEFS.open(_filename.c_str());
263+
File ftmp = LittleFS.open(_filename.c_str());
264264
if (ftmp) {
265265
_size = ftmp.size();
266266
_lastwrite = ftmp.getLastWrite();

0 commit comments

Comments
 (0)