diff --git a/Grbl_Esp32/data/index.html.gz b/Grbl_Esp32/data/index.html.gz index a61156c1..387d5e38 100644 Binary files a/Grbl_Esp32/data/index.html.gz and b/Grbl_Esp32/data/index.html.gz differ diff --git a/Grbl_Esp32/espresponse.cpp b/Grbl_Esp32/espresponse.cpp index ce6456d4..827c7452 100644 --- a/Grbl_Esp32/espresponse.cpp +++ b/Grbl_Esp32/espresponse.cpp @@ -47,16 +47,16 @@ void ESPResponseStream::println(const char *data){ } //helper to format size to readable string -String ESPResponseStream::formatBytes (uint32_t bytes) +String ESPResponseStream::formatBytes (uint64_t bytes) { - if (bytes < 1024) { - return String (bytes) + " B"; + if (bytes < 1024) { + return String ((uint16_t)bytes) + " B"; } else if (bytes < (1024 * 1024) ) { - return String (bytes / 1024.0) + " KB"; + return String ((float)(bytes / 1024.0),2) + " KB"; } else if (bytes < (1024 * 1024 * 1024) ) { - return String (bytes / 1024.0 / 1024.0) + " MB"; + return String ((float)(bytes / 1024.0 / 1024.0),2) + " MB"; } else { - return String (bytes / 1024.0 / 1024.0 / 1024.0) + " GB"; + return String ((float)(bytes / 1024.0 / 1024.0 / 1024.0),2) + " GB"; } } diff --git a/Grbl_Esp32/espresponse.h b/Grbl_Esp32/espresponse.h index 381151ed..f7906446 100644 --- a/Grbl_Esp32/espresponse.h +++ b/Grbl_Esp32/espresponse.h @@ -31,7 +31,7 @@ class ESPResponseStream{ void print(const char *data); void println(const char *data); void flush(); - static String formatBytes (uint32_t bytes); + static String formatBytes (uint64_t bytes); uint8_t client() {return _client;} #if defined (ENABLE_HTTP) && defined(ENABLE_WIFI) ESPResponseStream(WebServer * webserver); diff --git a/Grbl_Esp32/web_server.cpp b/Grbl_Esp32/web_server.cpp index aa1764d3..1e09d9b3 100644 --- a/Grbl_Esp32/web_server.cpp +++ b/Grbl_Esp32/web_server.cpp @@ -1228,8 +1228,8 @@ void Web_Server::handle_direct_SDFileList() _upload_status = UPLOAD_STATUS_NONE; } bool list_files = true; - uint32_t totalspace = 0; - uint32_t usedspace = 0; + uint64_t totalspace = 0; + uint64_t usedspace = 0; if (get_sd_state(true) != SDCARD_IDLE) { _webserver->sendHeader("Cache-Control","no-cache"); _webserver->send(200, "application/json", "{\"status\":\"No SD Card\"}");