drivers: timer: SysTick: remove unnecessary masking

Unsupported bits of the Current Value Register
are read as zero, so we remove the redundant
ANDing with the max supported counter value.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2019-04-16 14:28:10 +02:00 committed by David Leach
commit 35886463dd

View file

@ -68,7 +68,7 @@ static u32_t elapsed(void)
* VAL was "about to overflow".
*/
ctrl1 = SysTick->CTRL;
val = SysTick->VAL & COUNTER_MAX;
val = SysTick->VAL;
ctrl2 = SysTick->CTRL;
overflow_cyc += (ctrl1 & SysTick_CTRL_COUNTFLAG_Msk) ? last_load : 0;