mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 03:06:33 +00:00
Refactor ESP32 revision
This commit is contained in:
parent
0d2b603bc4
commit
ffaa9efbde
@ -590,14 +590,14 @@ void CmndStatus(void)
|
||||
",\"" D_JSON_BOOTVERSION "\":%d"
|
||||
#endif
|
||||
",\"" D_JSON_COREVERSION "\":\"" ARDUINO_CORE_RELEASE "\",\"" D_JSON_SDKVERSION "\":\"%s\","
|
||||
"\"CpuFrequency\":%d,\"Hardware\":\"%s%s\""
|
||||
"\"CpuFrequency\":%d,\"Hardware\":\"%s\""
|
||||
"%s}}"),
|
||||
TasmotaGlobal.version, TasmotaGlobal.image_name, GetBuildDateAndTime().c_str()
|
||||
#ifdef ESP8266
|
||||
, ESP.getBootVersion()
|
||||
#endif
|
||||
, ESP.getSdkVersion(),
|
||||
ESP.getCpuFreqMHz(), GetDeviceHardware().c_str(), GetDeviceHardwareRevision().c_str(),
|
||||
ESP.getCpuFreqMHz(), GetDeviceHardwareRevision().c_str(),
|
||||
GetStatistics().c_str());
|
||||
CmndStatusResponse(2);
|
||||
}
|
||||
|
@ -96,7 +96,8 @@ String GetDeviceHardware(void) {
|
||||
}
|
||||
|
||||
String GetDeviceHardwareRevision(void) {
|
||||
return "";
|
||||
// No known revisions for ESP8266/85
|
||||
return GetDeviceHardware();
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -773,14 +774,21 @@ typedef struct {
|
||||
}
|
||||
|
||||
String GetDeviceHardwareRevision(void) {
|
||||
// ESP32-S2
|
||||
// ESP32-D0WDQ6 rev.1
|
||||
// ESP32-C3 rev.2
|
||||
// ESP32-C3 rev.3
|
||||
String result = GetDeviceHardware(); // ESP32-C3
|
||||
|
||||
esp_chip_info_t chip_info;
|
||||
esp_chip_info(&chip_info);
|
||||
|
||||
char revision[10] = { 0 };
|
||||
if (chip_info.revision) {
|
||||
snprintf_P(revision, sizeof(revision), PSTR(" rev.%d"), chip_info.revision);
|
||||
}
|
||||
return revision;
|
||||
result += revision; // ESP32-C3 rev.3
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2420,7 +2420,7 @@ void HandleInformation(void)
|
||||
#endif // USE_DISCOVERY
|
||||
|
||||
WSContentSend_P(PSTR("}1}2 ")); // Empty line
|
||||
WSContentSend_P(PSTR("}1" D_ESP_CHIP_ID "}2%d (%s%s)"), ESP_getChipId(), GetDeviceHardware().c_str(), GetDeviceHardwareRevision().c_str());
|
||||
WSContentSend_P(PSTR("}1" D_ESP_CHIP_ID "}2%d (%s)"), ESP_getChipId(), GetDeviceHardwareRevision().c_str());
|
||||
#ifdef ESP8266
|
||||
WSContentSend_P(PSTR("}1" D_FLASH_CHIP_ID "}20x%06X"), ESP.getFlashChipId());
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user