mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
Merge remote-tracking branch 'origin/tech-upgrade' into dev
This commit is contained in:
@@ -12,13 +12,16 @@ SystemStatus::SystemStatus(AsyncWebServer * server, SecurityManager * securityMa
|
||||
}
|
||||
|
||||
void SystemStatus::systemStatus(AsyncWebServerRequest * request) {
|
||||
emsesp::EMSESP::system_.refreshHeapMem(); // refresh free heap and max alloc heap
|
||||
|
||||
AsyncJsonResponse * response = new AsyncJsonResponse(false, MAX_ESP_STATUS_SIZE);
|
||||
JsonObject root = response->getRoot();
|
||||
|
||||
root["emsesp_version"] = EMSESP_APP_VERSION;
|
||||
root["esp_platform"] = EMSESP_PLATFORM;
|
||||
root["cpu_freq_mhz"] = ESP.getCpuFreqMHz();
|
||||
root["max_alloc_heap"] = ESP.getMaxAllocHeap() / 1024;
|
||||
root["free_heap"] = ESP.getFreeHeap() / 1024;
|
||||
root["max_alloc_heap"] = emsesp::EMSESP::system_.getMaxAllocMem();
|
||||
root["free_heap"] = emsesp::EMSESP::system_.getHeapMem();
|
||||
root["sdk_version"] = ESP.getSdkVersion();
|
||||
root["flash_chip_size"] = ESP.getFlashChipSize() / 1024;
|
||||
root["flash_chip_speed"] = ESP.getFlashChipSpeed();
|
||||
@@ -28,6 +31,7 @@ void SystemStatus::systemStatus(AsyncWebServerRequest * request) {
|
||||
root["fs_used"] = FSused;
|
||||
root["fs_free"] = emsesp::EMSESP::system_.FStotal() - FSused;
|
||||
root["uptime"] = uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3);
|
||||
|
||||
if (emsesp::EMSESP::system_.PSram()) {
|
||||
root["psram_size"] = emsesp::EMSESP::system_.PSram();
|
||||
root["free_psram"] = ESP.getFreePsram() / 1024;
|
||||
@@ -41,7 +45,7 @@ void SystemStatus::systemStatus(AsyncWebServerRequest * request) {
|
||||
uint64_t buffer;
|
||||
esp_partition_read(partition, 0, &buffer, 8);
|
||||
const esp_partition_t * running = esp_ota_get_running_partition();
|
||||
root["has_loader"] = (buffer != 0xFFFFFFFFFFFFFFFF && running->size != partition->size);
|
||||
root["has_loader"] = (buffer != 0xFFFFFFFFFFFFFFFF && running->size != partition->size);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user