Skip to content

Commit

Permalink
[Sysinfo] Fix some code/logic duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
TD-er committed Aug 22, 2022
1 parent 9bcb5b4 commit dfe7a53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/src/Helpers/StringProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ String getValue(LabelType::Enum label) {
case LabelType::ESP_CHIP_REVISION: return String(getChipRevision());
case LabelType::ESP_CHIP_CORES: return String(getChipCores());
case LabelType::ESP_BOARD_NAME: return get_board_name();
case LabelType::FLASH_CHIP_ID: return String(getFlashChipId());
case LabelType::FLASH_CHIP_ID: return formatToHex(getFlashChipId(), 6);
case LabelType::FLASH_CHIP_VENDOR: return formatToHex(getFlashChipId() & 0xFF, 2);
case LabelType::FLASH_CHIP_MODEL:
{
Expand Down
4 changes: 1 addition & 3 deletions src/src/WebServer/SysInfoPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,9 @@ void handle_sysinfo_json() {

json_open(false, F("storage"));

uint32_t flashChipId = getFlashChipId();

// Set to HEX may be something like 0x1640E0.
// Where manufacturer is 0xE0 and device is 0x4016.
json_number(F("chip_id"), String(flashChipId));
json_number(F("chip_id"), getValue(LabelType::FLASH_CHIP_ID));
if (flashChipVendorPuya()) {
if (puyaSupport()) {
json_prop(F("vendor"), F("puya, supported"));
Expand Down

0 comments on commit dfe7a53

Please sign in to comment.