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.

CC2564MODAEM: Questions on BTPS_AddFunctionToScheduler

Part Number: CC2564MODAEM

Hello,

I am using DK TM4C129X and CC2564MODAEM. I have few questions regarding to BTPS_AddFunctionToScheduler. - (I have already read the information provided in BTSKRNL.pdf )

1-If I add a function to scheduler with some Schedule Period, will it call this function at exactly that time with high precision ? If I add a function with 5ms as period, does it execute that function exactly at every 5ms or some tolerance will be there?

2- I noticed that when I add a function with 15ms as period or above, it will execute at that specified interval. But if I add function with below 15ms ( ex- 10ms, 5ms), it will anyway execute once 15ms. Why am I facing this issue ? (The function which I added, had just one variable which increments whenever it is called.)

3- Does all the functions which I add to the BTPS_AddFunctionToScheduler execute simultaneously if I give same time period? For example, if I add two function with 10ms period, will those two functions execute simultaneously as both have the same time period ?

4- Consider this scenario ( my use case )-

if(BTPS_AddFunctionToScheduler(function_1, NULL, 10))
{
         if(BTPS_AddFunctionToScheduler(function_2, NULL, 10))
         {
                  if(BTPS_AddFunctionToScheduler(function_3, NULL, 10))
                   {
                            if(BTPS_AddFunctionToScheduler(function_4, NULL, 30))
                            {
                                         if(BTPS_AddFunctionToScheduler(function_5, NULL, 500))
                                         {
                                                     if(BTPS_AddFunctionToScheduler(function_6 NULL, 10))
                                                     {

                                                                while(1)
                                                                           BTPS_ExecuteScheduler();
                                                       }
                                         }
                           }
                   }
          }
}

How does the above function execute ? My understanding is-  function_1 executes at time t1. It take 10ms to execute. Simultaneously, function_2 executes at  same time t1. It also takes 10ms to execute. Same with function_3 and function_6. These functions are again called at time t1+10ms, t1+20ms and so on... All the functions are executed simultaneously because all are called at 10ms.

4-a - Will all those functions be executing parallelly or one after another?

4-b - And will the system be not doing anything  during those time interval ? ( Because I call the functions only at 10ms. If function finishes executing within 5ms, will the system not do anything for next 5ms ?)

4-c- What will happen if a particular function takes more than 10ms to execute ? Will that execution be halted in midway and start from beginning or will it continue finishing that function execution and starts execution from beginning right away?

4-d- Can you please explain the flow of execution for the above code? ( Meaning, when these functions are executed and at what time? )

Sorry for the big question, but this is really important for my application. It will help me a lot to develop my application, if all my questions are answered.

Regards,

Adhitya

EDIT- 

I have no idea why this got posted in Bluetooth low energy forum. I had chosen Dual Mode Bluetooth Forum.