microscope-ring-light-remot.../systick.c

25 lines
381 B
C
Raw Normal View History

#include <systick.h>
2022-10-22 00:16:33 +02:00
#include <stm32f0xx.h>
volatile uint32_t global_systick = 0;
volatile uint32_t systick_wait_counter;
void systick_wait_ms(uint32_t ms)
{
systick_wait_counter = ms;
2022-10-22 00:16:33 +02:00
while (systick_wait_counter > 0)
__WFI();
}
uint32_t systick_get_global_tick(void)
{
return global_systick;
}
void SysTick_Handler(void)
{
global_systick++;
systick_wait_counter--;
}