Skip to content

Commit 9a96003

Browse files
committed
correct micro ticks
1 parent b0311d1 commit 9a96003

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/nRF5/freertos/portable/CMSIS/nrf52/port_cmsis_systick.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
243243
// If dwt cycle count is enable, adjust it as welll
244244
if ( (CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk) && (DWT->CTRL & DWT_CTRL_CYCCNTENA_Msk) )
245245
{
246-
DWT->CYCCNT += ((diff * 1000000) / configTICK_RATE_HZ) * 64;
246+
DWT->CYCCNT += (((diff-1) * 1000000) / configTICK_RATE_HZ) * 64;
247247
}
248248

249249
switch_req = xTaskIncrementTick();

0 commit comments

Comments
 (0)