19 lines
443 B
C
19 lines
443 B
C
#ifndef SYSTICK_H
|
|
#define SYSTICK_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "ch32fun.h"
|
|
#include "ch32v20xhw.h"
|
|
|
|
#define SYSTICK_ONE_MILLISECOND ((uint32_t)FUNCONF_SYSTEM_CORE_CLOCK / 1000)
|
|
#define SYSTICK_ONE_MICROSECOND ((uint32_t)FUNCONF_SYSTEM_CORE_CLOCK / 1000000)
|
|
|
|
extern volatile uint32_t systick_millis;
|
|
|
|
#define millis() (systick_millis)
|
|
#define micros() (SysTick->CNT / SYSTICK_ONE_MICROSECOND)
|
|
|
|
void systick_init(void);
|
|
|
|
#endif // SYSTICK_H
|