fix broken imports under ESP32

use ESP32 rather than ESP_PLATFORM - it's ambigious
standardise to ifdef ESP32 elif defined(ESP8266)
use ifdef over if defined where possible
This commit is contained in:
Rick Watson
2019-12-24 11:19:19 +00:00
parent 368bfef29b
commit 62f3d3fc7a
21 changed files with 140 additions and 143 deletions

View File

@ -10,10 +10,10 @@ SystemStatus::SystemStatus(AsyncWebServer* server, SecurityManager* securityMana
void SystemStatus::systemStatus(AsyncWebServerRequest* request) {
AsyncJsonResponse* response = new AsyncJsonResponse(false, MAX_ESP_STATUS_SIZE);
JsonObject root = response->getRoot();
#if defined(ESP8266)
root["esp_platform"] = "esp8266";
#elif defined(ESP_PLATFORM)
#ifdef ESP32
root["esp_platform"] = "esp32";
#elif defined(ESP8266)
root["esp_platform"] = "esp8266";
#endif
root["cpu_freq_mhz"] = ESP.getCpuFreqMHz();
root["free_heap"] = ESP.getFreeHeap();