This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC2541DK-MINI:我需要脉冲捕获使用计时器事件-源代码:SimpleBLEPeripheral 或 BLE_Bridge

Guru**** 2553450 points
Other Parts Discussed in Thread: CC2541, CC2541DK-MINI

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/574509/cc2541dk-mini-i-want-pulse-capture-use-timer-event---sorce-code-simplebleperipheral-or-ble_bridge

器件型号:CC2541DK-MINI
主题中讨论的其他器件:CC2541

我是 CC2541和  BLE 堆栈的初学者

我需要使用计时器事件进行脉冲捕获

脉冲时间:100us ~ 500ms

脉冲输入引脚:P0_0

基本来源: SimpleBLEPeripheral 或 BLE_Bridge

我在下面成功了-->没有使用 ble stack

- CC2541 GPIO 控制(输入/输出)

-定时器事件控制(定时器1、3、4)-(例如)定时器1事件发生-> LED 闪烁)

GPIO 输入改变事件

UART 通信

---- 使用 ble stack -源代码: SimpleBLEPeripheral 或 BLE_Bridge-------------------

- CC2541DK-Mini 与 Android 应用之间的蓝牙通信成功  

----------------------------------------------------

问题

我维修 CC2541DK-Mini 电路板以接收数字脉冲

我希望使用 BLE Stack 源(SimpleBLEPeripheral 或 BLE_Bridge)进行脉冲捕获

- CC2541捕获脉冲-> 蓝牙-> 向移动应用发送脉冲时间

--移动应用程序命令->蓝牙-> CC2541

BLE 堆栈代码在 osal_run_system()处永久运行;

for (;;)// Forever Loop
{ osal_run_system(); }

但是"osal_run_system()"函数经常停止全局中断

例如  

HAL_enter_critical_section (intState); // EA=0;
事件= taskEvents [idx];
tasksEvents [idx]= 0;//清除此任务的事件。
HAL_EXIT_CRITICAL_SECTION (intState);   // EA=1;

我认为计时器(1、3、4)在全局中断停止时停止

我应该怎么做?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    它不会经常停止全局中断。 仅当 OSAL 任务队列中有任何项目时才会执行。 您确定这会影响您的脉冲计数吗?