diff --git a/components/bt/esp_ble_mesh/common/include/mesh/common.h b/components/bt/esp_ble_mesh/common/include/mesh/common.h index 8be5e40d062..19482bd378b 100644 --- a/components/bt/esp_ble_mesh/common/include/mesh/common.h +++ b/components/bt/esp_ble_mesh/common/include/mesh/common.h @@ -13,6 +13,7 @@ #include #include +#include #include "esp_attr.h" #include "esp_heap_caps.h" diff --git a/components/bt/esp_ble_mesh/common/include/mesh/kernel.h b/components/bt/esp_ble_mesh/common/include/mesh/kernel.h index a24772a47d1..74b7c4d23db 100644 --- a/components/bt/esp_ble_mesh/common/include/mesh/kernel.h +++ b/components/bt/esp_ble_mesh/common/include/mesh/kernel.h @@ -1,6 +1,6 @@ /* * SPDX-FileCopyrightText: 2016 Wind River Systems, Inc. - * SPDX-FileContributor: 2020-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileContributor: 2020-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -21,9 +21,15 @@ extern "C" { #endif +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0) +#define BLE_MESH_PLATFORM_CORE_NUMS CONFIG_FREERTOS_NUMBER_OF_CORES +#else +#define BLE_MESH_PLATFORM_CORE_NUMS portNUM_PROCESSORS +#endif + #ifdef CONFIG_BT_BLUEDROID_ENABLED #ifdef CONFIG_BT_BLUEDROID_PINNED_TO_CORE -#define BLE_MESH_ADV_TASK_CORE (CONFIG_BT_BLUEDROID_PINNED_TO_CORE < CONFIG_FREERTOS_NUMBER_OF_CORES ? CONFIG_BT_BLUEDROID_PINNED_TO_CORE : tskNO_AFFINITY) +#define BLE_MESH_ADV_TASK_CORE (CONFIG_BT_BLUEDROID_PINNED_TO_CORE < BLE_MESH_PLATFORM_CORE_NUMS ? CONFIG_BT_BLUEDROID_PINNED_TO_CORE : tskNO_AFFINITY) #else #define BLE_MESH_ADV_TASK_CORE (0) #endif @@ -31,7 +37,7 @@ extern "C" { #ifdef CONFIG_BT_NIMBLE_ENABLED #ifdef CONFIG_BT_NIMBLE_PINNED_TO_CORE -#define BLE_MESH_ADV_TASK_CORE (CONFIG_BT_NIMBLE_PINNED_TO_CORE < CONFIG_FREERTOS_NUMBER_OF_CORES ? CONFIG_BT_NIMBLE_PINNED_TO_CORE : tskNO_AFFINITY) +#define BLE_MESH_ADV_TASK_CORE (CONFIG_BT_NIMBLE_PINNED_TO_CORE < BLE_MESH_PLATFORM_CORE_NUMS ? CONFIG_BT_NIMBLE_PINNED_TO_CORE : tskNO_AFFINITY) #else #define BLE_MESH_ADV_TASK_CORE (0) #endif diff --git a/components/bt/esp_ble_mesh/core/transport.c b/components/bt/esp_ble_mesh/core/transport.c index 204854e241c..8c5319b7170 100644 --- a/components/bt/esp_ble_mesh/core/transport.c +++ b/components/bt/esp_ble_mesh/core/transport.c @@ -2105,9 +2105,9 @@ void bt_mesh_trans_init(void) #if CONFIG_BLE_MESH_LONG_PACKET for (i = 0; i < ARRAY_SIZE(ext_seg_rx); i++) { k_delayed_work_init(&ext_seg_rx[i].ack_timer, seg_ack); - ext_seg_rx[i].buf.size = CONFIG_BLE_MESH_LONG_PACKET_ADV_LEN; + ext_seg_rx[i].buf.size = BLE_MESH_EXT_RX_SDU_MAX; ext_seg_rx[i].buf.__buf = (ext_seg_rx_buf_data + - (i * CONFIG_BLE_MESH_LONG_PACKET_ADV_LEN)); + (i * BLE_MESH_EXT_RX_SDU_MAX)); ext_seg_rx[i].buf.data = ext_seg_rx[i].buf.__buf; } #endif diff --git a/components/bt/esp_ble_mesh/core/transport.enh.c b/components/bt/esp_ble_mesh/core/transport.enh.c index 3147ee86a12..7d81ebcbc59 100644 --- a/components/bt/esp_ble_mesh/core/transport.enh.c +++ b/components/bt/esp_ble_mesh/core/transport.enh.c @@ -2723,9 +2723,9 @@ void bt_mesh_trans_init(void) #if CONFIG_BLE_MESH_LONG_PACKET for (i = 0; i < ARRAY_SIZE(ext_seg_rx); i++) { - ext_seg_rx[i].buf.size = CONFIG_BLE_MESH_LONG_PACKET_ADV_LEN; + ext_seg_rx[i].buf.size = BLE_MESH_EXT_RX_SDU_MAX; ext_seg_rx[i].buf.__buf = (ext_seg_rx_buf_data + - (i * CONFIG_BLE_MESH_LONG_PACKET_ADV_LEN)); + (i * BLE_MESH_EXT_RX_SDU_MAX)); ext_seg_rx[i].buf.data = ext_seg_rx[i].buf.__buf; } #endif diff --git a/components/bt/esp_ble_mesh/v1.1/btc/btc_ble_mesh_dfu_model.c b/components/bt/esp_ble_mesh/v1.1/btc/btc_ble_mesh_dfu_model.c index d60df283f14..b6fe3ecdbd5 100644 --- a/components/bt/esp_ble_mesh/v1.1/btc/btc_ble_mesh_dfu_model.c +++ b/components/bt/esp_ble_mesh/v1.1/btc/btc_ble_mesh_dfu_model.c @@ -185,7 +185,7 @@ static void btc_ble_mesh_dfu_client_free_req_data(btc_msg_t *msg) } if (msg->act >= ESP_BLE_MESH_DFU_CLIENT_EVT_MAX) { - BT_ERR("%s, Invalid event %d", __func, msg->act); + BT_ERR("%s, Invalid event %d", __func__, msg->act); return; }