#include #include "yc11xx.h" #include "system.h" #include "core_cm0.h" uint32_t tick_count = 0; #define SYSTEM_CLOCK (24000000UL) #define CLOCK_DIVISOR 1000 void SYS_TimerInit() { SysTick_Config(SYSTEM_CLOCK/CLOCK_DIVISOR); //each systick interrupt is 1ms } void SYStick_handle() { #ifdef DEBUG_SYS MyPrintf("SYSTICK Interrupt trigger a success!\n"); #endif tick_count++; } int main(void) { printport_init(); int i = 0x100000; while(i--); MyPrintf("this ti systick test\n"); SYS_TimerInit(); while(1) { if(tick_count%1000 == 0) { MyPrintf("tick_count = %d\n",tick_count); } } }