中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 一種高效定時器模塊的設(shè)計與實現(xiàn)

        一種高效定時器模塊的設(shè)計與實現(xiàn)

        作者: 時間:2011-03-25 來源:電子產(chǎn)品世界 收藏

          可見,啟動某個軟件定時器便是設(shè)置由timer_id枚舉的TIMER數(shù)組成員的各個成員變量,下面詳細(xì)介紹軟件定時器的運行。

        本文引用地址:http://www.antipu.com.cn/article/118088.htm

          作為所有軟件定時器的基準(zhǔn)源,硬件定時器設(shè)定為2ms的周期定時,在時鐘中斷服務(wù)程序中全局時鐘嘀嗒Jiffs累加,TimerTicked置1,軟件定時器運行函數(shù)如下:

          void TimerTick(void)

          {

          uint timer_index;

          if(0==TimerTicked)

          {

          return ;

          }

          for(timer_index=0;timer_index

          {

          if(RUNNING==TIMER[timer_index].timer_state)

          {

          TIMER[timer_index].duration++;

          if(TIMER[timer_index].duration>=TIMER[timer_index].timeout)

          {

          TIMER[timer_index].overflow_ag=1;

          if(TIMER[timer_index].cycle)

          {

          TimerReStart(timer_index);

          }

          else

          {

          TIMER[timer_index].cnt_times--;

          if(0==TIMER[timer_index].cnt_times)

          {

          TimerStall(timer_index);

          }

          else

          {

          TimerReStart(timer_index);

          }}}}}

          TimerTicked=0;

          }



        評論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉