Fix ESP32H2 errors after refactor

This commit is contained in:
WanqQixiang
2022-01-11 14:29:28 +08:00
parent 735d8af3c5
commit 83dbaf5795
15 changed files with 17 additions and 23 deletions
+4
View File
@@ -35,6 +35,10 @@ set(INCLUDE_DIRS_LIST "."
set(REQUIRES_LIST chip bt)
if ("${IDF_TARGET}" STREQUAL "esp32h2")
list(APPEND REQUIRES_LIST openthread app_openthread)
endif()
idf_component_register( SRC_DIRS ${SRC_DIRS_LIST}
INCLUDE_DIRS ${INCLUDE_DIRS_LIST}
REQUIRES ${REQUIRES_LIST})
@@ -15,11 +15,15 @@
#include <esp_log.h>
#include <esp_matter_core.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <platform/CHIPDeviceLayer.h>
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
#include <app_openthread.h>
#endif
using chip::Credentials::SetDeviceAttestationCredentialsProvider;
using chip::Credentials::Examples::GetExampleDACProvider;
@@ -211,6 +215,7 @@ esp_err_t esp_matter_chip_init(esp_matter_event_callback_t callback)
}
PlatformMgr().AddEventHandler(callback, static_cast<intptr_t>(NULL));
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
app_openthread_launch_task();
if (ThreadStackMgr().InitThreadStack() != CHIP_NO_ERROR) {
ESP_LOGE(TAG, "Failed to initialize Thread stack");
return ESP_FAIL;
@@ -10,5 +10,4 @@ SET(button_type hollow)
SET(used_driver light_driver button_driver)
SET(extra_components_dirs_append "${device_hal_path}/light_driver"
"${device_hal_path}/button_driver"
"$ENV{IDF_PATH}/examples/common_components/led_strip"
"$ENV{IDF_PATH}/examples/peripherals/rmt/led_strip/components")
"$ENV{IDF_PATH}/examples/common_components/led_strip")
+1 -1
View File
@@ -30,7 +30,7 @@ include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake)
set(EXTRA_COMPONENT_DIRS
"../common"
"${IDF_PATH}/examples/common_components"
"${IDF_PATH}/examples/common_components/qrcode"
"${MATTER_SDK_PATH}/config/esp32/components"
"${ESP_MATTER_PATH}/components"
"${ESP_MATTER_PATH}/device_hal/device"
+1 -1
View File
@@ -1,4 +1,4 @@
set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode app_openthread app_update)
set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode app_update)
idf_component_register(SRC_DIRS "."
PRIV_INCLUDE_DIRS "."
+1 -8
View File
@@ -14,9 +14,6 @@
#include <esp_matter_console.h>
#include <esp_route_hook.h>
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
#include <app_openthread.h>
#endif
#include <app_driver.h>
#include <app_ota.h>
#include <app_qrcode.h>
@@ -72,13 +69,9 @@ extern "C" void app_main()
/* Initialize driver */
app_driver_init();
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
/* Initialize OpenThread */
app_openthread_launch_task();
#endif
/* Matter start */
err = esp_matter_start(app_event_cb);
if (err != ESP_OK) {
ESP_LOGE(TAG, "Matter start failed: %d", err);
}
@@ -54,6 +54,7 @@ CONFIG_USE_MINIMAL_MDNS=n
# Increase stacks size
CONFIG_NIMBLE_CONTROLLER_TASK_STACK_SIZE=5120
CONFIG_NIMBLE_HOST_TASK_STACK_SIZE=5120
CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096
# ESP32H2 BLE using a ext 32k crystal
CONFIG_ESP32H2_RTC_CLK_SRC_EXT_CRYS=y
+1 -1
View File
@@ -30,7 +30,7 @@ include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake)
set(EXTRA_COMPONENT_DIRS
"../common"
"${IDF_PATH}/examples/common_components"
"${IDF_PATH}/examples/common_components/qrcode"
"${MATTER_SDK_PATH}/config/esp32/components"
"${ESP_MATTER_PATH}/components"
"${ESP_MATTER_PATH}/device_hal/device"
+1 -1
View File
@@ -1,4 +1,4 @@
set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode app_openthread)
set(PRIV_REQUIRES_LIST device esp_matter esp_matter_console route_hook app_qrcode)
idf_component_register(SRC_DIRS "."
PRIV_INCLUDE_DIRS "."
-9
View File
@@ -13,10 +13,6 @@
#include <esp_matter.h>
#include <esp_matter_console.h>
#include <esp_route_hook.h>
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
#include <app_openthread.h>
#endif
#include <app_driver.h>
#include <app_qrcode.h>
@@ -61,11 +57,6 @@ extern "C" void app_main()
/* Initialize driver */
app_driver_init();
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
/* Initialize OpenThread */
app_openthread_launch_task();
#endif
/* Matter start */
err = esp_matter_start(app_event_cb);
if (err != ESP_OK) {
@@ -21,6 +21,7 @@ CONFIG_NEWTOS_ENABLE=n
CONFIG_BLE_50_FEATURE_SUPPORT=y
CONFIG_BLE_HCI_UART_BAUD=921600
CONFIG_BLE_EXT_ADV=n
CONFIG_BLE_LOG_LEVEL=1
# Enable OpenThread
CONFIG_OPENTHREAD_ENABLED=y