Software timers use cases

Hi there,
So my system works like , Every 2 hours my system will wakeup from sleep and send some data over network for 20 minuets and goes back to sleep. Here in this 20 minuets, I am using FreeRTOS Software Timers to trigger in the interval of 5 sec, From the SW Timer handler I am sending data over network.
I am suspending all the tasks before going to sleep.
In this situation do I need to delete the timer or stop the timer after suspending all the tasks?

Yes, you should stop the 5-second timer when you’re ready to go to sleep. Then start the timer again when the next 20-minute reporting period starts.

Hi @jefftenney ,
Thank you for your reply.
One more thing, can I stop or start the timer from the timer handler?

Yes. Just be sure that the xTicksToWait parameter is set to zero if calling the timer function from a timer callback.

Hi @jefftenney ,
I am sending sending timer elapsed event on queue.
BaseType_t xQueueSend(
QueueHandle_t xQueue,
const void * pvItemToQueue,
TickType_t xTicksToWait
);
From the timer handler if I need to send event on queue means, what could be the xTicksToWait value?
Can you suggest me anything on this?

Timer callback functions shouldn’t block, so set xTicksToWait to 0.

Hi @richard-damon
what if the queue is full at the time I might miss the evet to post?

Yes, but if you let yourself block you interrupt all other timers, and there is a corner case of the clock overflowing while you are blocked that can cause a crash.