Skip to content

Commit

Permalink
[Bouffalolab] Load BLE TX power configuration from flash (#29276)
Browse files Browse the repository at this point in the history
* load ble tx power from flash configuration

* change config name

* fix compile error

* fix restyle
  • Loading branch information
wy-hh authored and pull[bot] committed Feb 14, 2024
1 parent d478fc4 commit 5886450
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 2 additions & 0 deletions third_party/bouffalolab/bl602/bl_iot_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ template("bl_iot_sdk") {
}

source_set("${sdk_target_name}_hosal") {
defines = [ "CFG_BLE_ENABLE" ]
sources = [
"${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/bl_adc.c",
"${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/bl_boot2.c",
Expand Down Expand Up @@ -282,6 +283,7 @@ template("bl_iot_sdk") {
":${sdk_target_name}_config_fs",
":${sdk_target_name}_config_utils",
":${sdk_target_name}_config_freertos",
":${sdk_target_name}_config_ble",
]
public_configs = [
":${sdk_target_name}_config",
Expand Down
14 changes: 13 additions & 1 deletion third_party/bouffalolab/bl702/bl_iot_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ template("bl_iot_sdk") {
"DISABLE_PRINT=1",
]

if (defined(invoker.chip_config_network_layer_ble) &&
invoker.chip_config_network_layer_ble) {
defines += [ "CFG_BLE_ENABLE" ]
}

sources = [
"${bl_iot_sdk_root}/components/platform/hosal/bl702_hal/bl_adc.c",
"${bl_iot_sdk_root}/components/platform/hosal/bl702_hal/bl_boot2.c",
Expand Down Expand Up @@ -331,6 +336,12 @@ template("bl_iot_sdk") {
":${sdk_target_name}_config_utils",
":${sdk_target_name}_config_freertos",
]

if (defined(invoker.chip_config_network_layer_ble) &&
invoker.chip_config_network_layer_ble) {
configs += [ ":${sdk_target_name}_config_ble" ]
}

public_configs = [
":${sdk_target_name}_config",
":${sdk_target_name}_config_hosal",
Expand Down Expand Up @@ -752,6 +763,8 @@ template("bl_iot_sdk") {
include_dirs = [
"${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_ethernet/Inc",
]

cflags_cc = [ "-Wno-conversion" ]
}

source_set("${sdk_target_name}_ethernet") {
Expand Down Expand Up @@ -813,7 +826,6 @@ template("bl_iot_sdk") {
public_configs = [
":${sdk_target_name}_config",
":${sdk_target_name}_config_wifi",
":${sdk_target_name}_config_lwip",
]

cflags = [
Expand Down
17 changes: 16 additions & 1 deletion third_party/bouffalolab/bl702l/bl_iot_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ template("bl_iot_sdk") {
}

source_set("${sdk_target_name}_hosal") {
if (defined(invoker.chip_config_network_layer_ble) &&
invoker.chip_config_network_layer_ble) {
defines = [ "CFG_BLE_ENABLE" ]
}

sources = [
"${bl_iot_sdk_root}/components/platform/hosal/bl702l_hal/bl_adc.c",
"${bl_iot_sdk_root}/components/platform/hosal/bl702l_hal/bl_boot2.c",
Expand Down Expand Up @@ -258,6 +263,11 @@ template("bl_iot_sdk") {
":${sdk_target_name}_config_fs",
":${sdk_target_name}_config_utils",
]
if (defined(invoker.chip_config_network_layer_ble) &&
invoker.chip_config_network_layer_ble) {
configs += [ ":${sdk_target_name}_config_ble" ]
}

public_configs = [
":${sdk_target_name}_config",
":${sdk_target_name}_config_hosal",
Expand Down Expand Up @@ -688,7 +698,6 @@ template("bl_iot_sdk") {
group(sdk_target_name) {
public_deps = [
":${sdk_target_name}_bl702l_rom_a0",
":${sdk_target_name}_ble",
":${sdk_target_name}_fs",
":${sdk_target_name}_hosal",
":${sdk_target_name}_libc",
Expand All @@ -699,6 +708,12 @@ template("bl_iot_sdk") {
":${sdk_target_name}_utils",
]
public_configs = [ ":${sdk_target_name}_config_BSP_Driver" ]

if (defined(invoker.chip_config_network_layer_ble) &&
invoker.chip_config_network_layer_ble) {
public_deps += [ ":${sdk_target_name}_ble" ]
}

if (defined(invoker.chip_enable_openthread) &&
invoker.chip_enable_openthread) {
public_deps += [ ":${sdk_target_name}_openthread_port" ]
Expand Down

0 comments on commit 5886450

Please sign in to comment.