Skip to content

Commit

Permalink
Fix code example in timers.h (#412)
Browse files Browse the repository at this point in the history
The example was trying to create a timer with period 0 which is not a
valid period.

This was reported here - https://forums.freertos.org/t/multiple-timers/13884

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
  • Loading branch information
aggarg committed Nov 12, 2021
1 parent 683811b commit 78da9cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ typedef void (* PendedFunction_t)( void *,
* // the scheduler starts.
* for( x = 0; x < NUM_TIMERS; x++ )
* {
* xTimers[ x ] = xTimerCreate( "Timer", // Just a text name, not used by the kernel.
* ( 100 * x ), // The timer period in ticks.
* pdTRUE, // The timers will auto-reload themselves when they expire.
* ( void * ) x, // Assign each timer a unique id equal to its array index.
* vTimerCallback // Each timer calls the same callback when it expires.
* xTimers[ x ] = xTimerCreate( "Timer", // Just a text name, not used by the kernel.
* ( 100 * ( x + 1 ) ), // The timer period in ticks.
* pdTRUE, // The timers will auto-reload themselves when they expire.
* ( void * ) x, // Assign each timer a unique id equal to its array index.
* vTimerCallback // Each timer calls the same callback when it expires.
* );
*
* if( xTimers[ x ] == NULL )
Expand Down

0 comments on commit 78da9cb

Please sign in to comment.