Skip to content

Commit da5abb7

Browse files
authored
Only define CHIP_ constants for C6 and simulator if ESP_IDF_VERSION >= 5.1
Avoids breaking compatibility with ESP-IDF 5.0
1 parent 1a02da1 commit da5abb7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/mrb_esp32_system.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,13 @@ mrb_mruby_esp32_system_gem_init(mrb_state* mrb) {
9595
define_const(CHIP_ESP32S2);
9696
define_const(CHIP_ESP32S3);
9797
define_const(CHIP_ESP32C3);
98-
define_const(CHIP_ESP32C2);
99-
define_const(CHIP_ESP32C6);
10098
define_const(CHIP_ESP32H2);
99+
define_const(CHIP_ESP32C2);
100+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 1, 0)
101+
define_const(CHIP_ESP32C6);
102+
define_const(CHIP_POSIX_LINUX);
103+
#endif
101104
// define_const(CHIP_ESP32P4);
102-
define_const(CHIP_POSIX_LINUX);
103105
}
104106

105107
void

0 commit comments

Comments
 (0)