From 5fbda53d3c43e94a18a66d49a4c315f0af86e204 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sun, 3 Feb 2019 22:52:31 +1100 Subject: [PATCH] stm32/systick: Rename sys_tick_XXX functions to systick_XXX. --- ports/stm32/main.c | 4 ++-- ports/stm32/systick.c | 6 +++--- ports/stm32/systick.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/stm32/main.c b/ports/stm32/main.c index 33cfe84eeb..ef0e1e791b 100644 --- a/ports/stm32/main.c +++ b/ports/stm32/main.c @@ -229,7 +229,7 @@ MP_NOINLINE STATIC bool init_flash_fs(uint reset_mode) { f_close(&fp); // keep LED on for at least 200ms - sys_tick_wait_at_least(start_tick, 200); + systick_wait_at_least(start_tick, 200); led_state(PYB_LED_GREEN, 0); } else if (res == FR_OK) { // mount sucessful @@ -273,7 +273,7 @@ MP_NOINLINE STATIC bool init_flash_fs(uint reset_mode) { f_close(&fp); // keep LED on for at least 200ms - sys_tick_wait_at_least(start_tick, 200); + systick_wait_at_least(start_tick, 200); led_state(PYB_LED_GREEN, 0); } diff --git a/ports/stm32/systick.c b/ports/stm32/systick.c index c07d0fabce..8b5efe0577 100644 --- a/ports/stm32/systick.c +++ b/ports/stm32/systick.c @@ -90,15 +90,15 @@ void mp_hal_delay_us(mp_uint_t usec) { } } -bool sys_tick_has_passed(uint32_t start_tick, uint32_t delay_ms) { +bool systick_has_passed(uint32_t start_tick, uint32_t delay_ms) { return HAL_GetTick() - start_tick >= delay_ms; } // waits until at least delay_ms milliseconds have passed from the sampling of // startTick. Handles overflow properly. Assumes stc was taken from // HAL_GetTick() some time before calling this function. -void sys_tick_wait_at_least(uint32_t start_tick, uint32_t delay_ms) { - while (!sys_tick_has_passed(start_tick, delay_ms)) { +void systick_wait_at_least(uint32_t start_tick, uint32_t delay_ms) { + while (!systick_has_passed(start_tick, delay_ms)) { __WFI(); // enter sleep mode, waiting for interrupt } } diff --git a/ports/stm32/systick.h b/ports/stm32/systick.h index 256a500c27..abb8729f54 100644 --- a/ports/stm32/systick.h +++ b/ports/stm32/systick.h @@ -26,7 +26,7 @@ #ifndef MICROPY_INCLUDED_STM32_SYSTICK_H #define MICROPY_INCLUDED_STM32_SYSTICK_H -void sys_tick_wait_at_least(uint32_t stc, uint32_t delay_ms); -bool sys_tick_has_passed(uint32_t stc, uint32_t delay_ms); +void systick_wait_at_least(uint32_t stc, uint32_t delay_ms); +bool systick_has_passed(uint32_t stc, uint32_t delay_ms); #endif // MICROPY_INCLUDED_STM32_SYSTICK_H