From 78da9cb261787895bb3eb9c1d0753072498544d6 Mon Sep 17 00:00:00 2001 From: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> Date: Fri, 12 Nov 2021 10:36:49 -0800 Subject: [PATCH] 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 --- include/timers.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/timers.h b/include/timers.h index e6037627f..e94e89f22 100644 --- a/include/timers.h +++ b/include/timers.h @@ -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 )