#ifndef _SYSTEM_H_
#define _SYSTEM_H_

#include "platform.h"


#define CLI()   GIE_DISABLE()
#define SEI()   GIE_ENABLE()


extern volatile uint8_t BaseTime_2ms_Cnt;
extern volatile uint8_t BaseTime_10ms_Cnt;
extern volatile uint8_t BaseTime_100ms_Cnt;

void riscv_clock_init(void);
void board_init(void);

void user_init(void);
void user_2ms_handler(void);
void user_10ms_handler(void);
void user_100ms_handler(void);
void tick_user_handler(void);

extern void time0_lowper_callback(uint8_t option);

#define _2MS_BASE_CNT       4
#define _10MS_BASE_CNT      5
#define _100MS_BASE_CNT     10

#define HEAP_5_SIZE     (20*1024)
#define CPU_MAX_FREQ    360
//#define ENTER_DVDD_MODE
#endif