diff --git a/cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c b/cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c index 44f90ac1..44ab0155 100644 --- a/cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c +++ b/cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c @@ -243,7 +243,7 @@ void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ) // If dwt cycle count is enable, adjust it as welll if ( (CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk) && (DWT->CTRL & DWT_CTRL_CYCCNTENA_Msk) ) { - DWT->CYCCNT += ((diff * 1000000) / configTICK_RATE_HZ) * 64; + DWT->CYCCNT += (((diff-1) * 1000000) / configTICK_RATE_HZ) * 64; } switch_req = xTaskIncrementTick();