diff --git a/src/M5Unified.cpp b/src/M5Unified.cpp index 2150c61..879eec9 100644 --- a/src/M5Unified.cpp +++ b/src/M5Unified.cpp @@ -12,6 +12,10 @@ #include #include +#if defined (CONFIG_IDF_TARGET_ESP32P4) +#include +#endif + #if !defined (CONFIG_IDF_TARGET) || defined (CONFIG_IDF_TARGET_ESP32) #if __has_include () #include @@ -1743,7 +1747,13 @@ static constexpr const uint8_t _pin_table_mbus[][31] = { else if(m5gfx::gpio_in(GPIO_NUM_0)) // M5UnitPoEP4 G0 always High board = board_t::board_M5UnitPoEP4; else - board = board_t::board_M5StampP4; + { + esp_chip_info_t chip_info; + esp_chip_info(&chip_info); + board = chip_info.revision >= 300 + ? board_t::board_M5StampP4X + : board_t::board_M5StampP4; + } } #endif