From 9a960037bb56b33f5d7c99baca795622c61c0c7a Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 20 Aug 2020 23:15:40 +0700 Subject: [PATCH] correct micro ticks --- cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();