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

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

?? pc.c

?? uC/OS-II,The Real-Time Kernel, CORE FUNCTIONS, 80x86/80x88 Specific code (LARGE MEMORY MODEL)
?? 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      port_data;


    OS_ENTER_CRITICAL();
    port_data  = (INT8U)inp(0x61);                         /* Disable timer #2                         */
    port_data &= 0xFE;
    outp(0x61, port_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);
    port_data |= 0x01;                                     /* Start the timer                          */
    outp(0x61, port_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      port_data;
    INT8U      low;
    INT8U      high;
    INT16U     cnts;


    OS_ENTER_CRITICAL();
    port_data  = (INT8U)inp(0x61);                               /* Disable the timer                  */
    port_data &= 0xFE;
    outp(0x61, port_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一区二区三区免费野_久草精品视频
日韩一区二区电影| 国产精品黄色在线观看| 亚洲欧洲一区二区三区| 蜜乳av一区二区三区| 91丨九色丨蝌蚪丨老版| 日韩欧美国产一区二区在线播放 | 在线不卡一区二区| 国产精品电影院| 精品亚洲成a人| 欧美一三区三区四区免费在线看 | 在线观看欧美黄色| 国产精品国产三级国产普通话三级 | 成人精品小蝌蚪| 欧美一区二区在线看| 亚洲国产综合人成综合网站| 成人做爰69片免费看网站| 久久久亚洲高清| 蜜臀国产一区二区三区在线播放| 欧美性猛片aaaaaaa做受| 天天av天天翘天天综合网| 不卡影院免费观看| 欧美韩日一区二区三区四区| 九九视频精品免费| 日韩一区二区三区视频在线| 亚洲成人综合在线| 欧美日韩国产高清一区二区三区 | 久久影音资源网| 日韩成人免费电影| 91精品国产91久久久久久一区二区| 亚洲在线免费播放| 欧美视频中文字幕| 亚洲自拍与偷拍| 欧美日韩精品一区二区| 日产欧产美韩系列久久99| 91精品国产91久久综合桃花 | 视频一区欧美精品| 911精品国产一区二区在线| 性欧美疯狂xxxxbbbb| 69精品人人人人| 美女在线一区二区| 久久久国产精品不卡| 成人精品国产免费网站| 一色桃子久久精品亚洲| 91丨porny丨户外露出| 亚洲一区二区三区四区的| 欧美日韩国产不卡| 国内一区二区在线| 国产精品天天摸av网| 色综合久久综合| 日日夜夜精品视频天天综合网| 欧美久久久久久久久中文字幕| 麻豆国产精品视频| 亚洲国产高清不卡| 欧洲精品一区二区三区在线观看| 五月婷婷欧美视频| 久久久亚洲国产美女国产盗摄| 成人免费毛片aaaaa**| 亚洲国产一区二区视频| 精品美女一区二区三区| 99视频超级精品| 日韩成人午夜电影| 中文字幕亚洲精品在线观看 | 中文字幕av资源一区| 色偷偷久久人人79超碰人人澡| 三级精品在线观看| 欧美高清在线精品一区| 欧美在线免费视屏| 国产一区二区在线影院| 亚洲精品久久久久久国产精华液| 欧美一区二区二区| 色婷婷综合久久久久中文一区二区| 日韩高清不卡一区二区三区| 中文字幕一区二区三中文字幕 | 色狠狠一区二区| 麻豆精品一区二区综合av| 中文字幕中文字幕一区| 日韩一二在线观看| 91免费版在线| 国产一区二区三区免费观看| 亚洲综合丝袜美腿| 国产欧美精品一区二区色综合| 欧美日韩情趣电影| 高清国产一区二区| 日本亚洲视频在线| 一区二区三区欧美激情| 国产日韩三级在线| 日韩三级高清在线| 欧美日韩和欧美的一区二区| www.亚洲精品| 国产精品一区不卡| 久久国产尿小便嘘嘘尿| 亚洲成人免费视| 亚洲天天做日日做天天谢日日欢 | 国产精品一线二线三线精华| 亚洲第一搞黄网站| 国产精品不卡一区二区三区| 欧美精品一区男女天堂| 欧美日韩亚洲丝袜制服| 色琪琪一区二区三区亚洲区| 岛国精品在线观看| 国产盗摄视频一区二区三区| 另类欧美日韩国产在线| 三级欧美在线一区| 手机精品视频在线观看| 亚洲尤物在线视频观看| 亚洲精选在线视频| 自拍av一区二区三区| 一区免费观看视频| 亚洲欧洲国产日韩| 亚洲欧美怡红院| 亚洲啪啪综合av一区二区三区| 国产精品视频第一区| 国产欧美精品一区二区三区四区| 国产人成亚洲第一网站在线播放| 久久久久久久久久美女| 久久精品在线观看| 国产欧美视频一区二区三区| 国产视频亚洲色图| 中文字幕精品三区| 亚洲天堂网中文字| 亚洲国产裸拍裸体视频在线观看乱了| 亚洲人成人一区二区在线观看 | 中文字幕一区二区三区在线播放| 国产欧美在线观看一区| 欧美激情在线观看视频免费| 日本一二三不卡| 中文字幕一区二| 亚洲va在线va天堂| 美女视频一区在线观看| 国产毛片精品一区| av电影天堂一区二区在线| 96av麻豆蜜桃一区二区| 欧美亚洲综合色| 精品奇米国产一区二区三区| 国产色综合久久| 亚洲男人天堂一区| 日韩精品91亚洲二区在线观看| 久久成人免费电影| 99久久精品免费| 欧美猛男gaygay网站| 国产亚洲欧美激情| 亚洲综合在线观看视频| 日本系列欧美系列| 成人激情免费视频| 欧美日韩成人高清| 国产日韩欧美电影| 天天操天天干天天综合网| 国产精品77777竹菊影视小说| 91蝌蚪porny九色| 欧美一卡二卡三卡四卡| 国产精品二三区| 久久精品免费观看| 在线精品视频小说1| 久久一区二区三区国产精品| 亚洲欧美日韩国产综合在线 | 91亚洲国产成人精品一区二三| 欧美丝袜第三区| 中文字幕久久午夜不卡| 免费人成网站在线观看欧美高清| 成人avav影音| 精品国产乱码久久久久久蜜臀 | 午夜精品久久久久久| 高清久久久久久| 日韩一区二区三区精品视频| 亚洲欧美另类图片小说| 经典三级视频一区| 欧美日韩久久一区二区| 亚洲色图视频网| 国产suv精品一区二区三区| 91精品中文字幕一区二区三区| 国产精品激情偷乱一区二区∴| 久久机这里只有精品| 欧美疯狂做受xxxx富婆| 亚洲欧洲中文日韩久久av乱码| 激情伊人五月天久久综合| 欧美嫩在线观看| 亚洲午夜电影在线观看| eeuss鲁一区二区三区| 精品国产乱码久久久久久久久| 亚洲福利电影网| 欧美在线免费播放| 亚洲日本乱码在线观看| 成人永久aaa| 中日韩免费视频中文字幕| 国产suv一区二区三区88区| 日韩欧美亚洲国产另类| 免费看欧美美女黄的网站| 717成人午夜免费福利电影| 亚洲一二三四区| 色婷婷精品久久二区二区蜜臀av| 国产日韩欧美不卡在线| 高清国产午夜精品久久久久久| 久久久久久久综合色一本| 国产精品羞羞答答xxdd| 国产亚洲欧美色| 国产传媒一区在线| 国产区在线观看成人精品| 懂色一区二区三区免费观看| 国产女同性恋一区二区| 成人丝袜高跟foot|