From 6f6bed0002ba0a2454a555db3950593fbad36af6 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Mon, 4 Nov 2024 19:20:25 +0800 Subject: [PATCH] =?utf8?q?=E8=B0=83=E6=95=B4bt=E5=88=9D=E5=A7=8B=E5=8C=96i?= =?utf8?q?rq=E9=94=81=E4=BD=8D=E7=BD=AE=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?utf8?q?=E8=93=9D=E7=89=99=E5=88=9D=E5=A7=8B=E5=8C=96=E5=A4=B1=E8=B4=A5b?= =?utf8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../fd230app/nativeui/bluetooth/src/BluetoothModel.cpp | 3 --- code/sdk/drivers/peripheral/utils/custom_utils.c | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) 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; } -- 2.17.1