Skip to content

Commit bf460f8

Browse files
committed
Fix Fat /Fat2 not compiling on esp8266
Add sanity check when doing get state for refresh Fix help for [ESP202] Add SDFAT2 description in configuration.h
1 parent 12df78f commit bf460f8

File tree

9 files changed

+17
-3
lines changed

9 files changed

+17
-3
lines changed

esp3d/configuration.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@
130130
//SD_DEVICE: to access SD Card files directly instead of access by serial using printer Board FW
131131
//ESP_SD_NATIVE 1 //esp32 / esp8266
132132
//ESP_SDIO 2 //esp32 only
133-
//ESP_SDFAT 3 //esp8266 (same as native) / esp32
134-
//#define SD_DEVICE ESP_SD_NATIVE
133+
//ESP_SDFAT 3 //esp8266 / esp32
134+
//ESP_SDFAT2 4 //esp8266 / esp32
135+
//#define SD_DEVICE ESP_SDFAT2
135136

136137
//SDIO mode
137138
#define SD_ONE_BIT_MODE true

esp3d/src/core/espcmd/ESP0.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const char * help[]= {"[ESP] - display this help",
8484
"[ESP201](Pxxx) (Vxxx) (PULLUP=YES RAW=YES ANALOG=NO ANALOG_RANGE=255 CLEARCHANNELS=NO) - read / set pin value",
8585
#endif //DIRECT_PIN_FEATURE
8686
#if defined (SD_DEVICE)
87-
"[ESP202] - display / set SD Card SD card Speed factor (1 2 4 6 8 16 32)",
87+
"[ESP202] SPEED=(factor) - display / set SD Card SD card Speed factor (1 2 4 6 8 16 32)",
8888
#endif //SD_DEVICE
8989
#ifdef SENSOR_DEVICE
9090
"[ESP210](type=NONE/xxx) (interval=xxxx) - display and read/set SENSOR info",

esp3d/src/modules/filesystem/sd/sd_native_esp32.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ uint8_t ESP_SD::getState(bool refresh)
4747
}
4848
if (!refresh) {
4949
return _state; //to avoid refresh=true + busy to reset SD and waste time
50+
} else {
51+
_sizechanged = true;
5052
}
5153
//SD is idle or not detected, let see if still the case
5254

esp3d/src/modules/filesystem/sd/sd_native_esp8266.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ uint8_t ESP_SD::getState(bool refresh)
8787
if (!refresh) {
8888
log_esp3d("SD State cache is %d", _state);
8989
return _state; //to avoid refresh=true + busy to reset SD and waste time
90+
} else {
91+
_sizechanged = true;
9092
}
9193
//SD is idle or not detected, let see if still the case
9294
_state = ESP_SDCARD_NOT_PRESENT;

esp3d/src/modules/filesystem/sd/sd_sdfat2_esp32.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ uint8_t ESP_SD::getState(bool refresh)
9898
}
9999
if (!refresh) {
100100
return _state; //to avoid refresh=true + busy to reset SD and waste time
101+
} else {
102+
_sizechanged = true;
101103
}
102104
//SD is idle or not detected, let see if still the case
103105
_state = ESP_SDCARD_NOT_PRESENT;

esp3d/src/modules/filesystem/sd/sd_sdfat2_esp8266.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ uint8_t ESP_SD::getState(bool refresh)
102102
if (!refresh) {
103103
log_esp3d("SD State cache is %d", _state);
104104
return _state; //to avoid refresh=true + busy to reset SD and waste time
105+
} else {
106+
_sizechanged = true;
105107
}
106108
//SD is idle or not detected, let see if still the case
107109
_state = ESP_SDCARD_NOT_PRESENT;

esp3d/src/modules/filesystem/sd/sd_sdfat_esp32.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ uint8_t ESP_SD::getState(bool refresh)
8585
}
8686
if (!refresh) {
8787
return _state; //to avoid refresh=true + busy to reset SD and waste time
88+
} else {
89+
_sizechanged = true;
8890
}
8991
//SD is idle or not detected, let see if still the case
9092
_state = ESP_SDCARD_NOT_PRESENT;

esp3d/src/modules/filesystem/sd/sd_sdfat_esp8266.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ uint8_t ESP_SD::getState(bool refresh)
8989
if (!refresh) {
9090
log_esp3d("SD State cache is %d", _state);
9191
return _state; //to avoid refresh=true + busy to reset SD and waste time
92+
} else {
93+
_sizechanged = true;
9294
}
9395
//SD is idle or not detected, let see if still the case
9496
_state = ESP_SDCARD_NOT_PRESENT;

platformIO/extra_script.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
if (env["PIOPLATFORM"] == "espressif8266"):
1515
lib_ignore = env.GetProjectOption("lib_ignore")
1616
lib_ignore.append("SD(esp8266)")
17+
lib_ignore.append("SD")
1718
lib_ignore.append("SDFS")
1819
print("Ignore libs:", lib_ignore)
1920
env.GetProjectConfig().set(

0 commit comments

Comments
 (0)