tzakariassen wrote on Wednesday, November 27, 2013:
I’ve got a STM32L100 running fine with freeRTOS 7.5.2 and Atollic 4.2 as dev tool on a Discovery board. I use the systick counter to measure time between certain events in my code like
xEventTimeToTrack = xTaskGetTickCount();
.
.
.
if (condition)
xPassedtimeBetweenEvents = xTaskGetTickCount() - xEventTimeToTrack;
When the systick counter eventually wraps to zero the above expression will produce undesireable result unless you make some validity checks and adjustments before attempting the subtraction. Does freeRTOS perform some clever internal adjustments to the systick counter value so that the above expression Always produce the intended result?
Best regards /Thom