first commit
This commit is contained in:
19
inc/systick.h
Normal file
19
inc/systick.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user