Skip to content

Commit 1300727

Browse files
wy-hhpull[bot]
authored andcommitted
[Bouffalolab] Refact BL602 & BL702 platform code (#27186)
* refact platform code * use common ConnectivityManagerImpl.cpp * fix compile error after merged * update readme * fix overflow issue * add common PlatformManagerImpl.cpp * fix restyle
1 parent c270516 commit 1300727

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+571
-4327
lines changed

examples/lighting-app/bouffalolab/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ ota-provider-app build and usage.
305305
- BLE commission BL602/BL702 lighting if not commissioned.
306306
- Start OTA software upgrade process
307307
```shell
308-
./chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 <node_id_to_lighting_app> 0
308+
./chip-tool otasoftwareupdaterequestor announce-otaprovider 1 0 0 0 <node_id_to_lighting_app> 0
309309
```
310310
where `<node_id_to_lighting_app>` is node id of BL602/BL702 lighting app.
311311
- After OTA software upgrade gets done, BL602/BL702 will get reboot

examples/lighting-app/bouffalolab/bl702/args.gni

+5
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ lwip_platform = "bl702"
3030

3131
chip_enable_ota_requestor = true
3232
chip_detail_logging = false
33+
34+
pw_build_LINK_DEPS = [
35+
"$dir_pw_assert:impl",
36+
"$dir_pw_log:impl",
37+
]

examples/lighting-app/bouffalolab/common/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
#endif
4141

4242
#if CHIP_ENABLE_OPENTHREAD
43-
#include <ThreadStackManagerImpl.h>
4443
#include <platform/OpenThread/OpenThreadUtils.h>
4544
#include <platform/ThreadStackManager.h>
45+
#include <platform/bouffalolab/common/ThreadStackManagerImpl.h>
4646
#include <utils_list.h>
4747
#endif
4848

examples/platform/bouffalolab/common/plat/OTAConfig.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "OTAConfig.h"
2020
#include <app/server/Server.h>
2121

22+
#include <platform/bouffalolab/common/OTAImageProcessorImpl.h>
2223
// Global OTA objects
2324
chip::DefaultOTARequestor gRequestorCore;
2425
chip::DefaultOTARequestorStorage gRequestorStorage;

examples/platform/bouffalolab/common/plat/OTAConfig.h

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
2323
#include <app/clusters/ota-requestor/DefaultOTARequestorDriver.h>
2424
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
25-
#include <platform/bouffalolab/BL702/OTAImageProcessorImpl.h>
2625

2726
class OTAConfig
2827
{

examples/platform/bouffalolab/common/plat/platform.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@
3030
#include <app/clusters/network-commissioning/network-commissioning.h>
3131
#include <route_hook/bl_route_hook.h>
3232
#endif
33-
#include <PlatformManagerImpl.h>
33+
#include <platform/bouffalolab/common/PlatformManagerImpl.h>
3434

3535
#if HEAP_MONITORING
3636
#include <MemMonitoring.h>
3737
#include <lib/support/CHIPMem.h>
3838
#endif
3939

4040
#if CHIP_ENABLE_OPENTHREAD
41-
#include <ThreadStackManagerImpl.h>
4241
#include <platform/OpenThread/OpenThreadUtils.h>
4342
#include <platform/ThreadStackManager.h>
43+
#include <platform/bouffalolab/common/ThreadStackManagerImpl.h>
4444
#include <utils_list.h>
4545
#endif
4646

src/platform/BUILD.gn

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {
229229
} else if (chip_device_platform == "bl602") {
230230
defines += [
231231
"CHIP_DEVICE_LAYER_TARGET_BL602=1",
232-
"CHIP_DEVICE_LAYER_TARGET=bouffalolab/BL602",
232+
"CHIP_DEVICE_LAYER_TARGET=bouffalolab/common",
233233
"CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}",
234234
]
235235
} else if (chip_device_platform == "bl702") {
236236
defines += [
237237
"CHIP_DEVICE_LAYER_TARGET_BL702=1",
238-
"CHIP_DEVICE_LAYER_TARGET=bouffalolab/BL702",
238+
"CHIP_DEVICE_LAYER_TARGET=bouffalolab/common",
239239
"CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}",
240240
]
241241
} else if (chip_device_platform == "fake") {

0 commit comments

Comments
 (0)