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

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

?? pc.c

?? uC_OS_II_外圍接口程序源代碼.rar
?? C
?? 第 1 頁 / 共 2 頁
字號:
{
    PC_ExitFlag  = FALSE;                                  /* Indicate that we are not exiting yet!    */
    OSTickDOSCtr =     1;                                  /* Initialize the DOS tick counter          */
    PC_TickISR   = PC_VectGet(VECT_TICK);                  /* Get MS-DOS's tick vector                 */
    
    OS_ENTER_CRITICAL();
    PC_VectSet(VECT_DOS_CHAIN, PC_TickISR);                /* Store MS-DOS's tick to chain             */
    OS_EXIT_CRITICAL();
    
    setjmp(PC_JumpBuf);                                    /* Capture where we are in DOS              */
    if (PC_ExitFlag == TRUE) {                             /* See if we are exiting back to DOS        */
        OS_ENTER_CRITICAL();
        PC_SetTickRate(18);                                /* Restore tick rate to 18.2 Hz             */
        PC_VectSet(VECT_TICK, PC_TickISR);                 /* Restore DOS's tick vector                */
        OS_EXIT_CRITICAL();
        PC_DispClrScr(DISP_FGND_WHITE + DISP_BGND_BLACK);  /* Clear the display                        */
        exit(0);                                           /* Return to DOS                            */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                       ELAPSED TIME INITIALIZATION
*
* Description : This function initialize the elapsed time module by determining how long the START and
*               STOP functions take to execute.  In other words, this function calibrates this module
*               to account for the processing time of the START and STOP functions.
*
* Arguments   : None.
*
* Returns     : None.
*********************************************************************************************************
*/
void PC_ElapsedInit(void)
{
    PC_ElapsedOverhead = 0;
    PC_ElapsedStart();
    PC_ElapsedOverhead = PC_ElapsedStop();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                         INITIALIZE PC'S TIMER #2
*
* Description : This function initialize the PC's Timer #2 to be used to measure the time between events.
*               Timer #2 will be running when the function returns.
*
* Arguments   : None.
*
* Returns     : None.
*********************************************************************************************************
*/
void PC_ElapsedStart(void)
{
    INT8U  data;


    OS_ENTER_CRITICAL();
    data  = (INT8U)inp(0x61);                              /* Disable timer #2                         */
    data &= 0xFE;
    outp(0x61, data);
    outp(TICK_T0_8254_CWR,  TICK_T0_8254_CTR2_MODE0);      /* Program timer #2 for Mode 0              */
    outp(TICK_T0_8254_CTR2, 0xFF);
    outp(TICK_T0_8254_CTR2, 0xFF);
    data |= 0x01;                                          /* Start the timer                          */
    outp(0x61, data);
    OS_EXIT_CRITICAL();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                 STOP THE PC'S TIMER #2 AND GET ELAPSED TIME
*
* Description : This function stops the PC's Timer #2, obtains the elapsed counts from when it was
*               started and converts the elapsed counts to micro-seconds.
*
* Arguments   : None.
*
* Returns     : The number of micro-seconds since the timer was last started.
*
* Notes       : - The returned time accounts for the processing time of the START and STOP functions.
*               - 54926 represents 54926S-16 or, 0.838097 which is used to convert timer counts to
*                 micro-seconds.  The clock source for the PC's timer #2 is 1.19318 MHz (or 0.838097 uS)
*********************************************************************************************************
*/
INT16U PC_ElapsedStop(void)
{
    INT8U   data;
    INT8U   low;
    INT8U   high;
    INT16U  cnts;


    OS_ENTER_CRITICAL();
    data  = (INT8U)inp(0x61);                                    /* Disable the timer                  */
    data &= 0xFE;
    outp(0x61, data);
    outp(TICK_T0_8254_CWR, TICK_T0_8254_CTR2_LATCH);             /* Latch the timer value              */
    low  = inp(TICK_T0_8254_CTR2);
    high = inp(TICK_T0_8254_CTR2);
    cnts = (INT16U)0xFFFF - (((INT16U)high << 8) + (INT16U)low); /* Compute time it took for operation */
    OS_EXIT_CRITICAL();
    return ((INT16U)((ULONG)cnts * 54926L >> 16) - PC_ElapsedOverhead);
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                       GET THE CURRENT DATE AND TIME
*
* Description: This function obtains the current date and time from the PC.
*
* Arguments  : s     is a pointer to where the ASCII string of the current date and time will be stored.
*                    You must allocate at least 21 bytes (includes the NUL) of storage in the return 
*                    string.  The date and time will be formatted as follows:
*
*                        "YYYY-MM-DD  HH:MM:SS"
*
* Returns    : none
*********************************************************************************************************
*/
void PC_GetDateTime (char *s)
{
    struct time now;
    struct date today;


    gettime(&now);
    getdate(&today);
    sprintf(s, "%04d-%02d-%02d  %02d:%02d:%02d",
               today.da_year,
               today.da_mon,
               today.da_day,
               now.ti_hour,
               now.ti_min,
               now.ti_sec);
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        CHECK AND GET KEYBOARD KEY
*
* Description: This function checks to see if a key has been pressed at the keyboard and returns TRUE if
*              so.  Also, if a key is pressed, the key is read and copied where the argument is pointing
*              to.
*
* Arguments  : c     is a pointer to where the read key will be stored.
*
* Returns    : TRUE  if a key was pressed
*              FALSE otherwise
*********************************************************************************************************
*/
BOOLEAN PC_GetKey (INT16S *c)
{
    if (kbhit()) {                                         /* See if a key has been pressed            */
        *c = (INT16S)getch();                              /* Get key pressed                          */
        return (TRUE);
    } else {
        *c = 0x00;                                         /* No key pressed                           */
        return (FALSE);
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                      SET THE PC'S TICK FREQUENCY
*
* Description: This function is called to change the tick rate of a PC.
*
* Arguments  : freq      is the desired frequency of the ticker (in Hz)
*
* Returns    : none
*
* Notes      : 1) The magic number 2386360 is actually twice the input frequency of the 8254 chip which
*                 is always 1.193180 MHz.
*              2) The equation computes the counts needed to load into the 8254.  The strange equation
*                 is actually used to round the number using integer arithmetic.  This is equivalent to
*                 the floating point equation:
*
*                             1193180.0 Hz
*                     count = ------------ + 0.5
*                                 freq
*********************************************************************************************************
*/
void PC_SetTickRate (INT16U freq)
{
    INT16U  count;


    if (freq == 18) {                            /* See if we need to restore the DOS frequency        */
        count = 0;
    } else if (freq > 0) {                        
                                                 /* Compute 8254 counts for desired frequency and ...  */
                                                 /* ... round to nearest count                         */
        count = (INT16U)(((INT32U)2386360L / freq + 1) >> 1); 
    } else {
        count = 0;
    }
    OS_ENTER_CRITICAL();
    outp(TICK_T0_8254_CWR,  TICK_T0_8254_CTR0_MODE3); /* Load the 8254 with desired frequency          */  
    outp(TICK_T0_8254_CTR0, count & 0xFF);            /* Low  byte                                     */
    outp(TICK_T0_8254_CTR0, (count >> 8) & 0xFF);     /* High byte                                     */
    OS_EXIT_CRITICAL();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        OBTAIN INTERRUPT VECTOR
*
* Description: This function reads the pointer stored at the specified vector.
*
* Arguments  : vect  is the desired interrupt vector number, a number between 0 and 255.
*
* Returns    : The address of the Interrupt handler stored at the desired vector location.
*********************************************************************************************************
*/
void *PC_VectGet (INT8U vect)
{
    INT16U    *pvect;
    INT16U     off;
    INT16U     seg;
    
    
    pvect = (INT16U *)MK_FP(0x0000, vect * 4);        /* Point into IVT at desired vector location     */
    OS_ENTER_CRITICAL();
    off   = *pvect++;                                 /* Obtain the vector's OFFSET                    */
    seg   = *pvect;                                   /* Obtain the vector's SEGMENT                   */
    OS_EXIT_CRITICAL();
    return (MK_FP(seg, off));
}

/*
*********************************************************************************************************
*                                        INSTALL INTERRUPT VECTOR
*
* Description: This function sets an interrupt vector in the interrupt vector table.
*
* Arguments  : vect  is the desired interrupt vector number, a number between 0 and 255.
*              isr   is a pointer to a function to execute when the interrupt or exception occurs.
*
* Returns    : none
*********************************************************************************************************
*/
void PC_VectSet (INT8U vect, void (*isr)(void))
{
    INT16U  *pvect;
    
    
    pvect    = (INT16U *)MK_FP(0x0000, vect * 4);     /* Point into IVT at desired vector location     */
    OS_ENTER_CRITICAL();
    *pvect++ = (INT16U)FP_OFF(isr);                   /* Store ISR offset                              */
    *pvect   = (INT16U)FP_SEG(isr);                   /* Store ISR segment                             */
    OS_EXIT_CRITICAL();
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美亚洲国产另类| 亚洲一区在线观看视频| 欧美成人福利视频| 欧美剧情片在线观看| 91久久一区二区| 91丨porny丨中文| 不卡av在线网| 不卡电影一区二区三区| 成人av资源在线| 成人高清视频在线观看| 成av人片一区二区| 99国产精品久| 91美女视频网站| 色婷婷国产精品久久包臀| 色婷婷av一区二区| 欧美男女性生活在线直播观看| 日本丶国产丶欧美色综合| 在线视频你懂得一区| 一本一本大道香蕉久在线精品| 99精品久久久久久| 在线欧美一区二区| 欧美人妖巨大在线| 在线成人免费视频| 日韩女同互慰一区二区| 久久亚洲精品小早川怜子| 久久在线观看免费| 国产女人水真多18毛片18精品视频| 久久综合久久综合久久| 国产欧美日韩综合| 日韩伦理免费电影| 亚洲一卡二卡三卡四卡| 日本aⅴ亚洲精品中文乱码| 国产中文字幕一区| 成人激情小说网站| 在线观看一区日韩| 日韩一区二区三区观看| 久久久不卡网国产精品一区| 日本一区二区三区在线不卡 | 亚洲欧美区自拍先锋| 亚洲综合激情另类小说区| 日韩综合在线视频| 国产精品一品二品| 色婷婷av一区二区三区大白胸 | 亚洲免费观看高清完整| 亚洲国产日韩a在线播放| 免费成人美女在线观看.| 国产99精品在线观看| 欧美性色黄大片手机版| 精品国产百合女同互慰| 亚洲视频1区2区| 日本视频在线一区| 成人短视频下载| 欧美日韩高清一区二区| 久久久久久久av麻豆果冻| 亚洲欧美欧美一区二区三区| 日本美女一区二区三区视频| 国产福利电影一区二区三区| 在线区一区二视频| 久久久久久久综合狠狠综合| 亚洲免费观看高清| 国产精品18久久久久久久网站| 91色在线porny| 日韩美女视频在线| 夜色激情一区二区| 国产一区二区女| 欧美色视频一区| 国产欧美精品日韩区二区麻豆天美| 午夜视频一区在线观看| 北条麻妃国产九九精品视频| 日韩亚洲欧美在线| 亚洲激情网站免费观看| 国产成人综合在线播放| 欧美日本在线看| 亚洲欧洲韩国日本视频| 狠狠色综合日日| 在线不卡免费欧美| 自拍av一区二区三区| 国产一区二区0| 欧美乱妇20p| 一区二区三国产精华液| 国产精品一卡二| 日韩午夜小视频| 亚洲综合精品自拍| 91美女视频网站| 国产精品久久久久久户外露出| 国内国产精品久久| 精品视频全国免费看| 日韩理论在线观看| 成人性生交大片免费看视频在线| 日韩欧美亚洲一区二区| 日韩影视精彩在线| 欧美无人高清视频在线观看| 亚洲欧洲综合另类在线| 丁香天五香天堂综合| 久久综合久色欧美综合狠狠| 麻豆国产精品一区二区三区| 欧美精品一二三区| 亚洲电影一区二区三区| 色综合久久66| 亚洲卡通欧美制服中文| 成人app网站| 国产精品美女一区二区三区 | 国产精品久久久久久久久果冻传媒| 国产一区二区三区四| 久久综合久色欧美综合狠狠| 美女视频黄a大片欧美| 欧美伦理电影网| 婷婷夜色潮精品综合在线| 欧美日韩一级二级| 午夜伦理一区二区| 在线播放/欧美激情| 日韩中文字幕麻豆| 欧美一区二区在线不卡| 免费精品视频在线| 精品日产卡一卡二卡麻豆| 美腿丝袜亚洲综合| 精品国产123| 国产传媒欧美日韩成人| 国产精品天天看| jizz一区二区| 亚洲蜜臀av乱码久久精品| 91久久精品一区二区二区| 一区二区三区 在线观看视频| 欧美亚洲国产bt| 婷婷久久综合九色综合伊人色| 5858s免费视频成人| 欧美a级理论片| 亚洲精品一线二线三线| 国产jizzjizz一区二区| 亚洲同性gay激情无套| 欧日韩精品视频| 日本视频中文字幕一区二区三区| 欧美成人精品高清在线播放| 国产老肥熟一区二区三区| 亚洲国产精品99久久久久久久久| 99久久精品情趣| 天堂成人免费av电影一区| 日韩精品一区在线| 国产成人免费xxxxxxxx| 亚洲女人的天堂| 欧美一区午夜视频在线观看| 国产麻豆日韩欧美久久| 国产欧美视频一区二区| 欧美艳星brazzers| 久久99精品久久久久久久久久久久| 国产午夜精品久久| 色吊一区二区三区| 美腿丝袜一区二区三区| 国产精品久久久久久亚洲毛片| 91成人在线观看喷潮| 久久精品久久精品| 中文字幕一区二区三区蜜月| 欧美日韩国产美女| 国产精品亚洲第一区在线暖暖韩国| 中文字幕一区在线观看视频| 欧美精品18+| 成人黄色小视频在线观看| 亚洲h动漫在线| 国产亚洲精品bt天堂精选| 欧美性大战久久| 国产激情偷乱视频一区二区三区| 亚洲精选视频免费看| 日韩欧美中文一区| 97se亚洲国产综合自在线观| 日韩精品乱码av一区二区| 国产精品色婷婷| 日韩一级黄色大片| 在线一区二区视频| 国产成人精品午夜视频免费| 亚洲成在人线在线播放| 中文字幕日本不卡| 日韩精品最新网址| 在线免费精品视频| 成人一区二区三区视频在线观看| 亚洲第一精品在线| 亚洲日本va在线观看| 精品日韩在线观看| 欧美精品在欧美一区二区少妇| 懂色av中文一区二区三区 | 精品一区二区三区在线播放视频 | 日本午夜精品一区二区三区电影 | 日本欧美在线看| 亚洲女人的天堂| 欧美国产日本韩| 日韩一级免费观看| 欧美日本免费一区二区三区| 9i在线看片成人免费| 国产麻豆欧美日韩一区| 久久精品国产在热久久| 午夜欧美一区二区三区在线播放| 国产精品污www在线观看| 欧美成人精品3d动漫h| 7878成人国产在线观看| 欧洲一区二区三区在线| 99re热视频这里只精品| 成人激情综合网站| 成人一区二区三区在线观看 | 欧美日韩激情一区二区三区| 91在线你懂得| jlzzjlzz欧美大全|