~ruther/stm32h747i-disco-usb-image-viewer

ref: 76bfb7680886ed7ae054a167f4d81eac6815efb3 stm32h747i-disco-usb-image-viewer/src/delay.c -rw-r--r-- 304 bytes
76bfb768 — Rutherther Revert "feat: atomic register modifications" 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "delay.h"
#include <stm32h7xx.h>

uint32_t us_ticks;

void systick_configure() {
  SysTick->LOAD = SYSTICK_LOAD;
  SysTick->VAL = 0;
  SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk; //| SysTick_CTRL_TICKINT_Msk;
  us_ticks = 0;
}

void systick_handler() {
  us_ticks++;
}