From 316975fc607e39b39f5354122542946effead817 Mon Sep 17 00:00:00 2001 From: jczhang777 <101778393+jczhang777@users.noreply.github.com> Date: Sat, 25 Jun 2022 01:34:12 +0800 Subject: [PATCH] =?UTF-8?q?[BL602]=201.Enable=20async=20log=20output,=202.?= =?UTF-8?q?Adjuct=20DeviceInfoProvider=20init=20b=E2=80=A6=20(#19955)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [BL602] 1.Enable async log output, 2.Adjuct DeviceInfoProvider init before device manager init * Restyled by clang-format * Restyled by gn Co-authored-by: Restyled.io --- examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp | 4 ++-- examples/lighting-app/bouffalolab/bl602/src/main.cpp | 4 +++- third_party/bouffalolab/bl602_sdk/bl602_sdk.gni | 3 ++- third_party/bouffalolab/bl602_sdk/repo | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp b/examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp index 83a10251270356..db3e23741d7ced 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 @@ -42,6 +41,7 @@ #include #include +#include #include #include @@ -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..679812bb274fc5 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,7 +88,8 @@ extern "C" int main() log_info("------------------------Starting App Task---------------------------\r\n"); CHIPDeviceManager & deviceMgr = CHIPDeviceManager::GetInstance(); - CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks); + SetDeviceInfoProvider(&DeviceInfoProviderImpl::GetDefaultInstance()); + CHIP_ERROR error = deviceMgr.Init(&EchoCallbacks); if (error != CHIP_NO_ERROR) { log_info("device init failed: %s", ErrorStr(error)); diff --git a/third_party/bouffalolab/bl602_sdk/bl602_sdk.gni b/third_party/bouffalolab/bl602_sdk/bl602_sdk.gni index 92fbcffb7befba..510d4d21e18684 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", @@ -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", 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