Skip to content

Commit 517e1de

Browse files
committed
Add ESP32P4 to erlang:system_info(esp32_chip_info)
Adds the ESP32P4 chip to the `get_model` function used to retrieve esp32 chip info by `erlang:system_info/1`. Cleans up the macros used to include various esp32 models by ESP-IDF version. Signed-off-by: Winford <winford@object.stream>
1 parent 253f0b4 commit 517e1de

File tree

1 file changed

+7
-0
lines changed
  • src/platforms/esp32/components/avm_sys

1 file changed

+7
-0
lines changed

src/platforms/esp32/components/avm_sys/sys.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ static const char *const esp32_c3_atom = "\x8" "esp32_c3";
9191
static const char *const esp32_c6_atom = "\x8" "esp32_c6";
9292
static const char *const esp32_h2_atom = "\x8" "esp32_h2";
9393
#endif
94+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
95+
static const char *const esp32_p4_atom = "\x8" "esp32_p4";
96+
#endif
9497
#endif
9598
static const char *const emb_flash_atom = "\x9" "emb_flash";
9699
static const char *const bgn_atom = "\x3" "bgn";
@@ -491,6 +494,10 @@ static term get_model(Context *ctx, esp_chip_model_t model)
491494
return globalcontext_make_atom(ctx->global, esp32_c6_atom);
492495
case CHIP_ESP32H2:
493496
return globalcontext_make_atom(ctx->global, esp32_h2_atom);
497+
#endif
498+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
499+
case CHIP_ESP32P4:
500+
return globalcontext_make_atom(ctx->global, esp32_p4_atom);
494501
#endif
495502
default:
496503
return UNDEFINED_ATOM;

0 commit comments

Comments
 (0)