From 29070f1136e3f269da03df8b4799659533b256bd Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 30 May 2020 14:59:52 +0200 Subject: [PATCH] Add ``CpuFrequency`` and ``FlashFrequency`` to status 0 - Add ``CpuFrequency`` to ``status 2`` - Add ``FlashFrequency`` to ``status 4`` --- RELEASENOTES.md | 3 +++ tasmota/CHANGELOG.md | 2 ++ tasmota/support_command.ino | 16 ++++++++-------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7fb0366a3..bf2983136 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -68,3 +68,6 @@ The following binary downloads have been compiled with ESP8266/Arduino library c - Add support for VEML6075 UVA/UVB/UVINDEX Sensor by device111 (#8432) - Add support for VEML7700 Ambient light intensity Sensor by device111 (#8432) - Add Three Phase Export Active Energy to SDM630 driver +- Add Zigbee options to ``ZbSend`` to write and report attributes +- Add ``CpuFrequency`` to ``status 2`` +- Add ``FlashFrequency`` to ``status 4`` diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index 9fb3490fc..8e48a6302 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -12,6 +12,8 @@ - Add wildcard pattern ``?`` for JSON matching in rules - Add support for unique MQTTClient (and inherited fallback topic) by full Mac address using ``mqttclient DVES_%12X`` (#8300) - Add Zigbee options to ``ZbSend`` to write and report attributes +- Add ``CpuFrequency`` to ``status 2`` +- Add ``FlashFrequency`` to ``status 4`` ### 8.3.1.1 20200518 diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index 6c44391a9..f143a9316 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -41,7 +41,7 @@ const char kTasmotaCommands[] PROGMEM = "|" // No prefix D_CMND_SENSOR "|" D_CMND_DRIVER #ifdef ESP32 "|" D_CMND_TOUCH_CAL "|" D_CMND_TOUCH_THRES "|" D_CMND_TOUCH_NUM -#endif //ESP32 +#endif //ESP32 ; void (* const TasmotaCommand[])(void) PROGMEM = { @@ -65,10 +65,10 @@ void (* const TasmotaCommand[])(void) PROGMEM = { #endif // USE_DEVICE_GROUPS_SEND &CmndDevGroupShare, &CmndDevGroupStatus, #endif // USE_DEVICE_GROUPS - &CmndSensor, &CmndDriver + &CmndSensor, &CmndDriver #ifdef ESP32 ,&CmndTouchCal, &CmndTouchThres, &CmndTouchNum -#endif //ESP32 +#endif //ESP32 }; const char kWifiConfig[] PROGMEM = @@ -444,14 +444,14 @@ void CmndStatus(void) ",\"" D_JSON_BOOTVERSION "\":%d" #endif ",\"" D_JSON_COREVERSION "\":\"" ARDUINO_CORE_RELEASE "\",\"" D_JSON_SDKVERSION "\":\"%s\"," - "\"Hardware\":\"%s\"" + "\"CpuFrequency\":%d,\"Hardware\":\"%s\"" "%s}}"), my_version, my_image, GetBuildDateAndTime().c_str() #ifdef ESP8266 , ESP.getBootVersion() #endif , ESP.getSdkVersion(), - GetDeviceHardware().c_str(), + ESP.getCpuFreqMHz(), GetDeviceHardware().c_str(), GetStatistics().c_str()); MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS "2")); } @@ -476,7 +476,7 @@ void CmndStatus(void) #ifdef ESP8266 ",\"" D_JSON_FLASHCHIPID "\":\"%06X\"" #endif - ",\"" D_JSON_FLASHMODE "\":%d,\"" + ",\"FlashFrequency\":%d,\"" D_JSON_FLASHMODE "\":%d,\"" D_JSON_FEATURES "\":[\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\",\"%08X\"]"), ESP_getSketchSize()/1024, ESP.getFreeSketchSpace()/1024, ESP_getFreeHeap()/1024, #ifdef ESP32 @@ -486,7 +486,7 @@ void CmndStatus(void) #ifdef ESP8266 , ESP.getFlashChipId() #endif - , ESP.getFlashChipMode(), + , ESP.getFlashChipSpeed()/1000000, ESP.getFlashChipMode(), LANGUAGE_LCID, feature_drv1, feature_drv2, feature_sns1, feature_sns2, feature5, feature6); XsnsDriverState(); ResponseAppend_P(PSTR(",\"Sensors\":")); @@ -1980,7 +1980,7 @@ void CmndTouchThres(void) } void CmndTouchNum(void) -{ +{ if (XdrvMailbox.payload >= 0) { if (XdrvMailbox.payload<32){ TOUCH_BUTTON.hit_threshold = XdrvMailbox.payload;