Skip to content

Commit

Permalink
[BL602] 1.Enable async log output, 2.Adjuct DeviceInfoProvider init b… (
Browse files Browse the repository at this point in the history
#19955)

* [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 <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Feb 10, 2024
1 parent 2faf4ae commit 1184839
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/lighting-app/bouffalolab/bl602/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "CHIPDeviceManager.h"
#include "DeviceCallbacks.h"
#include "LEDWidget.h"
#include <DeviceInfoProviderImpl.h>
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/cluster-id.h>
Expand All @@ -42,6 +41,7 @@
#include <platform/bouffalolab/BL602/OTAImageProcessorImpl.h>
#include <platform/internal/CHIPDeviceLayerInternal.h>

#include <async_log.h>
#include <bl_sys_ota.h>
#include <lib/support/ErrorStr.h>

Expand Down Expand Up @@ -139,7 +139,6 @@ CHIP_ERROR AppTask::Init()
gImageProcessor.SetOTADownloader(&gDownloader);
gDownloader.SetImageProcessorDelegate(&gImageProcessor);
gRequestorUser.Init(&gRequestorCore, &gImageProcessor);
SetDeviceInfoProvider(&DeviceInfoProviderImpl::GetDefaultInstance());

ConfigurationMgr().LogDeviceConfig();

Expand All @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion examples/lighting-app/bouffalolab/bl602/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "AppTask.h"
#include "CHIPDeviceManager.h"
#include "DeviceCallbacks.h"
#include <DeviceInfoProviderImpl.h>
#include <FreeRTOS.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
Expand Down Expand Up @@ -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));
Expand Down
3 changes: 2 additions & 1 deletion third_party/bouffalolab/bl602_sdk/bl602_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 1184839

Please sign in to comment.