欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: 利用定時(shí)器延時(shí) [打印本頁(yè)]

作者: sayno186    時(shí)間: 2015-2-11 20:56
標(biāo)題: 利用定時(shí)器延時(shí)
#include <reg52.h>
#define DELAY_TIME 120       //時(shí)間設(shè)置    秒 = DELAY_TIME * system_delay(系統(tǒng)時(shí)標(biāo)時(shí)間)
bit b_switch_delay = 0;
unsigned char u_tem = 0;

void switch_delay()
{
        if (system_delay)
        {
                system_delay = 0;                                //定時(shí)器系統(tǒng)時(shí)標(biāo)清0;
                if (u_temp >= DELAY_TIME)
                {
                        b_switch_delay = 1;                        //延時(shí)時(shí)間標(biāo)記
                }
                else
                u_temp++;
        }       
}
//復(fù)位延時(shí)清0
void rst_switch_delay()
{
        u_temp                         = 0;                                //臨時(shí)計(jì)數(shù)變量清0;
        b_switch_delay         = 0;                                //延時(shí)時(shí)間標(biāo)記清0
}


作者: admin    時(shí)間: 2015-2-11 22:06
注釋比較詳細(xì),謝謝分享




歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1