From 8c5b77635e7347c6a91238113a09aa1d1c11a89f Mon Sep 17 00:00:00 2001 From: Richard Barry Date: Mon, 23 Aug 2010 15:59:07 +0000 Subject: [PATCH] Add a -1 to the calculation of the compare match value. --- Source/portable/MPLAB/PIC24_dsPIC/port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/portable/MPLAB/PIC24_dsPIC/port.c b/Source/portable/MPLAB/PIC24_dsPIC/port.c index 241c47206..fb19e586e 100644 --- a/Source/portable/MPLAB/PIC24_dsPIC/port.c +++ b/Source/portable/MPLAB/PIC24_dsPIC/port.c @@ -260,7 +260,7 @@ void vPortEndScheduler( void ) */ static void prvSetupTimerInterrupt( void ) { -const unsigned long ulCompareMatch = ( configCPU_CLOCK_HZ / portTIMER_PRESCALE ) / configTICK_RATE_HZ; +const unsigned long ulCompareMatch = ( ( configCPU_CLOCK_HZ / portTIMER_PRESCALE ) / configTICK_RATE_HZ ) - 1; /* Prescale of 8. */ T1CON = 0;