Skip to content

Commit 42141e9

Browse files
committed
mimxrt/systick: Remove unused systick helper functions.
These legacy functions were copied verbatim from the stm32 port and never used. And the use of WFI in `systick_wait_at_least()` is probably wrong. And correct the comment in SysTick_Handler, which was also copied from stm32. Signed-off-by: Damien George <damien@micropython.org>
1 parent bad1c60 commit 42141e9

2 files changed

Lines changed: 1 addition & 19 deletions

File tree

ports/mimxrt/systick.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ volatile uint32_t systick_ms = 0;
3636
systick_dispatch_t systick_dispatch_table[SYSTICK_DISPATCH_NUM_SLOTS];
3737

3838
void SysTick_Handler(void) {
39-
// Instead of calling HAL_IncTick we do the increment here of the counter.
40-
// This is purely for efficiency, since SysTick is called 1000 times per
41-
// second at the highest interrupt priority.
39+
// Increment the systick millisecond counter.
4240
uint32_t uw_tick = systick_ms + 1;
4341
systick_ms = uw_tick;
4442

@@ -52,16 +50,3 @@ void SysTick_Handler(void) {
5250
pendsv_schedule_dispatch(PENDSV_DISPATCH_SOFT_TIMER, soft_timer_handler);
5351
}
5452
}
55-
56-
bool systick_has_passed(uint32_t start_tick, uint32_t delay_ms) {
57-
return systick_ms - start_tick >= delay_ms;
58-
}
59-
60-
// waits until at least delay_ms milliseconds have passed from the sampling of
61-
// startTick. Handles overflow properly. Assumes stc was taken from
62-
// HAL_GetTick() some time before calling this function.
63-
void systick_wait_at_least(uint32_t start_tick, uint32_t delay_ms) {
64-
while (!systick_has_passed(start_tick, delay_ms)) {
65-
__WFI(); // enter sleep mode, waiting for interrupt
66-
}
67-
}

ports/mimxrt/systick.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,4 @@ static inline void systick_disable_dispatch(size_t slot) {
5454
systick_dispatch_table[slot] = NULL;
5555
}
5656

57-
void systick_wait_at_least(uint32_t stc, uint32_t delay_ms);
58-
bool systick_has_passed(uint32_t stc, uint32_t delay_ms);
59-
6057
#endif // MICROPY_INCLUDED_MIMXRT_SYSTICK_H

0 commit comments

Comments
 (0)