From e38c541d9acb22852975a6f46ae11b4723a34580 Mon Sep 17 00:00:00 2001 From: jczhang Date: Fri, 24 Jun 2022 22:57:05 +0800 Subject: [PATCH 1/3] [BL602] 1.Enable async log output, 2.Adjuct DeviceInfoProvider init before device manager init --- examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp | 4 ++-- examples/lighting-app/bouffalolab/bl602/src/main.cpp | 2 ++ third_party/bouffalolab/bl602_sdk/bl602_sdk.gni | 3 ++- third_party/bouffalolab/bl602_sdk/repo | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp b/examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp index 83a10251270356..d3a7e1f7dc364a 100644 --- a/examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp +++ b/examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp @@ -21,7 +21,6 @@ #include "CHIPDeviceManager.h" #include "DeviceCallbacks.h" #include "LEDWidget.h" -#include #include #include #include @@ -44,6 +43,7 @@ #include #include +#include #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 @@ -139,7 +139,6 @@ CHIP_ERROR AppTask::Init() gImageProcessor.SetOTADownloader(&gDownloader); gDownloader.SetImageProcessorDelegate(&gImageProcessor); gRequestorUser.Init(&gRequestorCore, &gImageProcessor); - SetDeviceInfoProvider(&DeviceInfoProviderImpl::GetDefaultInstance()); ConfigurationMgr().LogDeviceConfig(); @@ -154,6 +153,7 @@ void AppTask::AppTaskMain(void * pvParameter) CHIP_ERROR err; log_info("App Task entered\r\n"); + enable_async_log(); err = sWiFiNetworkCommissioningInstance.Init(); if (CHIP_NO_ERROR != err) diff --git a/examples/lighting-app/bouffalolab/bl602/src/main.cpp b/examples/lighting-app/bouffalolab/bl602/src/main.cpp index eaa1e35821f298..90170218baadba 100644 --- a/examples/lighting-app/bouffalolab/bl602/src/main.cpp +++ b/examples/lighting-app/bouffalolab/bl602/src/main.cpp @@ -18,6 +18,7 @@ #include "AppTask.h" #include "CHIPDeviceManager.h" #include "DeviceCallbacks.h" +#include #include #include #include @@ -87,6 +88,7 @@ extern "C" int main() log_info("------------------------Starting App Task---------------------------\r\n"); CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); + SetDeviceInfoProvider(&DeviceInfoProviderImpl::GetDefaultInstance()); CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks); if (error != CHIP_NO_ERROR) { diff --git a/third_party/bouffalolab/bl602_sdk/bl602_sdk.gni b/third_party/bouffalolab/bl602_sdk/bl602_sdk.gni index 92fbcffb7befba..76fcb19889683f 100644 --- a/third_party/bouffalolab/bl602_sdk/bl602_sdk.gni +++ b/third_party/bouffalolab/bl602_sdk/bl602_sdk.gni @@ -133,6 +133,7 @@ template("bl602_sdk") { "${bl602_sdk_root}/components/utils/include/", "${bl602_sdk_root}/components/platform/soc/bl602/bl602_std/bl602_std/StdDriver/Inc/", "${bl602_sdk_root}/components/platform/hosal/bl602_hal/", + "${bl602_sdk_root}/components/utils/async_log/" ] # if (bl602_board == "BL-HWC-G1") { @@ -155,7 +156,6 @@ template("bl602_sdk") { "SYS_BLOG_ENABLE=1", "SYS_VFS_ENABLE=1", - "SYS_VFS_UART_ENABLE=1", "SYS_AOS_LOOP_ENABLE=1", "BL602=BL602", "SYS_LOOPRT_ENABLE=1", @@ -549,6 +549,7 @@ template("bl602_sdk") { "${bl602_sdk_root}/components/utils/src/utils_psk_fast.c", "${bl602_sdk_root}/components/utils/src/utils_rbtree.c", "${bl602_sdk_root}/components/utils/src/utils_tlv_bl.c", + "${bl602_sdk_root}/components/utils/async_log/async_log.c", ] # } else if (bl_family == "bl706") { diff --git a/third_party/bouffalolab/bl602_sdk/repo b/third_party/bouffalolab/bl602_sdk/repo index de9c79bc72de94..1066e3c13f2800 160000 --- a/third_party/bouffalolab/bl602_sdk/repo +++ b/third_party/bouffalolab/bl602_sdk/repo @@ -1 +1 @@ -Subproject commit de9c79bc72de94c3237af4987d907c1478bcef23 +Subproject commit 1066e3c13f2800a8dad932bccc19b17becf5c25b From 758fcb5a4a3c82ef20171c58009cfbfee695686b Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 24 Jun 2022 15:06:11 +0000 Subject: [PATCH 2/3] Restyled by clang-format --- examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp | 2 +- examples/lighting-app/bouffalolab/bl602/src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp b/examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp index d3a7e1f7dc364a..db3e23741d7ced 100644 --- a/examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp +++ b/examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp @@ -41,9 +41,9 @@ #include #include +#include #include #include -#include #define FACTORY_RESET_TRIGGER_TIMEOUT 3000 #define FACTORY_RESET_CANCEL_WINDOW_TIMEOUT 3000 diff --git a/examples/lighting-app/bouffalolab/bl602/src/main.cpp b/examples/lighting-app/bouffalolab/bl602/src/main.cpp index 90170218baadba..679812bb274fc5 100644 --- a/examples/lighting-app/bouffalolab/bl602/src/main.cpp +++ b/examples/lighting-app/bouffalolab/bl602/src/main.cpp @@ -89,7 +89,7 @@ extern "C" int main() CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); SetDeviceInfoProvider(&DeviceInfoProviderImpl::GetDefaultInstance()); - CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks); + CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks); if (error != CHIP_NO_ERROR) { log_info("device init failed: %s", ErrorStr(error)); From 507c24edf0516f24711bdb4207e78c24e3f5095f Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 24 Jun 2022 15:06:13 +0000 Subject: [PATCH 3/3] Restyled by gn --- third_party/bouffalolab/bl602_sdk/bl602_sdk.gni | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/bouffalolab/bl602_sdk/bl602_sdk.gni b/third_party/bouffalolab/bl602_sdk/bl602_sdk.gni index 76fcb19889683f..510d4d21e18684 100644 --- a/third_party/bouffalolab/bl602_sdk/bl602_sdk.gni +++ b/third_party/bouffalolab/bl602_sdk/bl602_sdk.gni @@ -133,7 +133,7 @@ template("bl602_sdk") { "${bl602_sdk_root}/components/utils/include/", "${bl602_sdk_root}/components/platform/soc/bl602/bl602_std/bl602_std/StdDriver/Inc/", "${bl602_sdk_root}/components/platform/hosal/bl602_hal/", - "${bl602_sdk_root}/components/utils/async_log/" + "${bl602_sdk_root}/components/utils/async_log/", ] # if (bl602_board == "BL-HWC-G1") { @@ -540,6 +540,7 @@ template("bl602_sdk") { "${bl602_sdk_root}/components/sys/bloop/looprt/src/looprt.c", "${bl602_sdk_root}/components/sys/bloop/loopset/src/loopset_led.c", "${bl602_sdk_root}/components/sys/bltime/bl_sys_time.c", + "${bl602_sdk_root}/components/utils/async_log/async_log.c", "${bl602_sdk_root}/components/utils/src/utils_crc.c", "${bl602_sdk_root}/components/utils/src/utils_dns.c", "${bl602_sdk_root}/components/utils/src/utils_hmac_sha1_fast.c", @@ -549,7 +550,6 @@ template("bl602_sdk") { "${bl602_sdk_root}/components/utils/src/utils_psk_fast.c", "${bl602_sdk_root}/components/utils/src/utils_rbtree.c", "${bl602_sdk_root}/components/utils/src/utils_tlv_bl.c", - "${bl602_sdk_root}/components/utils/async_log/async_log.c", ] # } else if (bl_family == "bl706") {