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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pc.c

?? uCosII 郵箱消息和任務管理
?? 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)((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)
{
#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一区二区三区免费野_久草精品视频
国产一区美女在线| 丝瓜av网站精品一区二区| 国产精品亚洲а∨天堂免在线| 日韩一区二区三区视频| 国产在线观看一区二区| 国产欧美日韩在线| 色呦呦国产精品| 亚洲va欧美va天堂v国产综合| 国产精品嫩草99a| 99精品国产99久久久久久白柏| 日韩美女精品在线| 欧美午夜一区二区三区免费大片| 午夜久久电影网| 欧美精品一区二区久久婷婷| 国产sm精品调教视频网站| 亚洲欧美经典视频| 91精品欧美久久久久久动漫 | av不卡一区二区三区| 亚洲精品中文在线观看| 欧美精品一级二级三级| 国产精品99久久久久久似苏梦涵 | 9191久久久久久久久久久| 久久国产欧美日韩精品| 中文字幕一区在线观看视频| 欧美伊人精品成人久久综合97| 免费成人在线影院| 中文字幕一区免费在线观看| 欧美日韩国产一级片| 国产白丝精品91爽爽久久 | 日韩一区有码在线| 欧美日韩国产中文| jlzzjlzz亚洲日本少妇| 麻豆91免费看| 亚洲欧美一区二区三区久本道91| 日韩精品中午字幕| 欧洲亚洲精品在线| 国产91高潮流白浆在线麻豆| 亚洲成人激情社区| 中文字幕欧美区| 亚洲精品网站在线观看| 久久久精品国产免大香伊| 欧美欧美欧美欧美首页| 成人a级免费电影| 九色|91porny| 午夜天堂影视香蕉久久| 综合久久给合久久狠狠狠97色 | 色综合久久久久综合体| 国产一区二区三区四区五区美女 | 亚洲精品亚洲人成人网| 久久久久久99精品| 欧美白人最猛性xxxxx69交| 色哟哟一区二区| www.欧美.com| 大陆成人av片| 国产福利一区在线观看| 免费观看91视频大全| 亚洲第一狼人社区| 亚洲激情网站免费观看| 亚洲欧洲精品一区二区精品久久久| 精品少妇一区二区| 91精品国产综合久久国产大片| 在线看一区二区| 色婷婷综合久久久| 99riav久久精品riav| 成人精品亚洲人成在线| 国产成人8x视频一区二区| 欧美一级淫片007| 欧美一区中文字幕| 91精品国模一区二区三区| 欧美二区乱c少妇| 欧美喷水一区二区| 91精品国产综合久久福利软件| 欧美日韩精品综合在线| 欧美日韩午夜精品| 欧美日韩成人在线一区| 91精品国产aⅴ一区二区| 5566中文字幕一区二区电影| 欧美一区二区精品| 精品国内片67194| 久久久亚洲综合| 国产精品欧美一区二区三区| 中文字幕一区二区三区蜜月 | 国产精品你懂的在线欣赏| 国产精品你懂的在线欣赏| 中文字幕在线不卡| 一区二区三区四区乱视频| 亚洲伊人色欲综合网| 日韩精品一级中文字幕精品视频免费观看| 亚洲影视在线观看| 日本美女视频一区二区| 精品一区二区三区免费| 国产91露脸合集magnet| 91理论电影在线观看| 欧美色图在线观看| 精品国产网站在线观看| 中文字幕免费不卡| 亚洲人成网站色在线观看| 天天爽夜夜爽夜夜爽精品视频| 男人的j进女人的j一区| 岛国av在线一区| 色哟哟一区二区| 日韩无一区二区| 国产欧美精品国产国产专区| 亚洲日本中文字幕区| 日本午夜精品视频在线观看| 国产成a人亚洲精品| 欧美午夜精品久久久| 日韩精品在线一区二区| 中文字幕在线免费不卡| 偷拍一区二区三区四区| 国产精品亚洲成人| 欧美日韩电影一区| 国产婷婷一区二区| 婷婷综合久久一区二区三区| 国产精品亚洲第一| 欧美另类一区二区三区| 中文字幕av免费专区久久| 亚洲成人资源在线| 国产91在线观看| 欧美电影一区二区三区| 中文字幕制服丝袜一区二区三区 | 日韩国产欧美在线视频| 成人免费毛片片v| 欧美一区二区国产| 亚洲视频中文字幕| 国产美女精品一区二区三区| 欧美日韩第一区日日骚| 中文字幕在线不卡一区 | 岛国一区二区在线观看| 91精品国产综合久久久久久久| 国产欧美一区二区精品性色超碰| 亚洲第四色夜色| 99视频精品全部免费在线| 欧美成人a∨高清免费观看| 亚洲小说欧美激情另类| 高清日韩电视剧大全免费| 一区二区成人在线视频| 成人黄色电影在线 | 欧美区一区二区三区| 国产精品初高中害羞小美女文| 久久精品噜噜噜成人88aⅴ| 欧美日本乱大交xxxxx| 亚洲欧美欧美一区二区三区| 成人美女视频在线观看18| 久久久久久一二三区| 麻豆成人在线观看| 日韩一区二区三区三四区视频在线观看 | 日本乱人伦一区| 国产精品久久夜| 国产成人精品综合在线观看| 日韩欧美在线1卡| 日本特黄久久久高潮| 欧美日本韩国一区二区三区视频 | 免费在线视频一区| 欧美日韩不卡一区二区| 亚洲宅男天堂在线观看无病毒| 成人国产精品免费网站| 欧美高清一级片在线观看| 国产乱码精品一区二区三| 精品理论电影在线观看| 裸体健美xxxx欧美裸体表演| 91超碰这里只有精品国产| 午夜精品福利一区二区三区av | 捆绑调教美女网站视频一区| 91精品国产色综合久久ai换脸 | 亚洲一区在线免费观看| 91福利在线观看| 亚洲综合成人在线视频| 欧美在线免费观看视频| 亚洲高清在线视频| 欧美二区在线观看| 六月丁香婷婷久久| 欧美大片顶级少妇| 国产激情视频一区二区三区欧美 | av亚洲精华国产精华精华| 亚洲欧洲精品一区二区精品久久久 | 欧美精品久久99| 日本aⅴ亚洲精品中文乱码| 欧美一区二区三区视频| 国产自产高清不卡| 国产女人18毛片水真多成人如厕| 成人精品视频一区二区三区尤物| 亚洲欧洲成人精品av97| 日本韩国精品在线| 午夜一区二区三区在线观看| 91精品蜜臀在线一区尤物| 国产精品综合久久| 最近日韩中文字幕| 欧美日韩你懂的| 捆绑调教美女网站视频一区| 欧美国产激情二区三区| 91美女片黄在线观看91美女| 亚洲成人综合在线| 日韩欧美国产一二三区| 国产成人a级片| 亚洲一区二区三区激情| 欧美成人vps| 国产精品久久久久国产精品日日| 成人黄色av网站在线| 五月天一区二区|