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

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

?? pc.c

?? 基于LPC2134的在ucos2操作系統下的源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
{
//change by cmj
//#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
//    OS_CPU_SR  cpu_sr;
//#endif    


//    PC_ExitFlag  = FALSE;                                  /* Indicate that we are not exiting yet!    */
//    OSTickDOSCtr =     1;                                  /* Initialize the DOS tick counter          */
//    PC_TickISR   = PC_VectGet(VECT_TICK);                  /* Get MS-DOS's tick vector                 */
    
//    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.
*********************************************************************************************************
*/
//change by cmj
        void PC_ElapsedStart(void)
{
    PC_ElapsedOverhead = T0TC;
}

//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)
*********************************************************************************************************
*/
//change by cmj
        INT16U PC_ElapsedStop(void)
{
    return ((T0TC - PC_ElapsedOverhead) / (Fpclk / 1000000));
}

//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
*********************************************************************************************************
*/
//change by cmj
        void PC_GetDateTime (char *s)
{
    INT32U da_year,da_mon,da_day,ti_hour,ti_min,ti_sec;
    

    ti_sec = SEC;
    ti_min = MIN;
    ti_hour = HOUR;
    da_day = DOM;
    da_mon = MONTH;
    da_year = YEAR;

    sprintf(s, "%04d-%02d-%02d  %02d:%02d:%02d",
               da_year,da_mon,da_day,ti_hour,ti_min,ti_sec);
}

//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
*********************************************************************************************************
*/
//change by cmj
    BOOLEAN PC_GetKey (INT16S *c)
{
    if ((U0LSR & 0x00000001) != 0)
    {
        *c = U0RBR;
        return (TRUE);
    }
    else
    {
        *c = 0x00;
        return (FALSE);
    }
}

//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
*********************************************************************************************************
*/
//del by cmj
//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.
*********************************************************************************************************
*/
//del by cmj
//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
*********************************************************************************************************
*/
//del by cmj
//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();
//}


//add by cmj
        INT8U random(INT8U seed)
{
    uint16 temp;

    temp = rand();
    temp = temp % seed;
	return temp;
}

/*********************************************************************************************************
**                            End Of File
********************************************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区在线观看视频| 欧美日本国产视频| 亚洲一区在线观看免费| 欧美群妇大交群中文字幕| 国产精品羞羞答答xxdd| 国产一区二区精品在线观看| 国产盗摄女厕一区二区三区| 国产毛片精品国产一区二区三区| 色综合久久久久综合体桃花网| 日韩精品专区在线| 一区二区免费视频| 久久国产婷婷国产香蕉| 欧美三级中文字| 亚洲男人的天堂网| 成人精品视频网站| 日本一区二区久久| 欧美日本在线观看| 精品国产伦一区二区三区观看方式 | 日本一区二区三区在线不卡| 悠悠色在线精品| 成人av在线资源网站| 欧美另类变人与禽xxxxx| 亚洲欧洲99久久| 成人免费精品视频| 久久综合九色综合欧美就去吻| 午夜精品视频一区| 91网站视频在线观看| 国产精品婷婷午夜在线观看| 久久99久国产精品黄毛片色诱| 欧美嫩在线观看| 亚洲精品乱码久久久久| 日本丶国产丶欧美色综合| 亚洲国产精品精华液ab| 成人黄色综合网站| 久久久精品tv| 菠萝蜜视频在线观看一区| 国产精品久久久久影视| 国产91露脸合集magnet| 国产精品免费久久| caoporm超碰国产精品| 国产精品福利av| 色欧美日韩亚洲| 日韩中文字幕av电影| 色菇凉天天综合网| 亚洲图片欧美色图| 欧美日韩国产一级片| 日本一不卡视频| 欧美日韩一区视频| 1000精品久久久久久久久| 粉嫩高潮美女一区二区三区| 777欧美精品| 日本高清成人免费播放| 亚洲精品国产高清久久伦理二区| 日韩一区二区视频在线观看| 欧美日韩一区视频| 精品日韩一区二区三区| 婷婷久久综合九色综合伊人色| 国产大片一区二区| 欧美一区二区三区白人| 亚洲精品免费视频| 国产精品影视在线观看| 欧美一级精品大片| 亚洲伦在线观看| 成人免费毛片嘿嘿连载视频| 337p亚洲精品色噜噜噜| 偷窥少妇高潮呻吟av久久免费| 99久久er热在这里只有精品66| 日韩欧美中文一区二区| 一区二区三区四区av| 亚洲一区二区精品久久av| 欧美性xxxxxx少妇| 中文在线一区二区| 国产黑丝在线一区二区三区| 欧美一级一区二区| 免费欧美日韩国产三级电影| 欧美亚洲愉拍一区二区| 中文字幕亚洲一区二区va在线| 国产精品1024久久| 91精品婷婷国产综合久久性色 | 亚洲码国产岛国毛片在线| 国产91精品久久久久久久网曝门| 91精品国产免费| 日本欧美久久久久免费播放网| 欧美日韩夫妻久久| 久久免费看少妇高潮| 国产+成+人+亚洲欧洲自线| 欧美精品一区二区三区在线| 老鸭窝一区二区久久精品| 欧美一级片在线| 国产在线一区观看| 国产午夜精品久久久久久久| 国产精品一区二区无线| 久久精品夜色噜噜亚洲aⅴ| 轻轻草成人在线| 久久综合色婷婷| 国产一区二区三区免费观看| 久久久噜噜噜久噜久久综合| 精品在线免费观看| 国产三级精品三级在线专区| 日韩电影在线一区二区三区| 欧美成人精精品一区二区频| 国产成人亚洲综合a∨猫咪| 国产精品色一区二区三区| 色婷婷av一区二区三区大白胸| 日日摸夜夜添夜夜添国产精品 | 美腿丝袜亚洲色图| 中文字幕免费不卡| 色婷婷久久久亚洲一区二区三区 | 91麻豆精品久久久久蜜臀 | 国产精品美女视频| 91国产视频在线观看| 日本成人在线看| 欧美国产精品v| 91成人免费在线视频| 美女视频第一区二区三区免费观看网站| 国产亚洲欧美色| 欧美日韩国产在线观看| 国产成人精品综合在线观看| 日本免费新一区视频| 99视频在线精品| 欧美成人a在线| 久久九九影视网| 中文字幕制服丝袜成人av| 国产午夜精品久久久久久久 | 欧美日韩一级二级| 欧美日韩国产小视频| 91精品国产乱码久久蜜臀| 欧美一区二区三区喷汁尤物| 一区二区三区在线视频免费观看 | 东方欧美亚洲色图在线| 亚洲一区免费视频| 久久精品夜色噜噜亚洲aⅴ| 欧美日韩激情在线| hitomi一区二区三区精品| 日本aⅴ亚洲精品中文乱码| 中文字幕在线免费不卡| 欧美va亚洲va香蕉在线| 在线亚洲欧美专区二区| 国产99久久久精品| 日日摸夜夜添夜夜添国产精品| 国产情人综合久久777777| 91精品一区二区三区久久久久久| av一区二区三区黑人| 黄色资源网久久资源365| 夜夜嗨av一区二区三区四季av| 久久久精品国产免大香伊| 91精品国产免费久久综合| 欧洲另类一二三四区| 粉嫩久久99精品久久久久久夜| 日韩高清在线一区| 一区二区日韩av| 国产精品成人一区二区艾草| 精品国产乱码久久| 欧美福利电影网| 91成人免费在线视频| 99精品视频在线免费观看| 国产精品一区二区免费不卡| 日韩精品电影在线观看| 亚洲一区二区影院| 国产精品久久久一本精品 | 大桥未久av一区二区三区中文| 亚洲国产裸拍裸体视频在线观看乱了 | 自拍偷自拍亚洲精品播放| 日韩美女一区二区三区四区| 欧美丝袜丝交足nylons| 一道本成人在线| 成人免费高清在线观看| 国产精品一级二级三级| 日韩在线一区二区三区| 亚洲一区二区三区四区在线观看| 亚洲欧洲日韩女同| 日本一区二区三区在线观看| 2023国产精华国产精品| 日韩美一区二区三区| 欧美老女人第四色| 欧美在线播放高清精品| 91黄视频在线| 欧美视频一区二区| 欧美日韩综合在线| 欧美日韩电影在线播放| 欧美日韩国产另类一区| 欧美日韩精品欧美日韩精品| 欧美性欧美巨大黑白大战| 欧美在线影院一区二区| 欧美亚洲愉拍一区二区| 欧美日韩色综合| 337p亚洲精品色噜噜噜| 日韩精品专区在线影院观看| 精品人在线二区三区| 久久久久9999亚洲精品| 国产精品美日韩| 亚洲精品成a人| 亚洲国产成人va在线观看天堂| 午夜精品在线看| 男男视频亚洲欧美| 激情欧美一区二区| 国产69精品一区二区亚洲孕妇| caoporm超碰国产精品| 欧美在线观看一二区| 欧美高清你懂得|