apply PR comments

This commit is contained in:
Raomin
2020-05-25 01:41:45 +02:00
parent 681b9f67cf
commit 6510a72789
2 changed files with 8 additions and 16 deletions

View File

@ -1,6 +1,5 @@
#include <SystemStatus.h>
#ifdef ESP32
#include <esp_spiffs.h>
#include <SPIFFS.h>
#elif defined(ESP8266)
#include <FS.h>
@ -30,15 +29,8 @@ void SystemStatus::systemStatus(AsyncWebServerRequest* request) {
root["sdk_version"] = ESP.getSdkVersion();
root["flash_chip_size"] = ESP.getFlashChipSize();
root["flash_chip_speed"] = ESP.getFlashChipSpeed();
#ifdef ESP32
if (esp_spiffs_mounted(NULL)) {
root["spiffs_used"] = SPIFFS.usedBytes();
root["spiffs_size"] = SPIFFS.totalBytes();
}
#elif !defined(PROGMEM_WWW) //couldn't find an esp8266 alternative to esp_spiffs_mounted()
root["spiffs_used"] = SPIFFS.usedBytes();
root["spiffs_size"] = SPIFFS.totalBytes();
#endif
root["spiffs_used"] = SPIFFS.usedBytes();
root["spiffs_size"] = SPIFFS.totalBytes();
response->setLength();
request->send(response);
}