mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 05:21:59 -04:00
Correct timer calculation.
This commit is contained in:
parent
d7ca9ad0c3
commit
b08411ec5a
|
@ -192,7 +192,7 @@ TB_InitTypeDef TB_InitStructure;
|
||||||
/* Setup the TB for the generation of the tick interrupt. */
|
/* Setup the TB for the generation of the tick interrupt. */
|
||||||
TB_InitStructure.TB_Mode = TB_Mode_Timing;
|
TB_InitStructure.TB_Mode = TB_Mode_Timing;
|
||||||
TB_InitStructure.TB_CounterMode = TB_CounterMode_Down;
|
TB_InitStructure.TB_CounterMode = TB_CounterMode_Down;
|
||||||
TB_InitStructure.TB_Prescaler = portPRESCALE;
|
TB_InitStructure.TB_Prescaler = portPRESCALE - 1;
|
||||||
TB_InitStructure.TB_AutoReload = ( ( configCPU_CLOCK_HZ / ( portPRESCALE + 1 ) ) / configTICK_RATE_HZ ) + 1;
|
TB_InitStructure.TB_AutoReload = ( ( configCPU_CLOCK_HZ / ( portPRESCALE + 1 ) ) / configTICK_RATE_HZ ) + 1;
|
||||||
TB_Init(&TB_InitStructure);
|
TB_Init(&TB_InitStructure);
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,7 @@ TB_InitTypeDef TB_InitStructure;
|
||||||
/* Setup the TB for the generation of the tick interrupt. */
|
/* Setup the TB for the generation of the tick interrupt. */
|
||||||
TB_InitStructure.TB_Mode = TB_Mode_Timing;
|
TB_InitStructure.TB_Mode = TB_Mode_Timing;
|
||||||
TB_InitStructure.TB_CounterMode = TB_CounterMode_Down;
|
TB_InitStructure.TB_CounterMode = TB_CounterMode_Down;
|
||||||
TB_InitStructure.TB_Prescaler = portPRESCALE;
|
TB_InitStructure.TB_Prescaler = portPRESCALE - 1;
|
||||||
TB_InitStructure.TB_AutoReload = ( ( configCPU_CLOCK_HZ / ( portPRESCALE + 1 ) ) / configTICK_RATE_HZ ) + 1;
|
TB_InitStructure.TB_AutoReload = ( ( configCPU_CLOCK_HZ / ( portPRESCALE + 1 ) ) / configTICK_RATE_HZ ) + 1;
|
||||||
TB_Init(&TB_InitStructure);
|
TB_Init(&TB_InitStructure);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue