Skip to content

Commit 3588646

Browse files
ioannisgdleach02
authored andcommitted
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 <[email protected]>
1 parent 7dc0618 commit 3588646

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/timer/cortex_m_systick.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static u32_t elapsed(void)
6868
* VAL was "about to overflow".
6969
*/
7070
ctrl1 = SysTick->CTRL;
71-
val = SysTick->VAL & COUNTER_MAX;
71+
val = SysTick->VAL;
7272
ctrl2 = SysTick->CTRL;
7373

7474
overflow_cyc += (ctrl1 & SysTick_CTRL_COUNTFLAG_Msk) ? last_load : 0;

0 commit comments

Comments
 (0)