亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? key.c

?? ucosII在TMS320LF2407成功移植的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
}

/*
*********************************************************************************************************
*                                       KEYBOARD INITIALIZATION
*
* Description: Keyboard initialization function.  KeyInit() must be called before calling any other of
*              the user accessible functions.
* Arguments  : none
* Returns    : none
*********************************************************************************************************
*/

void  KeyInit (void)
{
   
    KeyScanState = KEY_STATE_UP;                 /* Keyboard should not have a key pressed             */
    KeyNRead     = 0;                            /* Clear the number of keys read                      */
    KeyDownTmr   = 0;
    KeyBufInIx   = 0;                            /* Key codes inserted at  the beginning of the buffer */
    KeyBufOutIx  = 0;                            /* Key codes removed from the beginning of the buffer */
#if MULTITASK == 1
    KeySemPtr    = xOSSemBCreate(0,0);               /* Initialize the keyboard semaphore                  */
#endif
    KeyInitPort();                               /* Initialize I/O ports used in keyboard driver       */
#if MULTITASK == 1
    OSTaskCreate(KeyScanTask, (void *)0, &KeyScanTaskStk[0], KEY_SCAN_TASK_PRIO);
#endif
}

/*
*********************************************************************************************************
*                                           SEE IF KEY PRESSED
*
* Description : This function checks to see if a key is pressed
* Arguments   : none
* Returns     : TRUE   if a key is     pressed
*               FALSE  if a key is not pressed
* Note        : (1 << KEY_MAX_COLS) - 1   is used as a mask to isolate the column inputs (i.e. mask off
*                                         the SHIFT keys).
*********************************************************************************************************
*/

static  BOOLEAN  KeyIsKeyDown (void)
{
   
    if (KeyGetPort() & ((1 << KEY_PORT_MAX_BITS) - 1)) {         /* Key not pressed if 0                     */
        OS_ENTER_CRITICAL();
        KeyDownTmr++;                                      /* Update key down counter                  */
        OS_EXIT_CRITICAL();
        return (TRUE);
    } else {
        return (FALSE);
    }
}

/*
*********************************************************************************************************
*                                         KEYBOARD SCANNING TASK
*
* Description : This function contains the body of the keyboard scanning task.  The task should be
*               assigned a low priority.  The scanning period is determined by KEY_SCAN_TASK_DLY.
* Arguments   : 'data'   is a pointer to data passed to task when task is created (NOT USED).
* Returns     : KeyScanTask() never returns.
* Notes       : - An auto repeat of the key pressed will be executed after the key has been pressed for
*                 more than KEY_RPT_START_DLY scan times.  Once the auto repeat has started, the key will
*                 be repeated every KEY_RPT_DLY scan times as long as the key is pressed.  For example,
*                 if the scanning of the keyboard occurs every 50 mS and KEY_RPT_START_DLY is set to 40
*                 and KEY_RPT_DLY is set to 2, then the auto repeat function will engage after 2 seconds
*                 and will repeat every 100 mS (10 times per second).
*********************************************************************************************************
*/

#if MULTITASK == 1
static  void  KeyScanTask (void *data)
{
    INT8U code;


    data = data;                                           /* Avoid compiler warning (uC/OS-II req.)   */
    for (;;) {
        xOSTimeDlyHMSM(0, 0, 0, KEY_SCAN_TASK_DLY);         /* Delay between keyboard scans             */
        switch (KeyScanState) {
            case KEY_STATE_UP:                             /* See if need to look for a key pressed    */
                 if (KeyIsKeyDown()) {                     /* See if key is pressed                    */
                     KeyScanState = KEY_STATE_DEBOUNCE;    /* Next call we will have debounced the key */
                     KeyDownTmr   = 0;                     /* Reset key down timer                     */
                 }
                 break;

            case KEY_STATE_DEBOUNCE:                       /* Key pressed, get scan code and buffer    */
                 if (KeyIsKeyDown()) {                     /* See if key is pressed                    */
                     code              = KeyDecode();      /* Determine the key scan code              */
                     KeyBufIn(code);                       /* Input scan code in buffer                */
                     KeyRptStartDlyCtr = KEY_RPT_START_DLY;/* Start delay to auto-repeat function      */
                     KeyScanState      = KEY_STATE_RPT_START_DLY;
                 } else {
                     //KeySelRow(KEY_ALL_ROWS);              /* Select all row                           */
                     KeyScanState      = KEY_STATE_UP;     /* Key was not pressed after all!           */
                 }
                 break;

            case KEY_STATE_RPT_START_DLY:
                 if (KeyIsKeyDown()) {                     /* See if key is still pressed              */
                     if (KeyRptStartDlyCtr > 0) {          /* See if we need to delay before auto rpt  */
                         KeyRptStartDlyCtr--;              /* Yes, decrement counter to start of rpt   */
                         if (KeyRptStartDlyCtr == 0) {     /* If delay to auto repeat is completed ... */
                             code         = KeyDecode();   /* Determine the key scan code              */
                             KeyBufIn(code);               /* Input scan code in buffer                */
                             KeyRptDlyCtr = KEY_RPT_DLY;   /* Load delay before next repeat            */
                             KeyScanState = KEY_STATE_RPT_DLY;
                         }
                     }
                 } else {
                     KeyScanState = KEY_STATE_DEBOUNCE;    /* Key was not pressed after all            */
                 }
                 break;

            case KEY_STATE_RPT_DLY:
                 if (KeyIsKeyDown()) {                     /* See if key is still pressed              */
                     if (KeyRptDlyCtr > 0) {               /* See if we need to wait before repeat key */
                         KeyRptDlyCtr--;                   /* Yes, dec. wait time to next key repeat   */
                         if (KeyRptDlyCtr == 0) {          /* See if it's time to repeat key           */
                             code         = KeyDecode();   /* Determine the key scan code              */
                             KeyBufIn(code);               /* Input scan code in buffer                */
                             KeyRptDlyCtr = KEY_RPT_DLY;   /* Reload delay counter before auto repeat  */
                         }
                     }
                 } else {
                     KeyScanState = KEY_STATE_DEBOUNCE;    /* Key was not pressed after all            */
                 }
                 break;
        }
    }
}
#else
void KeyScan(void)
 {
       INT8U code;
        //OSTimeDlyHMSM(0, 0, 0, KEY_SCAN_TASK_DLY);         /* Delay between keyboard scans             */
        switch (KeyScanState) {
            case KEY_STATE_UP:                             /* See if need to look for a key pressed    */
                 if (KeyIsKeyDown()) {                     /* See if key is pressed                    */
                     KeyScanState = KEY_STATE_DEBOUNCE;    /* Next call we will have debounced the key */
                     KeyDownTmr   = 0;                     /* Reset key down timer                     */
                 }
                 break;

            case KEY_STATE_DEBOUNCE:                       /* Key pressed, get scan code and buffer    */
                 if (KeyIsKeyDown()) {                     /* See if key is pressed                    */
                     code              = KeyDecode();      /* Determine the key scan code              */
                     KeyBufIn(code);                       /* Input scan code in buffer                */
                     KeyRptStartDlyCtr = KEY_RPT_START_DLY;/* Start delay to auto-repeat function      */
                     KeyScanState      = KEY_STATE_RPT_START_DLY;
                 } else {
                     //KeySelRow(KEY_ALL_ROWS);              /* Select all row                           */
                     KeyScanState      = KEY_STATE_UP;     /* Key was not pressed after all!           */
                 }
                 break;

            case KEY_STATE_RPT_START_DLY:
                 if (KeyIsKeyDown()) {                     /* See if key is still pressed              */
                     if (KeyRptStartDlyCtr > 0) {          /* See if we need to delay before auto rpt  */
                         KeyRptStartDlyCtr--;              /* Yes, decrement counter to start of rpt   */
                         if (KeyRptStartDlyCtr == 0) {     /* If delay to auto repeat is completed ... */
                             code         = KeyDecode();   /* Determine the key scan code              */
                             KeyBufIn(code);               /* Input scan code in buffer                */
                             KeyRptDlyCtr = KEY_RPT_DLY;   /* Load delay before next repeat            */
                             KeyScanState = KEY_STATE_RPT_DLY;
                         }
                     }
                 } else {
                     KeyScanState = KEY_STATE_DEBOUNCE;    /* Key was not pressed after all            */
                 }
                 break;

            case KEY_STATE_RPT_DLY:
                 if (KeyIsKeyDown()) {                     /* See if key is still pressed              */
                     if (KeyRptDlyCtr > 0) {               /* See if we need to wait before repeat key */
                         KeyRptDlyCtr--;                   /* Yes, dec. wait time to next key repeat   */
                         if (KeyRptDlyCtr == 0) {          /* See if it's time to repeat key           */
                             code         = KeyDecode();   /* Determine the key scan code              */
                             KeyBufIn(code);               /* Input scan code in buffer                */
                             KeyRptDlyCtr = KEY_RPT_DLY;   /* Reload delay counter before auto repeat  */
                         }
                     }
                 } else {
                     KeyScanState = KEY_STATE_DEBOUNCE;    /* Key was not pressed after all            */
                 }
                 break;
        }
}

#endif

/*
*********************************************************************************************************
*                                              READ PORT
*
* Description : This function is called to read the column port.
* Arguments   : none
* Returns     : the complement of the column port thus, ones are keys pressed
*********************************************************************************************************
*/
INT16U  KeyGetPort(void)
{
    return ((INT16U)(KEY_PORT_VAL&0xFF));   
}

void  KeyInitPort (void)
{
                     
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一二三| 欧美日韩精品三区| 久久久久久久久久久久久夜| 日韩在线卡一卡二| 欧美一区二区美女| 免费成人在线影院| 久久精品人人做人人爽97| 国产精品99久久不卡二区| 国产天堂亚洲国产碰碰| 99精品国产91久久久久久| 亚洲黄色免费网站| 欧美欧美午夜aⅴ在线观看| 亚洲免费观看高清完整版在线观看| 欧美色图在线观看| 亚洲精品视频自拍| 久久亚洲一级片| 精品国产91九色蝌蚪| 美女视频网站黄色亚洲| 亚洲第一在线综合网站| 国产欧美一区二区在线| 欧美日韩中字一区| 91香蕉视频黄| 国内精品视频一区二区三区八戒| 亚洲日本在线看| 91精品久久久久久蜜臀| 激情六月婷婷久久| 午夜精品久久久久影视| 国产精品黄色在线观看 | 91免费国产在线| 秋霞影院一区二区| 一区二区欧美国产| 亚洲黄一区二区三区| 久久精品人人做人人爽人人| 日韩欧美黄色影院| 欧美私模裸体表演在线观看| 成人sese在线| 日韩va亚洲va欧美va久久| 亚洲在线成人精品| 亚洲成人激情自拍| 亚洲愉拍自拍另类高清精品| 亚洲制服丝袜一区| 亚洲九九爱视频| 五月天视频一区| 一本色道久久综合亚洲aⅴ蜜桃 | 欧美在线啊v一区| 日韩免费看的电影| 国产欧美日韩三区| 亚洲精品乱码久久久久久久久 | 日韩国产在线一| 日韩av一区二区三区四区| 色综合中文综合网| 欧美久久久久久蜜桃| 亚洲猫色日本管| 亚洲图片欧美综合| 一区二区三区影院| 一区二区三区在线影院| 国产精品久久久久久久久久免费看| 国产欧美1区2区3区| 亚洲靠逼com| 欧美又粗又大又爽| 亚洲第一搞黄网站| 日韩精品一区二区三区三区免费| 91国在线观看| 91天堂素人约啪| 欧美日韩一区小说| 精品福利在线导航| 欧美大片一区二区| 精品国产一区二区三区忘忧草| 日韩精品一区二区三区中文不卡 | 一区二区三区中文字幕电影 | 一本大道久久精品懂色aⅴ| 欧美国产日韩a欧美在线观看| 国产亚洲女人久久久久毛片| 日本少妇一区二区| 一本高清dvd不卡在线观看| 高潮精品一区videoshd| 免费成人av在线| 九九在线精品视频| 国产精品女主播在线观看| 欧美一区二区在线视频| 国产精品大尺度| 国产乱码精品一品二品| 亚洲成人av电影| 成人欧美一区二区三区1314| 欧美一区二区播放| 日本乱人伦aⅴ精品| 国产ts人妖一区二区| 青青草原综合久久大伊人精品优势| 亚洲欧美日韩久久精品| 日本一区二区三区视频视频| 国产精品久久网站| 国产精品1区2区3区在线观看| 欧美美女喷水视频| 亚洲成人综合网站| 在线播放一区二区三区| 男男成人高潮片免费网站| 国产精品久久久久久久久免费丝袜| 国产成人亚洲精品狼色在线| 国产喷白浆一区二区三区| 97久久人人超碰| 亚洲一级电影视频| 日韩精品中文字幕一区二区三区 | 国产一区欧美一区| 久久综合九色综合97婷婷| 91性感美女视频| 麻豆精品在线看| 亚洲免费视频中文字幕| 日韩一区二区精品葵司在线| 成人激情综合网站| 蜜臀av一区二区在线免费观看| 精品国产91亚洲一区二区三区婷婷| 9l国产精品久久久久麻豆| 日韩高清不卡一区二区三区| 国产精品久久久久久户外露出| 91精品国产综合久久婷婷香蕉| 国产成人在线电影| 国产精品资源在线观看| 亚洲国产另类精品专区| 亚洲精品免费看| 日韩亚洲欧美成人一区| 国产三级久久久| 2023国产精华国产精品| 黄一区二区三区| 一区二区高清视频在线观看| 美腿丝袜在线亚洲一区| 色久综合一二码| 成人理论电影网| 日韩高清在线观看| 精品一区二区三区久久久| 国内成+人亚洲+欧美+综合在线 | 亚洲午夜激情网站| 亚洲国产欧美在线| 爽好多水快深点欧美视频| 亚洲成a人片在线不卡一二三区| 日韩综合小视频| 精品一区二区影视| 亚洲1区2区3区视频| 国产欧美日韩在线| 久久久久久久久久久黄色| 欧美一区二区在线观看| 日韩精品在线一区| 久久综合色天天久久综合图片| 精品少妇一区二区| 久久午夜色播影院免费高清| 日韩一本二本av| 久久久久久久久久久久久夜| 国产精品久久久久婷婷| 亚洲女人****多毛耸耸8| 亚洲精品你懂的| 另类欧美日韩国产在线| 国产成人精品亚洲777人妖 | 波多野结衣视频一区| 99精品视频在线免费观看| 欧美午夜一区二区三区免费大片| 在线免费观看一区| 国产清纯在线一区二区www| 亚洲精品国久久99热| 国产精品自拍毛片| 欧美性色黄大片| 中文一区在线播放| 免费久久99精品国产| 色综合一区二区| 亚洲欧美日韩久久| 国产一区二区按摩在线观看| 久久亚洲免费视频| 久久99久久久久| 国产欧美日韩综合| 91精品啪在线观看国产60岁| 精品日韩99亚洲| 久久精品男人的天堂| 成人性生交大片免费看视频在线| 日本va欧美va瓶| 久久国产精品一区二区| 国产不卡视频一区二区三区| 国产精品2024| 欧美成人精品1314www| 亚洲一区二区三区四区的| 成人小视频免费观看| 精品成人私密视频| 婷婷国产v国产偷v亚洲高清| 色综合色狠狠综合色| 中文一区二区在线观看| 精品一二线国产| 日韩欧美你懂的| 老色鬼精品视频在线观看播放| 成人理论电影网| 亚洲一区中文在线| 欧美嫩在线观看| 日韩中文字幕一区二区三区| 欧美日韩视频在线观看一区二区三区| 亚洲伦在线观看| 69堂精品视频| 高清国产一区二区三区| 中文字幕一区三区| 在线观看中文字幕不卡| 蜜臀av一级做a爰片久久| 久久亚洲综合色一区二区三区| 美国毛片一区二区| 日韩伦理免费电影| 欧美一激情一区二区三区|