Fix code example in timers.h (#412)

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>
This commit is contained in:
Gaurav-Aggarwal-AWS 2021-11-12 10:36:49 -08:00 committed by GitHub
parent 683811bd8c
commit 78da9cb261
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -193,7 +193,7 @@ typedef void (* PendedFunction_t)( void *,
* for( x = 0; x < NUM_TIMERS; x++ ) * for( x = 0; x < NUM_TIMERS; x++ )
* { * {
* xTimers[ x ] = xTimerCreate( "Timer", // Just a text name, not used by the kernel. * xTimers[ x ] = xTimerCreate( "Timer", // Just a text name, not used by the kernel.
* ( 100 * x ), // The timer period in ticks. * ( 100 * ( x + 1 ) ), // The timer period in ticks.
* pdTRUE, // The timers will auto-reload themselves when they expire. * pdTRUE, // The timers will auto-reload themselves when they expire.
* ( void * ) x, // Assign each timer a unique id equal to its array index. * ( void * ) x, // Assign each timer a unique id equal to its array index.
* vTimerCallback // Each timer calls the same callback when it expires. * vTimerCallback // Each timer calls the same callback when it expires.