Time management FreeRTOS

I have three tasks. static void vTaskAd( void *pvParameters ); //broadcast the ATYPE packets static void vTaskSu( void *pvParameters ); //read the socket and check the SType packets static void vTaskPu( void *pvParameters );   //broadcast the PTYPE packets Let suppose Subscription packets are generated every 10sec.   1. vTaskAd runs continuously until any reception of the     STYPE packet   2. vTaskSu(read the STYPE packets every time)  run      continuously   3. If it found the STYPE packet  then vTaskPu task will      start.   4. vTaskAd will goes to sleep until let suppose  TTL=      1000ms and the vTaskPu will run till TTL=1000ms   5. After 1000ms the vTaskSu task again starts and do the      same above steps. Could anyone please guide me I am facing problem with the time management of the tasks.

Time management FreeRTOS

I have three tasks. static void vTaskAd( void *pvParameters ); //broadcast the ATYPE packets static void vTaskSu( void *pvParameters ); //read the socket and check the SType packets static void vTaskPu( void *pvParameters ); //broadcast the PTYPE packets Let suppose SType packets are generated every 10sec. 1. vTaskAd runs continuously until any reception of the STYPE packet 2. vTaskSu(read the STYPE packets every time) run continuously 3. If it found the STYPE packet then vTaskPu task will start. 4. vTaskAd will goes to sleep until let suppose TTL= 1000ms and the vTaskPu will run till TTL=1000ms 5. After 1000ms the vTaskSu task again starts and do the same above steps. Could anyone please guide me I am facing problem with the time management of the tasks.

Time management FreeRTOS

Sorry but I’m not sure what you are asking. You are saying that vTaskAd runns until vTaskSu receives an SType packet (what ever that is)?  Therefore task vTaskSu has to suspend vTaskAd when it receives a packet?  Is this correct? Regards.

Time management FreeRTOS

I have three tasks.  static void vTaskAd( void *pvParameters ); //broadcast the ATYPE packets  static void vTaskSu( void *pvParameters ); //read the socket and check the SType packets  static void vTaskPu( void *pvParameters ); //broadcast the PTYPE packets  Let suppose SType packets are generated every 10sec.  By default vTaskAd runs in the begning and vTaskSu keep listening the packets. if in the mean time vTaskSu receive any Stype packets then it will suspend the vTaskAd(let suppose 1000ms) and it will run vTaskPu for the time of 1000ms. after 1000ms it will resume the vTaskAd.. I have not try time scheduling with freeRTOS could you please guide me what will be the commands for these tasks.

Time management FreeRTOS

I have three tasks.  static void vTaskAd( void *pvParameters ); //broadcast the ATYPE packets  static void vTaskSu( void *pvParameters ); //read the socket and check the SType packets  static void vTaskPu( void *pvParameters ); //broadcast the PTYPE packets  Let suppose SType packets are generated every 10sec.  By default vTaskAd runs in the begning and vTaskSu keep listening the packets. if in the mean time vTaskSu receive any Stype packets then it will suspend the vTaskAd(let suppose 1000ms) and it will run vTaskPu for the time of 1000ms. after 1000ms it will resume the vTaskAd.. I have not try time scheduling with freeRTOS could you please guide me what will be the commands for these tasks.

Time management FreeRTOS

I think the simplest way would be to simply call vTaskSuspend() to suspend the tasks when necessary.  You can keep a track of the tick count, then call vTaskResume() when the time comes.  You might even suspend one task, then call vTaskDelay( 1000 ) to know when it is time to resume it, and call vTaskResume() as soon as you unblock (assuming there is nothing else to do in the mean time). Regards.

Time management FreeRTOS

static void vTaskSu( void *pvParameters ); //read the socket and check the SType packets  found Stype packet then SuWakeTime = xTaskGetTickCount(); vTaskDelay(1000); //Now I want to put vTaskAd to sleep to the same time as vTaskSu (Duration for both Tasks vTaskSu and vTaskAd for sleep is same) -—— static void vTaskAd( void *pvParameters ); //broadcast the ATYPE packets  -—— //Now I want to AWAKE or Run vTaskPu for the time when vTaskSu and vTaskAd are in sleeping mode. static void vTaskPu( void *pvParameters ); //broadcast the PTYPE packets  -——- //when the time of sleeping of vTaskAd and vTaskSu expired i want to send vTaskPu in sleep mode. Please guide me i could not able to slove it.