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

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

?? 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();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97se亚洲国产综合自在线| 亚洲欧洲成人自拍| 国产清纯在线一区二区www| 亚洲视频每日更新| 激情欧美一区二区三区在线观看| 成人黄页毛片网站| www日韩大片| 爽好多水快深点欧美视频| 99久久精品免费看国产| 亚洲欧美日韩久久| 国产精品一线二线三线| 中文字幕日韩av资源站| 高清国产一区二区| 欧美日韩精品免费观看视频| 国产精品66部| 日韩一区二区免费在线电影| 国产精品免费丝袜| 欧美精品乱人伦久久久久久| ㊣最新国产の精品bt伙计久久| 国产精华液一区二区三区| 亚洲第一av色| 亚洲男人的天堂在线观看| 欧美日韩成人综合| 亚洲精品老司机| 91免费版pro下载短视频| 中文字幕一区二区三区四区不卡 | 18成人在线视频| 色婷婷亚洲一区二区三区| 欧美一级在线免费| 国产自产v一区二区三区c| 婷婷丁香久久五月婷婷| 91精品国产综合久久国产大片| 精品中文字幕一区二区小辣椒| 久久久www成人免费毛片麻豆 | 欧美国产欧美综合| 国产精品影视网| 久久久不卡影院| proumb性欧美在线观看| 午夜精品视频在线观看| 亚洲欧洲精品一区二区三区不卡| 不卡的av电影在线观看| 亚洲亚洲人成综合网络| 欧美夫妻性生活| 91丨九色丨黑人外教| 视频一区在线播放| 综合激情成人伊人| 欧美成人猛片aaaaaaa| 国产精品―色哟哟| 中文字幕一区二区三| 97超碰欧美中文字幕| 欧美午夜理伦三级在线观看| 精品一区二区影视| 日韩中文欧美在线| 亚洲国产成人av网| 欧美日韩一区二区三区在线| 91精品国产乱码久久蜜臀| 日韩一本二本av| 亚洲天堂2014| 一区二区高清在线| 欧美日精品一区视频| 日韩影院精彩在线| 久久亚洲精品国产精品紫薇| 韩国视频一区二区| 国产精品99久久久久久似苏梦涵| 久久一夜天堂av一区二区三区| 亚洲精品一区二区三区在线观看| jlzzjlzz亚洲女人18| 92国产精品观看| 欧美日本一区二区三区四区| 91麻豆国产自产在线观看| 色国产综合视频| 久久精品二区亚洲w码| 亚洲一区二区成人在线观看| 一区二区三区欧美| 日本午夜精品视频在线观看| 日韩激情视频网站| 色婷婷亚洲综合| 成人美女视频在线观看18| 蜜桃在线一区二区三区| 国产成人精品亚洲日本在线桃色| 懂色av一区二区三区免费观看 | 欧美精品一区二区三区久久久| 26uuu亚洲综合色欧美| 欧美激情中文字幕一区二区| 日本一区二区综合亚洲| 欧美电视剧在线看免费| 中文字幕欧美一区| 成人动漫精品一区二区| 处破女av一区二区| 97精品久久久午夜一区二区三区 | 一区二区三区四区精品在线视频 | 欧美成人一区二区| 精品日韩在线观看| av在线一区二区三区| 日韩和欧美的一区| 国产精品久久久久婷婷二区次| 3atv一区二区三区| 国产在线视频一区二区| 2019国产精品| 欧美日韩精品一区二区三区| 国产99一区视频免费 | 久久久久免费观看| 蜜桃av噜噜一区| 91麻豆精品国产91久久久久久久久| 欧美国产1区2区| jizz一区二区| 日本欧美久久久久免费播放网| 久久国产精品一区二区| 欧美日韩亚洲综合一区| 欧美国产乱子伦| 日韩一级视频免费观看在线| 青青青伊人色综合久久| 国产日韩欧美不卡在线| 激情综合网av| 亚洲欧美国产高清| 欧美电影在哪看比较好| 日韩高清一级片| 亚洲精品在线三区| 51久久夜色精品国产麻豆| 精品一二线国产| 色综合久久综合网97色综合| 激情综合网天天干| 亚洲激情成人在线| 久久久久久久久久久久电影| 日韩欧美国产电影| 日韩欧美亚洲国产精品字幕久久久 | 久久综合九色综合97_久久久| 日韩午夜电影在线观看| 欧美精品一区二区三区四区| 国产欧美日韩一区二区三区在线观看 | 一区二区三区在线免费观看| 一区二区三区高清| 日韩av中文在线观看| 国产精一区二区三区| 成年人国产精品| 欧美日韩dvd在线观看| 日韩美女视频在线| 日韩欧美的一区| 亚洲成人你懂的| 制服丝袜亚洲色图| 91视频国产资源| 欧美主播一区二区三区| 91精品国产综合久久国产大片| 91精品国产aⅴ一区二区| 欧美mv和日韩mv国产网站| 日韩视频一区二区三区在线播放| 精品成人a区在线观看| 亚洲欧洲中文日韩久久av乱码| 一区二区三区资源| 狠狠狠色丁香婷婷综合久久五月| 国内精品伊人久久久久av影院| 91在线看国产| 91免费国产在线观看| 日韩精品中文字幕在线不卡尤物 | 欧美精品一区二区不卡 | 在线成人av影院| 国产亚洲一二三区| 亚洲精品中文在线观看| 黑人精品欧美一区二区蜜桃| 成人精品gif动图一区| 91精品国产美女浴室洗澡无遮挡| 国产精品视频免费看| 亚洲一区二区三区四区中文字幕 | 亚洲午夜激情网站| 国产v综合v亚洲欧| 精品视频在线免费| 国产精品免费视频网站| 亚洲综合av网| 波多野结衣精品在线| 精品国产自在久精品国产| 中文字幕一区二区三区精华液 | 日韩欧美国产综合一区| 亚洲精品国产视频| 精品一区二区免费视频| 91精品国产欧美一区二区成人| 国产精品三级在线观看| 国内久久精品视频| 91麻豆精品国产自产在线观看一区| 国产女人aaa级久久久级| 精品一区二区在线观看| 91精品福利在线| 亚洲免费av高清| 紧缚捆绑精品一区二区| 91精品麻豆日日躁夜夜躁| 亚洲va欧美va天堂v国产综合| 成人性生交大合| 国产欧美精品一区二区三区四区 | 精品国产精品网麻豆系列| 亚洲视频小说图片| 91麻豆国产福利精品| 日韩美一区二区三区| 久久成人18免费观看| 欧美精品乱码久久久久久按摩| 亚洲同性gay激情无套| av男人天堂一区| 国产调教视频一区| 成人一区二区三区| 久久综合丝袜日本网| 久久精品99国产精品| 欧美大片在线观看|