Skip to content

Commit

Permalink
[Bouffalolab] Refact BL602 & BL702 platform code (#27186)
Browse files Browse the repository at this point in the history
* refact platform code

* use common ConnectivityManagerImpl.cpp

* fix compile error after merged

* update readme

* fix overflow issue

* add common PlatformManagerImpl.cpp

* fix restyle
  • Loading branch information
wy-hh authored and pull[bot] committed Sep 2, 2023
1 parent 7f042b7 commit 1484828
Show file tree
Hide file tree
Showing 65 changed files with 571 additions and 4,327 deletions.
2 changes: 1 addition & 1 deletion examples/lighting-app/bouffalolab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ ota-provider-app build and usage.
- BLE commission BL602/BL702 lighting if not commissioned.
- Start OTA software upgrade process
```shell
./chip-tool otasoftwareupdaterequestor announce-ota-provider 1 0 0 0 <node_id_to_lighting_app> 0
./chip-tool otasoftwareupdaterequestor announce-otaprovider 1 0 0 0 <node_id_to_lighting_app> 0
```
where `<node_id_to_lighting_app>` is node id of BL602/BL702 lighting app.
- After OTA software upgrade gets done, BL602/BL702 will get reboot
Expand Down
5 changes: 5 additions & 0 deletions examples/lighting-app/bouffalolab/bl702/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ lwip_platform = "bl702"

chip_enable_ota_requestor = true
chip_detail_logging = false

pw_build_LINK_DEPS = [
"$dir_pw_assert:impl",
"$dir_pw_log:impl",
]
2 changes: 1 addition & 1 deletion examples/lighting-app/bouffalolab/common/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
#endif

#if CHIP_ENABLE_OPENTHREAD
#include <ThreadStackManagerImpl.h>
#include <platform/OpenThread/OpenThreadUtils.h>
#include <platform/ThreadStackManager.h>
#include <platform/bouffalolab/common/ThreadStackManagerImpl.h>
#include <utils_list.h>
#endif

Expand Down
1 change: 1 addition & 0 deletions examples/platform/bouffalolab/common/plat/OTAConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "OTAConfig.h"
#include <app/server/Server.h>

#include <platform/bouffalolab/common/OTAImageProcessorImpl.h>
// Global OTA objects
chip::DefaultOTARequestor gRequestorCore;
chip::DefaultOTARequestorStorage gRequestorStorage;
Expand Down
1 change: 0 additions & 1 deletion examples/platform/bouffalolab/common/plat/OTAConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorDriver.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <platform/bouffalolab/BL702/OTAImageProcessorImpl.h>

class OTAConfig
{
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/bouffalolab/common/plat/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <route_hook/bl_route_hook.h>
#endif
#include <PlatformManagerImpl.h>
#include <platform/bouffalolab/common/PlatformManagerImpl.h>

#if HEAP_MONITORING
#include <MemMonitoring.h>
#include <lib/support/CHIPMem.h>
#endif

#if CHIP_ENABLE_OPENTHREAD
#include <ThreadStackManagerImpl.h>
#include <platform/OpenThread/OpenThreadUtils.h>
#include <platform/ThreadStackManager.h>
#include <platform/bouffalolab/common/ThreadStackManagerImpl.h>
#include <utils_list.h>
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {
} else if (chip_device_platform == "bl602") {
defines += [
"CHIP_DEVICE_LAYER_TARGET_BL602=1",
"CHIP_DEVICE_LAYER_TARGET=bouffalolab/BL602",
"CHIP_DEVICE_LAYER_TARGET=bouffalolab/common",
"CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}",
]
} else if (chip_device_platform == "bl702") {
defines += [
"CHIP_DEVICE_LAYER_TARGET_BL702=1",
"CHIP_DEVICE_LAYER_TARGET=bouffalolab/BL702",
"CHIP_DEVICE_LAYER_TARGET=bouffalolab/common",
"CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}",
]
} else if (chip_device_platform == "fake") {
Expand Down
Loading

0 comments on commit 1484828

Please sign in to comment.