stm32/systick: Rename sys_tick_XXX functions to systick_XXX.

This commit is contained in:
Damien George 2019-02-03 22:52:31 +11:00
parent f024b2610f
commit 5fbda53d3c
3 changed files with 7 additions and 7 deletions

View File

@ -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);
}

View File

@ -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
}
}

View File

@ -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