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

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

?? pc.c

?? 這個就是所謂ucos的33個例子
?? 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一区二区三区免费野_久草精品视频
久久久九九九九| 国产精品久久久久久久第一福利| 国产成人av一区| 亚洲一区二区在线观看视频| 精品成人一区二区三区四区| 日本道在线观看一区二区| 国产盗摄女厕一区二区三区| 视频一区二区三区中文字幕| 亚洲丝袜另类动漫二区| 精品处破学生在线二十三| 欧美精品在线一区二区三区| 91免费观看在线| 国产一区二区调教| 日本91福利区| 亚洲小说春色综合另类电影| 最新不卡av在线| 2020国产精品自拍| 日韩精品专区在线影院观看| 欧美午夜片在线观看| 北条麻妃一区二区三区| 精品一区二区三区香蕉蜜桃 | 91在线无精精品入口| 九九国产精品视频| 日本vs亚洲vs韩国一区三区二区| 亚洲精品乱码久久久久久日本蜜臀| 国产欧美一区二区在线观看| 欧美电视剧免费全集观看| 欧美精品第一页| 欧美午夜精品久久久| 5566中文字幕一区二区电影| 在线观看亚洲专区| 91久久精品日日躁夜夜躁欧美| 成人精品鲁一区一区二区| 国产精品综合视频| 国产精选一区二区三区| 极品瑜伽女神91| 精品无人区卡一卡二卡三乱码免费卡| 亚洲成人一二三| 亚洲 欧美综合在线网络| 亚洲综合色噜噜狠狠| 亚洲国产日韩综合久久精品| 亚洲精品视频观看| 一区二区三区鲁丝不卡| 亚洲与欧洲av电影| 无吗不卡中文字幕| 免费在线观看成人| 韩国精品主播一区二区在线观看 | 5858s免费视频成人| 欧美日韩国产一二三| 欧美夫妻性生活| 日韩精品一区二区三区蜜臀| 久久久亚洲精品石原莉奈 | 五月天一区二区三区| 午夜av一区二区三区| 蜜臀久久久99精品久久久久久| 美女视频黄 久久| 激情都市一区二区| 国产成人免费高清| 一本到不卡精品视频在线观看| 欧美在线视频不卡| 欧美日韩精品一区二区三区四区| 一区二区三区中文在线| 天天综合天天综合色| 美女性感视频久久| 国产成人免费视频| 色婷婷国产精品| 欧美一区二区三区四区久久 | 久久夜色精品国产噜噜av| 久久久99精品免费观看不卡| 中文字幕亚洲欧美在线不卡| 亚洲最新在线观看| 青青草伊人久久| 成人免费黄色在线| 在线精品国精品国产尤物884a| 日韩一区二区三区高清免费看看| 国产欧美综合色| 亚洲成人在线免费| 国产91精品精华液一区二区三区| 欧美专区日韩专区| 久久青草欧美一区二区三区| 日韩毛片视频在线看| 日韩av电影天堂| 成人黄色av网站在线| 欧美日韩日日骚| 国产视频一区在线观看| 亚洲国产精品精华液网站| 国产美女精品一区二区三区| 91色乱码一区二区三区| 欧美精品一区二区在线观看| 亚洲欧美另类久久久精品2019| 日韩电影在线一区| 99re这里都是精品| 精品久久一区二区三区| 亚洲精品成人天堂一二三| 国内偷窥港台综合视频在线播放| 欧美影院一区二区| 国产三级一区二区| 香蕉成人啪国产精品视频综合网| 粉嫩13p一区二区三区| 欧美夫妻性生活| 亚洲三级免费观看| 国产一区在线视频| 911精品国产一区二区在线| 中文字幕亚洲欧美在线不卡| 国产永久精品大片wwwapp| 欧美高清精品3d| 亚洲视频在线一区| 国产精品99久久久| 欧美白人最猛性xxxxx69交| 亚洲国产精品久久人人爱蜜臀| 97久久超碰国产精品电影| 久久综合久色欧美综合狠狠| 日韩电影在线观看网站| 欧美撒尿777hd撒尿| 亚洲码国产岛国毛片在线| 国产成人在线视频免费播放| 欧美一区二区三区性视频| 夜色激情一区二区| 色婷婷精品久久二区二区蜜臂av | 亚洲人吸女人奶水| 成人看片黄a免费看在线| 久久久精品黄色| 激情成人综合网| 精品第一国产综合精品aⅴ| 蜜臀精品一区二区三区在线观看| 欧美天堂一区二区三区| 最新欧美精品一区二区三区| 国产成人av一区| 国产亚洲成aⅴ人片在线观看| 狠狠色丁香久久婷婷综| 日韩欧美一区二区免费| 热久久一区二区| 久久久久久久久久电影| 日韩高清国产一区在线| 欧美军同video69gay| 天堂一区二区在线免费观看| 777奇米成人网| 日本不卡免费在线视频| 欧美成人精品1314www| 久久黄色级2电影| 久久久不卡网国产精品二区| 国产一区二区不卡在线| 中文幕一区二区三区久久蜜桃| 国产69精品久久99不卡| 亚洲视频一二三| 在线中文字幕一区| 香蕉久久夜色精品国产使用方法| 欧美日韩午夜在线视频| 日日夜夜一区二区| 日韩情涩欧美日韩视频| 国内精品第一页| 久久久精品中文字幕麻豆发布| 高清免费成人av| 中文字幕一区二区三区蜜月| 色综合色狠狠综合色| 亚洲国产精品久久人人爱| 欧美夫妻性生活| 国产一区二区三区免费在线观看| 欧美激情自拍偷拍| 99综合电影在线视频| 一区二区三区不卡在线观看| 555www色欧美视频| 国产成人自拍高清视频在线免费播放| 国产精品美女视频| 欧美三级电影在线观看| 国产呦精品一区二区三区网站| 国产精品久久久久久久久快鸭| 欧美亚洲免费在线一区| 蜜桃免费网站一区二区三区| 国产欧美中文在线| 欧美午夜一区二区三区 | 色综合久久天天综合网| 午夜欧美在线一二页| 精品国产人成亚洲区| 成人免费观看男女羞羞视频| 亚洲一区在线观看免费| 精品成人a区在线观看| 91在线视频播放| 日日摸夜夜添夜夜添国产精品 | 国产成人免费网站| 亚洲第一成年网| 久久嫩草精品久久久精品一| 91成人在线精品| 九九国产精品视频| 一区二区三区国产精品| 久久久久久久久99精品| 欧美性受xxxx| 成人黄色网址在线观看| 日本免费新一区视频| 18欧美乱大交hd1984| 日韩一级片网站| 色呦呦国产精品| 国模大尺度一区二区三区| 亚洲资源中文字幕| 国产精品素人一区二区| 日韩欧美国产不卡| 欧美撒尿777hd撒尿| 91美女在线看| 国产91丝袜在线观看| 久久99精品久久久久久|