From: penglei <1624952103@qq.com> Date: Mon, 4 Nov 2024 11:20:25 +0000 (+0800) Subject: 调整bt初始化irq锁位置,修复蓝牙初始化失败bug X-Git-Tag: fd230_release_V1.3.102~29^2~55^2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F1335%2Fhead;p=mirrors%2FFD230.git 调整bt初始化irq锁位置,修复蓝牙初始化失败bug --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp index a07c8b790..2dfbc8e49 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp @@ -210,8 +210,6 @@ void bluetooth_enable_all(void) { //初始化过的则直接开启扫描即可 - //加锁避免bt 初始化失败 - uint32_t irq_sts = osal_irq_lock(); if (bluetooth_init_all() == 1) { @@ -232,7 +230,6 @@ void bluetooth_enable_all(void) /**开始ble广播*/ // custom_ble_service_start(); } - osal_irq_restore(irq_sts); } void bluetooth_close_all(void) diff --git a/code/sdk/drivers/peripheral/utils/custom_utils.c b/code/sdk/drivers/peripheral/utils/custom_utils.c index 2e6039e9c..01c4a7b1f 100644 --- a/code/sdk/drivers/peripheral/utils/custom_utils.c +++ b/code/sdk/drivers/peripheral/utils/custom_utils.c @@ -370,6 +370,8 @@ extern void bluetooth_close_all(void); extern void bluetooth_enable_all(void); bool start_custom_ble_service(void) { + //加锁避免bt 初始化失败 + uint32_t irq_sts = osal_irq_lock(); #ifdef SUPPORT_BLE_SERVICE PRINT("start custom protocol classic bt ble service !\r\n"); bluetooth_enable_all(); @@ -378,7 +380,7 @@ bool start_custom_ble_service(void) { uapi_dev_runtime_set_bt_powerstat(1); } - + osal_irq_restore(irq_sts); return true; }