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

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

?? pc.c

?? ucosii小實(shí)驗(yàn)任務(wù)五 時(shí)鐘中斷
?? 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一区二区三区蜜臀 | 琪琪久久久久日韩精品| 亚洲h在线观看| 久久99精品久久久久久动态图 | 成人精品鲁一区一区二区| 成人亚洲一区二区一| 一本大道久久a久久精二百| 日本精品视频一区二区三区| 欧美一区二区黄| 亚洲成人免费视| 国产xxx精品视频大全| 狠狠色狠狠色合久久伊人| 成人免费毛片aaaaa**| 7777精品伊人久久久大香线蕉经典版下载 | 成人欧美一区二区三区视频网页 | 欧美丝袜丝交足nylons| 国产欧美精品日韩区二区麻豆天美| 亚洲欧美日韩国产综合| 亚洲福利视频一区| 欧美一区二区网站| 中文字幕在线观看一区二区| 亚洲成人自拍一区| zzijzzij亚洲日本少妇熟睡| 日韩三级精品电影久久久| 亚洲精品高清在线| 国产91在线观看丝袜| 日韩精品一区二区三区蜜臀 | 色偷偷久久人人79超碰人人澡| 日韩欧美区一区二| 捆绑调教美女网站视频一区| 91蝌蚪porny成人天涯| 久久久精品黄色| 国产精品一区二区不卡| 欧美电影免费观看高清完整版| 日韩不卡一区二区三区| 欧美丰满少妇xxxbbb| 五月婷婷欧美视频| 91麻豆精品国产91久久久久久久久 | 亚洲成人一二三| 欧美日韩在线播放三区| 婷婷久久综合九色国产成人 | 亚洲最大成人综合| 欧美视频一区二区三区在线观看| 最新日韩av在线| 久久新电视剧免费观看| 成人精品国产免费网站| 亚洲三级免费观看| 欧美日韩二区三区| 激情六月婷婷久久| 亚洲免费观看高清完整版在线观看 | 亚洲aaa精品| 国产精品三级视频| 欧美在线免费观看亚洲| 亚洲影视在线播放| 久久久欧美精品sm网站| 在线观看亚洲专区| 国产精品中文欧美| 日韩电影在线观看电影| ●精品国产综合乱码久久久久| 5566中文字幕一区二区电影| 成人综合婷婷国产精品久久| 一区二区三区日本| 亚洲欧洲国产专区| 久久先锋影音av| 日韩午夜电影在线观看| av中文字幕在线不卡| 精品一区二区三区久久久| 一级女性全黄久久生活片免费| 欧美国产精品一区| 久久久精品人体av艺术| 久久综合色婷婷| 日韩欧美你懂的| 亚洲视频资源在线| 成人欧美一区二区三区| 国产精品国产三级国产| 精品国产乱码久久久久久闺蜜| 欧美日韩国产免费一区二区 | 秋霞午夜av一区二区三区| 亚洲国产成人porn| 午夜精品久久久久久久99水蜜桃| 午夜在线电影亚洲一区| 午夜免费欧美电影| 蜜臀av亚洲一区中文字幕| 蜜桃免费网站一区二区三区| 蜜臀av性久久久久av蜜臀妖精| 天堂资源在线中文精品| 免费黄网站欧美| 国产精品一区二区三区网站| 国产成人激情av| 粉嫩一区二区三区性色av| av激情综合网| 欧美精品日韩精品| 国产午夜精品一区二区三区嫩草| 国产精品乱人伦| 亚洲国产综合在线| 国产在线视频一区二区| 色综合中文字幕| 日韩美女天天操| 中文字幕一区av| 久久成人麻豆午夜电影| 欧美网站一区二区| 久久久久久黄色| 亚洲永久精品大片| 成人av先锋影音| 日韩一级欧美一级| 亚洲大尺度视频在线观看| 日本欧美在线看| 一本久道中文字幕精品亚洲嫩| 欧美一个色资源| 一区二区三区日韩欧美| 激情综合五月婷婷| 欧美日本一区二区在线观看| 国产精品美女久久久久久| 另类专区欧美蜜桃臀第一页| 在线精品视频一区二区| 日韩精品一区二区三区四区视频 | 中文字幕一区二区三区乱码在线| 三级在线观看一区二区| 色综合久久久久网| 亚洲伦在线观看| 成人精品国产免费网站| 国产亚洲欧美一级| 国产精品一区免费视频| 日韩欧美的一区| 精品亚洲porn| 国产亚洲欧美日韩俺去了| 国产真实乱偷精品视频免| 久久久亚洲国产美女国产盗摄 | 欧美日韩国产小视频在线观看| 国产亚洲成年网址在线观看| 国产精品99精品久久免费| 国产欧美中文在线| 色综合一个色综合| 午夜精彩视频在线观看不卡| 欧美日韩精品一区二区三区| 夜夜夜精品看看| 日韩一区二区在线观看视频| 精品一区二区三区免费| 亚洲毛片av在线| 久久亚洲二区三区| 国产精品18久久久久久vr| 欧美韩日一区二区三区四区| 色婷婷综合五月| 激情综合网天天干| 亚洲美女偷拍久久| 日韩精品一区二区三区视频播放 | 久久先锋影音av| 欧美亚洲一区二区在线观看| 国产在线不卡一卡二卡三卡四卡| 国产精品三级久久久久三级| 国产精品久久一卡二卡| 91精品免费在线| 91蝌蚪porny九色| 成人av资源下载| 美腿丝袜在线亚洲一区| 亚洲在线中文字幕| 亚洲女人****多毛耸耸8| 国产精品色婷婷| 中文无字幕一区二区三区 | 国产精品一区二区男女羞羞无遮挡 | 奇米四色…亚洲| 亚洲国产成人av网| 亚洲男人天堂一区| 成人免费视频在线观看| 国产精品素人一区二区| 国产日韩欧美综合一区| 欧美激情一区二区三区不卡| 337p亚洲精品色噜噜| 911精品国产一区二区在线| 欧美亚洲国产一区二区三区va| 一本色道久久综合亚洲精品按摩| 不卡电影一区二区三区| a亚洲天堂av| 欧美视频在线一区二区三区| 91国内精品野花午夜精品| 色婷婷av一区二区三区软件 | 亚洲日本成人在线观看| 亚洲精品日韩专区silk| 午夜精品久久久久影视| 午夜精品爽啪视频| 精品伊人久久久久7777人| 狠狠色综合色综合网络| 大胆亚洲人体视频| 欧美最新大片在线看| 日韩一区二区在线观看视频播放| 欧美精品一区二区三区很污很色的| 国产亚洲福利社区一区| 亚洲亚洲人成综合网络| 久久99国产精品久久| jlzzjlzz国产精品久久| 91精品午夜视频| 国产精品传媒入口麻豆| 日韩精品五月天| 99精品国产一区二区三区不卡| 欧美精品久久99久久在免费线 | 91欧美一区二区| 国产999精品久久久久久绿帽| av中文字幕一区|