21 #include "../../include/esp3d_config.h"
24 #include "../../core/genLinkedList.h"
27 #define ESP_MAX_SD_OPENHANDLE 4
28 #if ((SD_DEVICE == ESP_SD_NATIVE) || (SD_DEVICE == ESP_SDFAT)) && defined (ARDUINO_ARCH_ESP8266)
33 #elif (SD_DEVICE == ESP_SDFAT) && defined (ARDUINO_ARCH_ESP32)
41 bool ESP_SD::_started =
false;
43 uint8_t ESP_SD::_spi_speed_divider = 1;
44 bool ESP_SD::_sizechanged =
true;
72 res = String ((uint16_t)bytes) +
" B";
73 }
else if (bytes < (1024 * 1024) ) {
74 res = String ((
float)(bytes / 1024.0),2) +
" KB";
75 }
else if (bytes < (1024 * 1024 * 1024) ) {
76 res = String ((
float)(bytes / 1024.0 / 1024.0),2) +
" MB";
78 res = String ((
float)(bytes / 1024.0 / 1024.0 / 1024.0),2) +
" GB";
100 ESP_SDFile::operator bool()
const
102 if ((_index != -1) || (_filename.length() > 0)) {
112 return !(_index == -1);
117 return _name.c_str();
122 return _filename.c_str();
142 if (_index == -1 || _isdir) {
150 if ((_index == -1) || _isdir) {
158 if ((_index == -1) || _isdir) {
166 if ((_index == -1) || _isdir) {
174 if ((_index == -1) || _isdir) {
182 if ((_index == -1) || _isdir) {
191 _isdir = other._isdir;
192 _index = other._index;
193 _filename = other._filename;
196 _iswritemode = other._iswritemode;
197 _dirlist = other._dirlist;
198 _lastwrite = other._lastwrite;
204 if (speeddivider > 0) {
205 _spi_speed_divider = speeddivider;