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

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

?? pc.c

?? 在PC上使用BC31調試uCOSII時所需要加載的uCOS與硬件相關的移植文件的PC頭文件。
?? 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一区二区三区免费野_久草精品视频
色94色欧美sute亚洲线路一久| 日韩av一二三| 精品福利二区三区| 欧美一级xxx| 日韩一区二区免费电影| 日韩视频免费观看高清完整版 | 一区二区三区在线视频观看58| 久久女同性恋中文字幕| 国产欧美日本一区二区三区| 欧美日韩亚洲综合一区二区三区| 国产精品视频一二三| 欧美一区二区久久久| 日韩一区二区三区高清免费看看 | 91精品国产综合久久蜜臀 | 777xxx欧美| 精品国产免费人成在线观看| 国产日韩欧美电影| 亚洲久本草在线中文字幕| 日韩国产精品大片| 国产成人亚洲精品狼色在线| 欧美在线不卡视频| 久久久久亚洲综合| 亚洲黄色小说网站| 欧美亚洲国产一区在线观看网站| 精品少妇一区二区三区免费观看| 国产日本欧美一区二区| 亚洲欧美日韩中文字幕一区二区三区| 欧美a一区二区| 99视频精品全部免费在线| 欧美va在线播放| 亚洲精品国产a| 99精品视频在线观看免费| 久久久久久夜精品精品免费| 亚洲一区影音先锋| 韩国精品免费视频| 69堂亚洲精品首页| 亚洲午夜在线视频| 91丨九色丨蝌蚪富婆spa| 日本一区二区三区四区| 精品一区二区精品| 日韩欧美一区二区三区在线| 日韩国产在线观看| 日韩午夜在线观看| 精品亚洲porn| 国产日产亚洲精品系列| 国产电影一区在线| 亚洲欧洲av在线| 91免费看片在线观看| 国产成人福利片| 欧美成人免费网站| 国产夫妻精品视频| 亚洲欧美一区二区不卡| 国产成人午夜视频| 国产日产亚洲精品系列| 在线精品亚洲一区二区不卡| 艳妇臀荡乳欲伦亚洲一区| 欧美日本国产视频| 亚洲天堂免费看| 91亚洲永久精品| 日本美女一区二区三区视频| 精品国产免费人成在线观看| 成人午夜精品在线| 亚洲综合无码一区二区| 在线观看91av| 国产做a爰片久久毛片| 一区二区三区在线看| 91精品国产91久久久久久最新毛片| 蜜臀久久99精品久久久久宅男| 国产日韩欧美激情| 日韩三级视频在线观看| 一本一道综合狠狠老| 国产乱码精品一区二区三区忘忧草 | 色婷婷综合久色| 国产寡妇亲子伦一区二区| 亚洲高清免费观看| 一区二区三国产精华液| 日本一区二区三级电影在线观看| 欧美网站大全在线观看| 风间由美一区二区三区在线观看 | 欧美三级在线视频| 99久久免费视频.com| 丝袜美腿成人在线| 亚洲蜜臀av乱码久久精品| 亚洲欧洲性图库| 中文字幕中文字幕一区二区 | 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲人成影院在线观看| 国产视频在线观看一区二区三区| 欧美久久一二区| 91精品国产乱| 日韩欧美在线影院| 久久久国产综合精品女国产盗摄| 久久日一线二线三线suv| 国产日韩欧美在线一区| 国产精品全国免费观看高清| 国产亚洲欧美中文| 国产午夜三级一区二区三| 精品久久久久一区二区国产| 日韩一区二区高清| 久久蜜臀精品av| 亚洲色图一区二区三区| 婷婷久久综合九色综合绿巨人 | 99久久精品国产毛片| 欧洲精品一区二区| 欧美日韩一区在线观看| 欧美一级xxx| 亚洲私人影院在线观看| 日韩成人免费看| jlzzjlzz欧美大全| 精品国产乱码久久久久久夜甘婷婷 | 久久综合九色综合欧美98| 亚洲精品国产成人久久av盗摄| 国产乱码精品一区二区三区五月婷| 成人性生交大合| 日韩精品中午字幕| 一区二区三区欧美日韩| 久久99精品国产91久久来源| 91美女片黄在线观看91美女| 欧美高清www午色夜在线视频| 中文一区二区在线观看| 九色porny丨国产精品| 欧美日韩国产欧美日美国产精品| 亚洲精品国产一区二区精华液| 不卡一区二区三区四区| 国产欧美一区二区在线观看| 日韩av在线免费观看不卡| 91亚洲永久精品| 国产精品美女久久久久高潮| 日韩高清一区在线| 欧美理论片在线| 国产精品乱子久久久久| 久久精品国产99国产| 欧美午夜精品一区| 日韩高清欧美激情| 国产无一区二区| 国产999精品久久久久久绿帽| 欧美日韩不卡一区二区| 亚洲码国产岛国毛片在线| 国产伦精品一区二区三区免费| 欧美一区在线视频| 麻豆91在线观看| 欧美精品一区男女天堂| 精品一区二区三区欧美| 欧美韩国日本不卡| 在线欧美日韩国产| 国产激情一区二区三区桃花岛亚洲| 国产丝袜欧美中文另类| 国产激情一区二区三区| 一区二区三区不卡视频| 日韩欧美视频一区| 不卡一区二区三区四区| 日韩电影在线观看网站| 国产精品久久久久天堂| 制服丝袜一区二区三区| 成人免费视频app| 亚洲乱码中文字幕| 欧美视频完全免费看| 成人妖精视频yjsp地址| 亚洲一级二级在线| 中文字幕乱码久久午夜不卡| 制服丝袜亚洲色图| 99国内精品久久| 裸体健美xxxx欧美裸体表演| 亚洲欧美日韩一区二区三区在线观看| 精品免费日韩av| 欧美日韩在线不卡| 成人av集中营| 不卡区在线中文字幕| 激情丁香综合五月| 亚洲高清视频的网址| 综合分类小说区另类春色亚洲小说欧美| 7777精品伊人久久久大香线蕉| 日本高清不卡视频| 在线视频欧美精品| 欧美日韩午夜在线视频| 欧美日韩一区二区三区四区五区| 91亚洲国产成人精品一区二三| 国产不卡高清在线观看视频| 精品制服美女丁香| 狠狠色丁香婷婷综合久久片| 精品综合免费视频观看| 国产麻豆精品在线| 99这里只有久久精品视频| av影院午夜一区| 一本色道久久综合亚洲aⅴ蜜桃| 成人一区二区三区在线观看| 久久97超碰色| 国产酒店精品激情| 成人激情动漫在线观看| 成人app在线| 色综合久久综合网| 欧美日韩国产乱码电影| www欧美成人18+| 亚洲视频免费在线| 看片网站欧美日韩| 国产传媒欧美日韩成人| 色狠狠综合天天综合综合| 91麻豆精品国产91久久久久久| 欧美精品一区二区三区在线播放| 国产精品久久午夜|