From e55e9d848525e7e76885676ca0cbbfe239977f28 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 21 Aug 2022 14:21:17 +0200 Subject: [PATCH] Change flashmode from digit to text --- tasmota/tasmota_support/support_command.ino | 4 ++-- tasmota/tasmota_support/support_esp.ino | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota_support/support_command.ino b/tasmota/tasmota_support/support_command.ino index 6e5d4bf05..22ebd743a 100644 --- a/tasmota/tasmota_support/support_command.ino +++ b/tasmota/tasmota_support/support_command.ino @@ -770,14 +770,14 @@ void CmndStatus(void) #endif // ESP32 D_JSON_PROGRAMFLASHSIZE "\":%d,\"" D_JSON_FLASHSIZE "\":%d" ",\"" D_JSON_FLASHCHIPID "\":\"%06X\"" - ",\"FlashFrequency\":%d,\"" D_JSON_FLASHMODE "\":%d"), + ",\"FlashFrequency\":%d,\"" D_JSON_FLASHMODE "\":\"%s\""), ESP_getSketchSize()/1024, ESP_getFreeSketchSpace()/1024, ESP_getFreeHeap1024(), #ifdef ESP32 uxTaskGetStackHighWaterMark(nullptr) / 1024, ESP.getPsramSize()/1024, ESP.getFreePsram()/1024, #endif // ESP32 ESP.getFlashChipSize()/1024, ESP_getFlashChipRealSize()/1024 , ESP_getFlashChipId() - , ESP.getFlashChipSpeed()/1000000, ESP.getFlashChipMode()); + , ESP.getFlashChipSpeed()/1000000, ESP_getFlashChipMode().c_str()); ResponseAppendFeatures(); XsnsDriverState(); ResponseAppend_P(PSTR(",\"Sensors\":")); diff --git a/tasmota/tasmota_support/support_esp.ino b/tasmota/tasmota_support/support_esp.ino index 780f35bcb..069f68ea2 100644 --- a/tasmota/tasmota_support/support_esp.ino +++ b/tasmota/tasmota_support/support_esp.ino @@ -558,6 +558,7 @@ int32_t ESP_getHeapFragmentation(void) { uint32_t ESP_getFlashChipId(void) { +// uint32_t id = bootloader_read_flash_id(); uint32_t id = g_rom_flashchip.device_id; id = ((id & 0xff) << 16) | ((id >> 16) & 0xff) | (id & 0xff00); return id; @@ -967,6 +968,14 @@ float ESP_getFreeHeap1024(void) { } */ +const char kFlashModes[] PROGMEM = "QIO|QOUT|DIO|DOUT"; + +String ESP_getFlashChipMode(void) { + uint32_t flash_mode = ESP.getFlashChipMode() &3; + char stemp[6]; + return GetTextIndexed(stemp, sizeof(stemp), flash_mode, kFlashModes); +} + /*********************************************************************************************\ * High entropy hardware random generator * Thanks to DigitalAlchemist