在编程中尽量少用延时函数,一般用定时器来代替;
定时器可定义多个适合程序使用的间隔
void basicTime(void)
{
if(f_tm1ms)
{
f_tm1ms = 0;
tm10ms++;
tmxms++;
if(tmxms>4)
{
tmxms = 0;
f_dataScopeTm1ms = 1;
}
RGBDriverTm++;
if(RGBDriverTm>=2)
{
RGBDriverTm = 0;
f_RGBDriverTm = 1;
}
if(tm10ms>=10)
{
tm10ms = 0;
tm100ms++;
f_sleepTm = 1;
f_LedRefresh = 1;
f_outTm = 1;
f_keyProcessTm = 1;
if(tm100ms>=10)
{
tm100ms = 0;