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

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

?? pc.c

?? UCOS2.52.rar
?? 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();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看日韩毛片| 奇米一区二区三区| 99精品欧美一区二区三区小说 | 国产精品国产三级国产aⅴ无密码| 韩国理伦片一区二区三区在线播放 | 综合婷婷亚洲小说| 在线视频中文字幕一区二区| 亚洲第一综合色| 91精品国产综合久久香蕉麻豆| 免费av成人在线| 久久精品一区八戒影视| 不卡影院免费观看| 亚洲综合免费观看高清在线观看| 69精品人人人人| 日本不卡一二三| 国产欧美日韩三级| 欧洲在线/亚洲| 久久精品国产99国产| 中文字幕+乱码+中文字幕一区| 色婷婷综合激情| 欧美a一区二区| 欧美国产日韩a欧美在线观看| 一本到一区二区三区| 免费观看30秒视频久久| 日本一区二区三区在线观看| 欧美网站大全在线观看| 国产毛片一区二区| 亚洲精选一二三| 欧美成人免费网站| www.日韩精品| 久久综合综合久久综合| 国产精品不卡一区| 4438成人网| 99精品黄色片免费大全| 蜜臀av国产精品久久久久| 国产精品福利一区二区三区| 91精品国产综合久久精品app | 97久久久精品综合88久久| 日本不卡一二三| 亚洲视频1区2区| 精品日产卡一卡二卡麻豆| 色婷婷综合久久久中文一区二区| 九色综合国产一区二区三区| 亚洲一卡二卡三卡四卡| 欧美激情综合在线| 日韩视频一区二区三区在线播放| 91在线一区二区三区| 久久精品国内一区二区三区| 一区二区三区精品在线观看| 国产亚洲综合在线| 欧美日韩精品欧美日韩精品一综合| 福利电影一区二区| 欧美bbbbb| 午夜久久久久久久久| 亚洲视频免费观看| 久久精品人人做人人爽人人| 91精品国产高清一区二区三区蜜臀 | 亚洲少妇最新在线视频| 久久久久久久久久久久电影 | 亚洲男人的天堂一区二区| 欧美精品一区二区三区在线 | 在线影院国内精品| 国产99精品国产| 久久精品国产久精国产| 性做久久久久久久免费看| 亚洲精品视频观看| 国产精品免费aⅴ片在线观看| 久久综合av免费| 精品久久久久久久久久久久包黑料 | 国产精品成人在线观看| 久久午夜老司机| www成人在线观看| 日韩欧美一级二级三级久久久| 666欧美在线视频| 在线播放日韩导航| 在线视频你懂得一区二区三区| 91麻豆视频网站| 91久久精品午夜一区二区| 91在线精品一区二区三区| av在线这里只有精品| eeuss鲁片一区二区三区 | 玉米视频成人免费看| 国产精品久久久久久亚洲毛片| 国产精品情趣视频| 国产精品热久久久久夜色精品三区| 亚洲国产成人一区二区三区| 国产精品黄色在线观看| 国产精品成人网| 亚洲免费视频成人| 一区二区三区在线免费| 亚洲精品成人在线| 亚洲一区二区三区在线播放| 午夜视频在线观看一区二区三区| 日韩成人精品在线| 久久福利资源站| 国产精品一二三四| 99re这里都是精品| 欧美视频在线一区| 日韩一区二区在线观看视频播放| 欧美大白屁股肥臀xxxxxx| 国产色91在线| 亚洲影视在线观看| 日本一区中文字幕| 国产91露脸合集magnet | 国产一区二区三区四区五区美女| 国产成人99久久亚洲综合精品| 91色porny在线视频| 欧美三级日韩三级| 精品成人一区二区三区| 国产精品欧美久久久久一区二区| 亚洲婷婷综合久久一本伊一区| 亚洲高清久久久| 精品一区二区三区视频在线观看| 国产一区二区伦理| 欧洲生活片亚洲生活在线观看| 日韩欧美视频在线| 国产精品久久久久影院亚瑟| 首页综合国产亚洲丝袜| 国产精品综合二区| 欧美三级资源在线| 久久精品亚洲精品国产欧美kt∨| 国产精品免费网站在线观看| 日韩精品91亚洲二区在线观看| 国产成人精品一区二区三区四区| 欧美日韩国产一区| 国产精品日韩成人| 国产成a人亚洲| 在线播放日韩导航| 日韩伦理电影网| 国产自产2019最新不卡| 色狠狠av一区二区三区| 国产亚洲人成网站| 青娱乐精品在线视频| 99久久国产综合精品女不卡| 欧美成人一区二区三区片免费| 亚洲一区二区三区四区五区黄| 国产999精品久久久久久绿帽| 欧美一级欧美一级在线播放| 亚洲乱码中文字幕| 高清国产一区二区| 欧美成人伊人久久综合网| 亚洲高清不卡在线观看| 丰满放荡岳乱妇91ww| 日韩欧美一二区| 午夜精品久久久久久久99水蜜桃| 99久久久久久| 国产欧美精品一区二区色综合 | 久久久不卡影院| 免费欧美在线视频| 在线一区二区三区四区| 中文字幕在线不卡一区二区三区 | 久久久久久久久久看片| 日韩高清不卡在线| 欧美色综合影院| 亚洲美女精品一区| 成人av综合一区| 国产人伦精品一区二区| 国内成人免费视频| 精品久久久久久久人人人人传媒| 人人精品人人爱| 欧美一区二区三区四区久久| 婷婷久久综合九色国产成人 | 欧美电影免费观看高清完整版在 | 一区二区三区久久| 91免费看片在线观看| 国产精品久久久久婷婷| 成人免费视频国产在线观看| 久久久久久久综合日本| 国产一区二区三区在线观看精品| 日韩亚洲欧美在线| 蜜臀99久久精品久久久久久软件| 日韩午夜激情视频| 奇米影视一区二区三区| 日韩一级免费观看| 精品写真视频在线观看| 亚洲精品在线免费播放| 国产一区二区不卡老阿姨| 久久久蜜臀国产一区二区| 国产精品综合一区二区| 国产精品无码永久免费888| 大胆欧美人体老妇| 亚洲人一二三区| 欧美性受xxxx黑人xyx性爽| 亚洲18女电影在线观看| 欧美一级欧美三级在线观看| 激情综合色综合久久| 国产情人综合久久777777| eeuss鲁片一区二区三区在线看| 亚洲精品久久久蜜桃| 欧美日韩精品高清| 美女视频网站久久| 国产欧美日本一区二区三区| 99riav久久精品riav| 天堂一区二区在线| 久久综合中文字幕| 91免费观看视频在线| 日韩和欧美一区二区三区| 久久一日本道色综合| 99国产精品久久久久| 三级欧美在线一区|