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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? key.c

?? ucosII在TMS320LF2407成功移植的源代碼
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                   Shanghai Maritime University
*                                                 Pudong Avenue 1550#
*
*                                        (c)Copyright 2005,SMSC,Shanghai,China
*                                                    All Rights Reserved
*
*
* Filename   : KEY.C
* Programmer : Jason Chen (Refer to Jean J. Labrosse's Matrix keyboard driver)
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*                                              INCLUDE FILES
*********************************************************************************************************
*/

#include "key_cfg.h"
/*
*********************************************************************************************************
*                                           FUNCTION PROTOTYPES
*********************************************************************************************************
*/

void    KeyFlush(void);                /* Flush the keyboard buffer                                    */
INT8U   KeyGetKey(INT16U to);          /* Get a key scan code from driver if one is present, -1 else   */
INT32U  KeyGetKeyDownTime(void);       /* Get how long key has been pressed (in milliseconds)          */
BOOLEAN KeyHit(void);                  /* See if a key has been pressed (TRUE if so, FALSE if not)     */
void    KeyInit(void);                 /* Initialize the keyboard handler                              */
void    KeyInitPort(void);             /* Initialize I/O ports                                         */
INT16U  KeyGetPort(void);

/*
*********************************************************************************************************
*                                       LOCAL FUNCTION PROTOTYPES
*********************************************************************************************************
*/

static  void      KeyBufIn(INT8U code);     /* Insert scan code into keyboard buffer                   */
static  INT8U     KeyDecode(void);          /* Get scan code from current key pressed                  */
static  BOOLEAN   KeyIsKeyDown(void);       /* See if key has been pressed                             */
static  void      KeyScanTask(void *data);  /* Keyboard scanning task                                  */
static void Delay(INT16U counts);

/*
**************************************************************************
*                                           Dummy for a Period of  Time
*
* Description :  This function is used to delay a period and cpu can do nothing.
* Arguments  :  'counts' is the dummy counts.                                 
* Returns      :   None.                  
**************************************************************************
*/

static void Delay(INT16U counts)
{
	int i;
	for(i=0;i<counts;i++);	
}

/*
*********************************************************************************************************
*                                INSERT KEY CHARACTER INTO KEYBOARD BUFFER
*
* Description : This function inserts a key character into the keyboard buffer
* Arguments   : code    is the keyboard scan code to insert into the buffer
* Returns     : none
*********************************************************************************************************
*/

static  void  KeyBufIn (INT8U code)
{
    OS_ENTER_CRITICAL();                         /* Start of critical section of code, disable ints    */
    if (KeyNRead < KEY_BUF_SIZE) {               /* Make sure that we don't overflow the buffer        */
        KeyNRead++;                              /* Increment the number of keys read                  */
        KeyBuf[KeyBufInIx++] = code;             /* Store the scan code into the buffer                */
        if (KeyBufInIx >= KEY_BUF_SIZE) {        /* Adjust index to the next scan code to put in buffer*/
            KeyBufInIx = 0;
        }
        OS_EXIT_CRITICAL();                      /* End of critical section of code                    */
#if MULTITASK == 1
        xOSSemGive(KeySemPtr);                    /* Signal sem if scan code inserted in the buffer     */
#endif
    } else {                                     /* Buffer is full, key scan code is lost              */
        OS_EXIT_CRITICAL();                      /* End of critical section of code                    */
    }
}

/*
*********************************************************************************************************
*                                           DECODE KEYBOARD
*
* Description : This function is called to determine the key scan code(index of the key character map table) of the key pressed.
* Arguments   : none
* Returns     : the key scan code(index of the key character map table)
*********************************************************************************************************
*/
static  INT8U  KeyDecode (void)
{
   INT16U portvalue=KeyGetPort();
   INT8U ixcode;
   switch(portvalue>>4)
   	{
   	       case 1: ixcode=0; break;
		case 2: ixcode=4; break;
		case 4: ixcode=8; break;
		case 8: ixcode=12; break;
   	}
   switch ( portvalue&0x0F )
	{
		case 1: ixcode+=3; break;
		case 2: ixcode+=2; break;
		case 4: ixcode+=1; break;
	}
  return(ixcode);
}

/*
*********************************************************************************************************
*                                         FLUSH KEYBOARD BUFFER
*
* Description : This function clears the keyboard buffer
* Arguments   : none
* Returns     : none
*********************************************************************************************************
*/

void  KeyFlush (void)
{
    while (KeyHit()) {                           /* While there are keys in the buffer...              */
        KeyGetKey(0);                            /* ... extract the next key from the buffer           */
    }
}


/*
*********************************************************************************************************
*                                                 GET KEY
*
* Description : Get a keyboard scan code from the keyboard driver.
* Arguments   : 'to'     is the amount of time KeyGetKey() will wait (in number of ticks) for a key to be
*                        pressed.  A timeout of '0' means that the caller is willing to wait forever for
*                        a key to be pressed.
* Returns     : != 0xFF  is the key scan code of the key pressed
*               == 0xFF  indicates that there is no key in the buffer within the specified timeout
*********************************************************************************************************
*/

INT8U  KeyGetKey (INT16U to)
{
    INT8U code;
    INT8U err;

#if MULTITASK == 1
    xOSSemTake(KeySemPtr, to, &err);              /* Wait for a key to be pressed                       */
#endif
    OS_ENTER_CRITICAL();                         /* Start of critical section of code, disable ints    */
    if (KeyNRead > 0) {                          /* See if we have keys in the buffer                  */
        KeyNRead--;                              /* Decrement the number of keys read                  */
        code = KeyBuf[KeyBufOutIx];              /* Get scan code from the buffer                      */
        KeyBufOutIx++;
        if (KeyBufOutIx >= KEY_BUF_SIZE) {       /* Adjust index into the keyboard buffer              */
            KeyBufOutIx = 0;
        }
        OS_EXIT_CRITICAL();                      /* End of critical section of code                    */
        return (code);                           /* Return the scan code of the key pressed            */
    } else {
        OS_EXIT_CRITICAL();                      /* End of critical section of code                    */
        return (0xFF);                           /* No scan codes in the buffer, return -1             */
    }
}

/*
*********************************************************************************************************
*                                  GET HOW LONG KEY HAS BEEN PRESSED
*
* Description : This function returns the amount of time the key has been pressed.
* Arguments   : none
* Returns     : key down time in 'milliseconds'
*********************************************************************************************************
*/

INT32U  KeyGetKeyDownTime (void)
{
    INT16U tmr;


    OS_ENTER_CRITICAL();
    tmr = KeyDownTmr;
    OS_EXIT_CRITICAL();
    return (tmr * KEY_SCAN_TASK_DLY);
}

/*
*********************************************************************************************************
*                                        SEE IF ANY KEY IN BUFFER
*
* Description : This function checks to see if a key was pressed
* Arguments   : none
* Returns     : TRUE   if a key has been pressed
*               FALSE  if no key pressed
*********************************************************************************************************
*/

BOOLEAN  KeyHit (void)
{
    BOOLEAN hit;


    OS_ENTER_CRITICAL();
    hit = (BOOLEAN)(KeyNRead > 0) ? TRUE : FALSE;
    OS_EXIT_CRITICAL();
    return (hit);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av福利精品导航| 国产婷婷色一区二区三区四区| 色综合激情久久| 大桥未久av一区二区三区中文| 国产精品影音先锋| 国内精品不卡在线| 国产一区二区三区香蕉| 国产精品一区一区| 国产成人综合在线观看| 成人污视频在线观看| 不卡一区二区在线| 91日韩在线专区| 91精品福利在线| 欧美精品久久99久久在免费线| 91 com成人网| 精品久久久久久最新网址| 精品久久人人做人人爰| 国产欧美日韩在线观看| 国产精品国产三级国产aⅴ入口| 日韩毛片在线免费观看| 夜夜嗨av一区二区三区网页| 亚洲视频在线观看一区| 亚洲一区二区成人在线观看| 亚洲超碰97人人做人人爱| 麻豆中文一区二区| 国产精品一区二区三区乱码| 成人精品gif动图一区| 91小视频在线观看| 欧美日韩一区二区在线观看视频 | 国产精品资源站在线| 国产精品资源在线看| gogogo免费视频观看亚洲一| 色婷婷综合久色| 91麻豆精品国产综合久久久久久| 欧美一区二区三区的| 日韩免费高清视频| 亚洲国产精品激情在线观看| 亚洲最大的成人av| 美洲天堂一区二卡三卡四卡视频| 韩日欧美一区二区三区| 99久久伊人久久99| 在线不卡一区二区| 国产午夜精品久久久久久久| 一区二区免费在线播放| 国产一区二区主播在线| 99re在线精品| 日韩精品中文字幕在线不卡尤物| 国产精品久久久久久久岛一牛影视| 亚洲一区二区不卡免费| 国产在线麻豆精品观看| 日本韩国一区二区| 精品国产凹凸成av人导航| 亚洲天天做日日做天天谢日日欢| 99在线精品一区二区三区| 欧美一级片在线观看| 国产精品久久一级| 日本视频中文字幕一区二区三区| 国产91高潮流白浆在线麻豆| 欧亚一区二区三区| 国产人妖乱国产精品人妖| 亚洲国产欧美在线| 国产成人精品一区二区三区网站观看| 欧美日韩国产影片| 国产精品视频一二三区| 日韩成人一级片| 99re在线精品| 亚洲国产精品传媒在线观看| 日韩精品视频网| 色婷婷综合久色| 国产精品午夜电影| 卡一卡二国产精品| 欧美性一二三区| 中文字幕一区二区三区四区 | 国产99久久久精品| 欧美一区二区三区影视| 一区二区在线观看不卡| 狠狠色丁香久久婷婷综| 制服丝袜激情欧洲亚洲| 亚洲欧美激情小说另类| 国产二区国产一区在线观看| 欧美一区二区不卡视频| 亚洲一卡二卡三卡四卡无卡久久| 国v精品久久久网| 久久综合久久综合久久综合| 日韩经典一区二区| 欧美日韩一级二级三级| 亚洲欧美日韩精品久久久久| 国产99一区视频免费 | 日韩经典中文字幕一区| 欧美伊人久久久久久久久影院| 欧美国产1区2区| 国产精华液一区二区三区| 日韩一区和二区| 日日夜夜精品免费视频| 欧洲激情一区二区| 亚洲综合在线免费观看| 91网站在线播放| 亚洲色欲色欲www| 91亚洲精品乱码久久久久久蜜桃| 国产精品毛片高清在线完整版| 国产成人av一区二区三区在线| 亚洲国产精品久久不卡毛片| 欧美亚日韩国产aⅴ精品中极品| 亚洲精品国产视频| 色8久久人人97超碰香蕉987| 椎名由奈av一区二区三区| 91美女在线观看| 亚洲色图制服诱惑| 99国产精品久久久久| 中文字幕一区二区三区色视频| 99热精品国产| 一区二区三区美女| 欧美日韩夫妻久久| 日韩一区欧美二区| 精品久久久久久亚洲综合网| 国产专区欧美精品| 亚洲国产精品传媒在线观看| av电影在线不卡| 亚洲最新视频在线播放| 欧美高清www午色夜在线视频| 日韩不卡手机在线v区| 精品区一区二区| 国产精品18久久久久久久网站| 久久久亚洲国产美女国产盗摄| 成人免费高清在线观看| 亚洲欧美色综合| 欧美电影一区二区三区| 美女视频免费一区| 亚洲精品一区二区三区福利| 国产成人午夜片在线观看高清观看| 欧美激情中文字幕| 91麻豆精品秘密| 午夜精品一区二区三区电影天堂| 日韩女优电影在线观看| 国产成人免费在线视频| 亚洲欧美激情一区二区| 在线综合+亚洲+欧美中文字幕| 国产伦精品一区二区三区免费 | 激情综合色播五月| 中文字幕在线一区二区三区| 欧美日韩电影一区| 韩国一区二区三区| 日韩毛片视频在线看| 欧美日韩久久久| 国产高清亚洲一区| 一区二区三区在线播放| 日韩免费在线观看| 91麻豆免费观看| 老司机一区二区| 亚洲欧美激情插| 日韩精品资源二区在线| www.日韩在线| 婷婷国产v国产偷v亚洲高清| 久久久国际精品| 欧美特级限制片免费在线观看| 九九精品视频在线看| 一区二区三区中文字幕精品精品| 欧美一级生活片| 色综合久久久网| 九九久久精品视频| 亚洲午夜在线电影| 中文字幕免费一区| 日韩一卡二卡三卡| 99视频一区二区三区| 欧美日韩国产在线播放网站| 国产宾馆实践打屁股91| 三级久久三级久久| 国产精品国产三级国产a| 91精品在线麻豆| 色综合天天综合| 激情五月婷婷综合网| 亚洲aaa精品| 亚洲欧美福利一区二区| 精品国产精品网麻豆系列| 日本韩国一区二区三区视频| 国产高清精品网站| 日本亚洲一区二区| 亚洲自拍偷拍麻豆| 国产精品入口麻豆九色| 日韩免费高清av| 欧美系列日韩一区| 成人av高清在线| 国产高清久久久| 国产专区欧美精品| 欧美96一区二区免费视频| 亚洲一区二三区| 日韩一区欧美一区| 国产日韩欧美一区二区三区综合| 7777精品伊人久久久大香线蕉完整版| 99国产精品久| zzijzzij亚洲日本少妇熟睡| 国产伦精品一区二区三区视频青涩 | 天天做天天摸天天爽国产一区 | 亚洲1区2区3区4区| 一区二区在线观看免费视频播放| 国产精品国产a| 国产嫩草影院久久久久| 久久久av毛片精品| 2020国产精品| www欧美成人18+|