From ff2d06031dcfcf88ea912f289e992bd8e70b2715 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Mon, 31 Oct 2022 16:11:50 +0800 Subject: [PATCH] example: Update idf branch for esp32h2 to the latest release/v5.0 --- README.md | 2 +- .../esp32c3_devkit_m/esp_matter_device.cmake | 3 +-- .../esp32h2_devkit_c/esp_matter_device.cmake | 3 +-- .../esp32s3_devkit_c/esp_matter_device.cmake | 3 +-- device_hal/led_driver/idf_component.yml | 2 ++ device_hal/led_driver/ws2812/led_driver.c | 19 ------------------- docs/en/developing.rst | 2 +- examples/zigbee_bridge/main/app_zboss.cpp | 9 --------- 8 files changed, 7 insertions(+), 36 deletions(-) create mode 100644 device_hal/led_driver/idf_component.yml diff --git a/README.md b/README.md index 84aa7b947..c7f7c1e62 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ git clone --recursive https://github.com/espressif/esp-matter.git - This SDK currently works with [commit 4f7669b0](https://github.com/espressif/connectedhomeip/tree/4f7669b0) in v1.0 branch of connectedhomeip. - For Wi-Fi devices (ESP32, ESP32-C3, ESP32-S3), ESP-IDF [v4.4.2 release](https://github.com/espressif/esp-idf/releases/tag/v4.4.2) is required. -- For Thread devices (ESP32-H2) and Zigbee Bridge example, ESP-IDF release/v5.0 branch at [commit ccdeb43](https://github.com/espressif/esp-idf/tree/ccdeb43) should be used. +- For Thread devices (ESP32-H2) and Zigbee Bridge example, ESP-IDF release/v5.0 branch at [commit 20949d44](https://github.com/espressif/esp-idf/tree/20949d44) should be used. ## Documentation diff --git a/device_hal/device/esp32c3_devkit_m/esp_matter_device.cmake b/device_hal/device/esp32c3_devkit_m/esp_matter_device.cmake index c18540baa..f898bdc41 100644 --- a/device_hal/device/esp32c3_devkit_m/esp_matter_device.cmake +++ b/device_hal/device/esp32c3_devkit_m/esp_matter_device.cmake @@ -8,5 +8,4 @@ SET(led_type ws2812) SET(button_type iot) SET(extra_components_dirs_append "$ENV{ESP_MATTER_DEVICE_PATH}/../../led_driver" - "$ENV{ESP_MATTER_DEVICE_PATH}/../../button_driver/iot_button" - "$ENV{IDF_PATH}/examples/common_components/led_strip") + "$ENV{ESP_MATTER_DEVICE_PATH}/../../button_driver/iot_button") diff --git a/device_hal/device/esp32h2_devkit_c/esp_matter_device.cmake b/device_hal/device/esp32h2_devkit_c/esp_matter_device.cmake index b7c753832..b546d3dad 100644 --- a/device_hal/device/esp32h2_devkit_c/esp_matter_device.cmake +++ b/device_hal/device/esp32h2_devkit_c/esp_matter_device.cmake @@ -8,5 +8,4 @@ SET(led_type ws2812) SET(button_type hollow_button) SET(extra_components_dirs_append "$ENV{ESP_MATTER_DEVICE_PATH}/../../led_driver" - "$ENV{ESP_MATTER_DEVICE_PATH}/../../button_driver/button" - "$ENV{IDF_PATH}/examples/common_components/led_strip") + "$ENV{ESP_MATTER_DEVICE_PATH}/../../button_driver/button") diff --git a/device_hal/device/esp32s3_devkit_c/esp_matter_device.cmake b/device_hal/device/esp32s3_devkit_c/esp_matter_device.cmake index e6e2368d3..d45d48c08 100644 --- a/device_hal/device/esp32s3_devkit_c/esp_matter_device.cmake +++ b/device_hal/device/esp32s3_devkit_c/esp_matter_device.cmake @@ -8,5 +8,4 @@ SET(led_type ws2812) SET(button_type iot) SET(extra_components_dirs_append "$ENV{ESP_MATTER_DEVICE_PATH}/../../led_driver" - "$ENV{ESP_MATTER_DEVICE_PATH}/../../button_driver/iot_button" - "$ENV{IDF_PATH}/examples/common_components/led_strip") + "$ENV{ESP_MATTER_DEVICE_PATH}/../../button_driver/iot_button") diff --git a/device_hal/led_driver/idf_component.yml b/device_hal/led_driver/idf_component.yml new file mode 100644 index 000000000..e637b8e02 --- /dev/null +++ b/device_hal/led_driver/idf_component.yml @@ -0,0 +1,2 @@ +dependencies: + espressif/led_strip: "^1.0.0" diff --git a/device_hal/led_driver/ws2812/led_driver.c b/device_hal/led_driver/ws2812/led_driver.c index 5ff3f6a7f..cdcb72030 100644 --- a/device_hal/led_driver/ws2812/led_driver.c +++ b/device_hal/led_driver/ws2812/led_driver.c @@ -28,7 +28,6 @@ led_driver_handle_t led_driver_init(led_driver_config_t *config) { ESP_LOGI(TAG, "Initializing light driver"); esp_err_t err = ESP_OK; -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) rmt_config_t rmt_cfg = RMT_DEFAULT_CONFIG_TX(config->gpio, config->channel); rmt_cfg.clk_div = 2; err = rmt_config(&rmt_cfg); @@ -44,18 +43,6 @@ led_driver_handle_t led_driver_init(led_driver_config_t *config) led_strip_config_t strip_config = LED_STRIP_DEFAULT_CONFIG(1, (led_strip_dev_t)rmt_cfg.channel); led_strip_t *strip = led_strip_new_rmt_ws2812(&strip_config); -#else - led_strip_config_t strip_config = { - .strip_gpio_num = config->gpio, - .max_leds = 1, - }; - led_strip_handle_t strip; - err = led_strip_new_rmt_device(&strip_config, &strip); - if (err != ESP_OK) { - ESP_LOGE(TAG, "led_strip initializing failed"); - return NULL; - } -#endif if (!strip) { ESP_LOGE(TAG, "W2812 driver install failed"); return NULL; @@ -76,7 +63,6 @@ esp_err_t led_driver_set_RGB(led_driver_handle_t handle) ESP_LOGE(TAG, "led driver handle cannot be NULL"); err = ESP_FAIL; } else { -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) led_strip_t *strip = (led_strip_t *)handle; err = strip->set_pixel(strip, 0, mRGB.red, mRGB.green, mRGB.blue); if (err != ESP_OK) { @@ -85,11 +71,6 @@ esp_err_t led_driver_set_RGB(led_driver_handle_t handle) } ESP_LOGI(TAG, "led set r:%d, g:%d, b:%d", mRGB.red, mRGB.green, mRGB.blue); err = strip->refresh(strip, 100); -#else - led_strip_handle_t strip = (led_strip_handle_t)handle; - err = led_strip_set_pixel(strip, 0, mRGB.red, mRGB.green, mRGB.blue); - err |= led_strip_refresh(strip); -#endif if (err != ESP_OK) { ESP_LOGE(TAG, "strip_refresh failed"); } diff --git a/docs/en/developing.rst b/docs/en/developing.rst index 6c95cb298..477647136 100644 --- a/docs/en/developing.rst +++ b/docs/en/developing.rst @@ -41,7 +41,7 @@ The Prerequisites for ESP-IDF and Matter: :: git clone --recursive https://github.com/espressif/esp-idf.git - cd esp-idf; git checkout ccdeb43cc7; git submodule update --init --recursive; + cd esp-idf; git checkout 20949d444f; git submodule update --init --recursive; ./install.sh cd .. diff --git a/examples/zigbee_bridge/main/app_zboss.cpp b/examples/zigbee_bridge/main/app_zboss.cpp index 4816b45cf..ed8be0f7d 100644 --- a/examples/zigbee_bridge/main/app_zboss.cpp +++ b/examples/zigbee_bridge/main/app_zboss.cpp @@ -39,7 +39,6 @@ void zboss_signal_handler(zb_bufid_t bufid) zb_ret_t status = ZB_GET_APP_SIGNAL_STATUS(bufid); zb_zdo_signal_device_annce_params_t *device_annce_params = NULL; zb_zdo_signal_macsplit_dev_boot_params_t *rcp_version = NULL; - zb_uint32_t gateway_version; switch (sig) { case ZB_ZDO_SIGNAL_SKIP_STARTUP: @@ -49,17 +48,9 @@ void zboss_signal_handler(zb_bufid_t bufid) case ZB_MACSPLIT_DEVICE_BOOT: ESP_LOGI(TAG, "Zigbee rcp device booted"); - gateway_version = esp_zb_macsplit_get_version(); rcp_version = ZB_ZDO_SIGNAL_GET_PARAMS(p_sg_p, zb_zdo_signal_macsplit_dev_boot_params_t); ESP_LOGI(TAG, "Zigbee rcp device version: %d.%d.%d", (rcp_version->dev_version >> 24 & 0x000000FF), (rcp_version->dev_version >> 16 & 0x000000FF), (rcp_version->dev_version & 0x000000FF)); - ESP_LOGI(TAG, "Zigbee gateway version: %d.%d.%d", (gateway_version >> 24 & 0x000000FF), - (gateway_version >> 16 & 0x000000FF), (gateway_version & 0x000000FF)); - if (gateway_version != rcp_version->dev_version) { - ESP_LOGE(TAG, - "rcp has different Zigbee stack version with Zigbee gateway! Please check the rcp software or " - "other issues"); - } break; case ZB_BDB_SIGNAL_DEVICE_FIRST_START: