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;