I am using single alarm to activate multiple task of same period.
Example: one 100ms alarm is use to set three events which will activate three 100ms periodic task.
I want to have specific gap between the task activation how can it be achieved?
Example: Event is set at the same time from alarm. But every time 100ms1 should activate immediately 100ms2 after 1ms and 100ms3 after 2ms , so that task activation will have 1 ms gap.
Can it be done?
You could simply do it in a control task (might be just one of the 3 other tasks) processing the alarm event and signal activation to each of the other tasks with e.g. a 1 ms delay in between.
Do you want to wake 3 tasks in response to one event and you want to ensure sequencing? In other others, you want to wake up 3 tasks, namely T1, T2 and T3, in response to an event and you want to ensure that first T1 runs, then T1 and then T3. If that is the case, you need to set tasks priroties such that:
Prio(T1) > Prio( T2) > Prio( T3)
All of those can then be woken at once and they will run in order.
Or your use case is that you want to wake up T1 first, then after 1 ms wake up T2 and then after 1 ms wake up T3? If so, you would need to signal T2 and T3 separately. One way is to use another 1ms timer or use a control task as @hs2 mentioned.
Thank you very much for your prompt reply,