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

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

?? pc.c

?? Software中是uCOS操作系統(tǒng)及書中例題的代碼。
?? C
?? 第 1 頁 / 共 2 頁
字號:
    
    PC_VectSet(VECT_DOS_CHAIN, PC_TickISR);                /* Store MS-DOS's tick to chain             */
    
    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             */
        OS_EXIT_CRITICAL();
        PC_VectSet(VECT_TICK, PC_TickISR);                 /* Restore DOS's tick vector                */
        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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    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)((INT32U)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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    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))
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    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精品国产色综合久久不卡蜜臀| 亚洲视频免费在线| 在线一区二区视频| 亚洲成av人影院在线观看网| 欧美少妇bbb| 麻豆91精品视频| 精品少妇一区二区三区在线视频| 国内外成人在线| 日本一区二区三区四区| 9色porny自拍视频一区二区| 综合激情网...| 精品视频在线看| 看片的网站亚洲| 国产精品乱人伦中文| 欧美一区二区高清| 最新中文字幕一区二区三区 | 国产视频一区不卡| 95精品视频在线| 五月激情丁香一区二区三区| 精品欧美久久久| 色综合一个色综合| 免费人成黄页网站在线一区二区| 欧美精品一区二区在线播放| 99久久精品国产毛片| 亚洲一区二区三区四区五区中文 | 在线看日韩精品电影| 日日夜夜精品视频免费| 国产亲近乱来精品视频| 91国偷自产一区二区开放时间| 丝袜美腿高跟呻吟高潮一区| 久久免费偷拍视频| 欧美日韩免费观看一区二区三区 | 国产精品久久99| 91精品国产91综合久久蜜臀| 国产成人av电影在线观看| 亚洲国产成人av| 国产视频一区二区在线| 在线91免费看| 一本一道综合狠狠老| 韩国成人福利片在线播放| 一区av在线播放| 国产精品天美传媒沈樵| 91精品国产aⅴ一区二区| av在线综合网| 国产美女一区二区三区| 亚洲高清中文字幕| 国产精品福利av| 久久久久久久久久久黄色| 欧美色视频在线观看| 成人深夜视频在线观看| 精品午夜久久福利影院| 午夜成人在线视频| 亚洲男帅同性gay1069| 久久亚洲春色中文字幕久久久| 欧美日韩久久久久久| 91小视频免费观看| 岛国一区二区在线观看| 美国一区二区三区在线播放| 亚洲第一成人在线| 亚洲欧洲一区二区在线播放| 26uuu精品一区二区在线观看| 5858s免费视频成人| 欧美体内she精高潮| 色94色欧美sute亚洲线路二| 欧美三级在线看| 91老司机福利 在线| 不卡的电视剧免费网站有什么| 国内成+人亚洲+欧美+综合在线 | 亚洲精选一二三| 亚洲人成精品久久久久| 国产精品少妇自拍| 久久综合色8888| 欧美草草影院在线视频| 91精品欧美福利在线观看| 欧美色网一区二区| 欧美日韩国产综合一区二区三区 | 91啪亚洲精品| 色综合天天综合网国产成人综合天| 成人免费高清视频在线观看| 成人动漫视频在线| 97se狠狠狠综合亚洲狠狠| 91麻豆福利精品推荐| 在线免费观看日本欧美| 欧美三级电影在线观看| 欧美人成免费网站| 日韩一区二区三区高清免费看看| 欧美一区二区精品在线| 日韩色视频在线观看| 久久综合中文字幕| 日本一区二区三区国色天香 | 亚洲成人免费av| 亚洲电影欧美电影有声小说| 全国精品久久少妇| 九九久久精品视频 | jvid福利写真一区二区三区| 91在线观看成人| 欧美性极品少妇| 制服.丝袜.亚洲.中文.综合| 日韩欧美精品三级| 中文字幕乱码日本亚洲一区二区| 国产精品私人影院| 亚洲va天堂va国产va久| 久久不见久久见免费视频1| 国产精品自产自拍| 在线亚洲一区二区| 91精品国产丝袜白色高跟鞋| 精品国产一区二区三区四区四| 国产清纯白嫩初高生在线观看91| 国产精品传媒视频| 日韩中文字幕麻豆| 国产不卡视频在线观看| 色婷婷久久久久swag精品| 在线成人小视频| 国产女人aaa级久久久级| 一区二区三区在线免费观看| 另类欧美日韩国产在线| 国产91色综合久久免费分享| 欧美性受极品xxxx喷水| 久久综合给合久久狠狠狠97色69| 成人免费一区二区三区视频| 日本欧美久久久久免费播放网| 国模冰冰炮一区二区| 91久久香蕉国产日韩欧美9色| 精品欧美一区二区久久| 亚洲精品久久久久久国产精华液| 九九**精品视频免费播放| 91老司机福利 在线| 精品国产乱码91久久久久久网站| 国产精品久久久久影视| 视频在线观看国产精品| gogo大胆日本视频一区| 日韩丝袜美女视频| 亚洲一区二区不卡免费| 国产另类ts人妖一区二区| 欧美日韩在线播| 国产精品久久久久精k8| 黄页网站大全一区二区| 欧美日韩在线观看一区二区 | 久草中文综合在线| 欧美亚洲国产bt| 亚洲欧洲一区二区在线播放| 国产乱码字幕精品高清av| 欧美日韩另类一区| 亚洲综合一区二区精品导航| 成人av在线观| 国产婷婷色一区二区三区在线| 日本亚洲电影天堂| 欧美少妇一区二区| 亚洲精品国产一区二区精华液| 国产福利精品导航| 日韩精品最新网址| 免费精品视频在线| 666欧美在线视频| 性感美女久久精品| 精品视频免费看| 亚洲尤物在线视频观看| 色美美综合视频| 日韩美女视频19| 99精品国产99久久久久久白柏| 国产精品青草综合久久久久99| 经典三级一区二区| 精品久久久网站| 韩国成人在线视频| 欧美精品一区二区三区蜜桃视频| 蜜桃免费网站一区二区三区| 7777精品久久久大香线蕉| 亚洲大片在线观看| 欧美日韩激情在线| 亚洲成av人片一区二区梦乃 | 欧美成人三级在线| 久久99精品久久久久| 2022国产精品视频| 风间由美中文字幕在线看视频国产欧美 | 亚洲成年人影院| 欧美一区二区在线视频| 蜜臀av性久久久久蜜臀av麻豆| 欧美成人伊人久久综合网| 激情av综合网| 国产精品短视频| 欧美日韩亚洲综合一区| 日本在线不卡视频一二三区| 日韩一区二区电影网| 激情综合五月天| 国产精品嫩草影院com| 99久久久精品| 香蕉乱码成人久久天堂爱免费| 欧美一区二区在线看| 国产永久精品大片wwwapp | 亚洲色图在线视频| 欧美三级视频在线播放| 男男视频亚洲欧美| 国产日产欧美一区二区三区| 一本大道久久a久久精品综合| 亚洲国产毛片aaaaa无费看| 日韩亚洲欧美成人一区| 国产成人综合自拍| 一区二区在线看| 欧美成人精品3d动漫h|