diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd9cc914..5fbd524c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: matrix: lua_ver: ['5.1', '5.3'] numbers: ['default', 'alternate'] - target: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6'] + target: ['esp32', 'esp32s2', 'esp32s3', 'esp32c3', 'esp32c6', 'esp32h2'] runs-on: ubuntu-20.04 diff --git a/components/modules/CMakeLists.txt b/components/modules/CMakeLists.txt index d7e79589..cbb4186e 100644 --- a/components/modules/CMakeLists.txt +++ b/components/modules/CMakeLists.txt @@ -1,4 +1,11 @@ # Modules common to all chips +set(wifi_modules + "espnow.c" + "wifi.c" + "wifi_ap.c" + "wifi_common.c" + "wifi_sta.c" +) set(module_srcs "adc.c" "bit.c" @@ -8,7 +15,6 @@ set(module_srcs "dht.c" "encoder.c" "eromfs.c" - "espnow.c" "file.c" "gpio.c" "heaptrace.c" @@ -38,10 +44,6 @@ set(module_srcs "u8g2.c" "uart.c" "ucg.c" - "wifi.c" - "wifi_ap.c" - "wifi_common.c" - "wifi_sta.c" "ws2812.c" ) @@ -56,17 +58,20 @@ if(IDF_TARGET STREQUAL "esp32") "pulsecnt.c" "sdmmc.c" "touch.c" + ${wifi_modules} ) elseif(IDF_TARGET STREQUAL "esp32s2") list(APPEND module_srcs "dac.c" "pulsecnt.c" + ${wifi_modules} ) elseif(IDF_TARGET STREQUAL "esp32s3") list(APPEND module_srcs "dac.c" "pulsecnt.c" "sdmmc.c" + ${wifi_modules} ) elseif(IDF_TARGET STREQUAL "esp32c3") list(APPEND module_srcs @@ -75,6 +80,10 @@ elseif(IDF_TARGET STREQUAL "esp32c6") list(APPEND module_srcs "dac.c" "pulsecnt.c" + ${wifi_modules} + ) +elseif(IDF_TARGET STREQUAL "esp32h2") + list(APPEND module_srcs ) endif() diff --git a/components/modules/Kconfig b/components/modules/Kconfig index bd38f524..6554efd5 100644 --- a/components/modules/Kconfig +++ b/components/modules/Kconfig @@ -83,6 +83,7 @@ menu "NodeMCU modules" does. config NODEMCU_CMODULE_ESPNOW + depends on !IDF_TARGET_ESP32H2 bool "ESP-NOW module" default "n" help @@ -309,6 +310,7 @@ menu "NodeMCU modules" rsource "../ucg/Kconfig.ucg" config NODEMCU_CMODULE_WIFI + depends on !IDF_TARGET_ESP32H2 bool "WiFi module" default "y" help diff --git a/components/modules/node.c b/components/modules/node.c index 5f849de3..a4635089 100644 --- a/components/modules/node.c +++ b/components/modules/node.c @@ -110,20 +110,20 @@ static int node_bootreason( lua_State *L) #if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32C6) case SDIO_RESET: #endif -#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) +#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32H2) case GLITCH_RTC_RESET: #endif -#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) +#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2) case EFUSE_RESET: #endif #if defined(CONFIG_IDF_TARGET_ESP32C6) case JTAG_RESET: #endif -#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) +#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2) case USB_UART_CHIP_RESET: case USB_JTAG_CHIP_RESET: #endif -#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) +#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32H2) case POWER_GLITCH_RESET: #endif case TG0WDT_SYS_RESET: @@ -271,7 +271,7 @@ static int node_sleep (lua_State *L) esp_sleep_enable_timer_wakeup(usecs); } -#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) +#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) // touch option: boolean if (opt_checkbool(L, "touch", false)) { int err = esp_sleep_enable_touchpad_wakeup(); @@ -344,7 +344,7 @@ static int node_dsleep (lua_State *L) } } -#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) +#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) bool pull = opt_checkbool(L, "pull", false); if (opt_get(L, "isolate", LUA_TTABLE)) { for (int i = 1; ; i++) { diff --git a/components/platform/onewire.c b/components/platform/onewire.c index 12e5e960..36877b10 100644 --- a/components/platform/onewire.c +++ b/components/platform/onewire.c @@ -197,7 +197,7 @@ static int onewire_rmt_attach_pin( uint8_t gpio_num ) return PLATFORM_ERR; if (gpio_num != ow_rmt.gpio) { -#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) +#if !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) // attach GPIO to previous pin if (gpio_num < 32) { GPIO.enable_w1ts = (0x1 << gpio_num);