Hi guys,
I need a delay function (such as in the CC2530) for CC2540. Does anybody know?
Thanks
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.
Could you describe in more detail what you mean by "delay function"? You can use an OSAL timer to set a delayed process to occur at some time in the future.
The only thing to be aware of is that BLE stack operation is highly dependent on accurate timing, and therefore the lower layers of the stack will have the highest priority in processing events. Therefore if your application has critical timing requirements, it cannot be guaranteed while in a connection, as the stack's timing will take precedence.
Hi Willis,
Thanks for your answer. by delay function I mead something like "halMcuWaitUs()" in the CC2530. Is there anything like that in the CC2540?
by OSAL timer, do you mean "osal_start_timerEx( )"? I've changed " osal_start_system()" in the OSAL.c file in the "HostTestApp" project as follows:
void osal_start_system( void )
{
#if !defined ( ZBIT ) && !defined ( UBIT )
for(;;) // Forever Loop
#endif
{
osal_run_system();
ble_conn();
}
}
in which ble_conn() is a function which can perform connection between USB master and a Keyfob slave. Everything seems work fine and I am able to connect and disconnect to slave periodically (every 1s delay by a for loop). the packet sniffer shows all are right. Now:
You mentioned " BLE stack operation is highly dependent on accurate timing". So, in the above codes, if I want to change the connection periods to for example 300ms, I need a delay function. would you please tell me how I can use "osal_start_timerEx( )" for that?
Thanks!