示例:
void timer1_printf()
{
printf("timer1 time up\r");
}
void timer2_printf()
{
printf("timer2 once\r");
}
while (1)
{
soft_timer_cycle(1,1000,timer1_printf);//循环执行定时器,不断打印timer1 time up
soft_timer_single(2,500,timer2_printf);//单次执行定时器,只打印一次timer2 once
}
gitee仓库地址:https://gitee.com/ki888/soft_timer