esp32: get_chip_info_esp32() return correct model number

out_info->model was zeroed by memset

Merges https://github.com/espressif/esp-idf/pull/1760
This commit is contained in:
Mixerito 2018-03-22 12:55:52 +01:00 committed by Angus Gratton
parent 97c6a94a03
commit 9f39411e80

View File

@ -379,9 +379,10 @@ const char* esp_get_idf_version(void)
static void get_chip_info_esp32(esp_chip_info_t* out_info)
{
out_info->model = CHIP_ESP32;
uint32_t reg = REG_READ(EFUSE_BLK0_RDATA3_REG);
memset(out_info, 0, sizeof(*out_info));
out_info->model = CHIP_ESP32;
if ((reg & EFUSE_RD_CHIP_VER_REV1_M) != 0) {
out_info->revision = 1;
}