From 8dc0c86457d913de9147054638a2b449b6398d1b Mon Sep 17 00:00:00 2001 From: Testato Date: Sun, 8 Oct 2017 13:48:50 +0200 Subject: [PATCH] Chip revision fix (#704) * Chip revision fix https://www.esp32.com/viewtopic.php?f=2&t=1358&sid=f77cd62ec254317f3bbb30d8ab75ca2a&start=10 * using of esp_chip_info instead of register reading --- cores/esp32/Esp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cores/esp32/Esp.cpp b/cores/esp32/Esp.cpp index b11c7f53..c60abfbb 100644 --- a/cores/esp32/Esp.cpp +++ b/cores/esp32/Esp.cpp @@ -119,7 +119,9 @@ uint32_t EspClass::getFreeHeap(void) uint8_t EspClass::getChipRevision(void) { - return (REG_READ(EFUSE_BLK0_RDATA3_REG) >> EFUSE_RD_CHIP_VER_RESERVE_S) && EFUSE_RD_CHIP_VER_RESERVE_V; + esp_chip_info_t chip_info; + esp_chip_info(&chip_info); + return chip_info.revision; } const char * EspClass::getSdkVersion(void)