Hi,
I am using software timers and have some questions that I am not clear about after reading the documentation:
-
When the timer period is changed with xTimerChangePeriod() like in the sample code below, what could be the cause of it failing i.e. “the command not being sent”? In the documentation it says “if it could not be sent to the timer command queue”. What can cause that and how can you prevent that?
-
Also does xTimerChangePeriod() reset the timer or does it continue count from whichever value it currently is at?
-
If the latter (i.e. it keeps counting from the value it currently is at) what happens if the new value is lower/shorter than the current value (i.e. the timeout for the new value is already elapsed/passed)?
-
Finally, is it safe to set the block time to 0? In practical terms, why would you want t0 set the block time to anything other than 0?
if( xTimerChangePeriod( xTimer, 500 / portTICK_PERIOD_MS, 100 )
== pdPASS )
{
/* The command was successfully sent. /
}
else
{
/ The command could not be sent, even after waiting for 100 ticks
to pass. Take appropriate action here. */
}
Thank you