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

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

?? pc.c

?? 開發環境為ADS1.2,LPC2114帶UCOS的IIC程序
?? 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一区二区三区免费野_久草精品视频
亚洲女与黑人做爰| 成人免费黄色在线| 东方aⅴ免费观看久久av| 91在线丨porny丨国产| 欧美xxxxxxxx| 亚洲动漫第一页| av在线播放不卡| 久久影院电视剧免费观看| 亚洲在线视频网站| av亚洲产国偷v产偷v自拍| 精品国产免费久久| 亚洲成av人影院| 色婷婷一区二区三区四区| 国产午夜亚洲精品不卡| 久久99在线观看| 在线成人av网站| 亚洲高清久久久| 91免费国产视频网站| 中文字幕欧美区| 国产ts人妖一区二区| 日韩视频在线观看一区二区| 亚洲成在人线免费| 91国在线观看| 综合久久国产九一剧情麻豆| 成人中文字幕在线| 国产精品欧美久久久久无广告| 国产美女在线观看一区| 欧美tk—视频vk| 激情综合色综合久久综合| 日韩视频免费观看高清在线视频| 日韩高清一级片| 欧美老女人在线| 青青草97国产精品免费观看| 欧美蜜桃一区二区三区| 亚洲成人av中文| 欧美日韩国产色站一区二区三区| 亚洲一区二区三区四区在线| 欧美日韩一区二区在线观看视频| 亚洲一区二区四区蜜桃| 欧美日韩日日骚| 蜜桃在线一区二区三区| 久久久99精品久久| 成人免费看黄yyy456| 一区二区三区自拍| 欧美色欧美亚洲另类二区| 奇米在线7777在线精品| 精品成人一区二区三区四区| 国产成人啪午夜精品网站男同| 国产精品国产三级国产有无不卡| a亚洲天堂av| 亚洲夂夂婷婷色拍ww47| 4438x亚洲最大成人网| 免费成人在线网站| 国产精品三级在线观看| 一本大道久久a久久综合婷婷 | 日韩一区国产二区欧美三区| 免费日韩伦理电影| 久久精品一二三| 色综合天天综合网国产成人综合天 | 国产欧美精品一区二区色综合| 风间由美一区二区av101| 亚洲视频一区二区免费在线观看| 欧美日韩一级二级三级| 久草精品在线观看| 最新久久zyz资源站| 在线播放一区二区三区| 国产精品一线二线三线| 一区二区三区在线视频免费| 精品国产伦一区二区三区观看体验| 国产麻豆91精品| 亚洲国产精品久久久男人的天堂| 精品国产成人系列| 欧美影院午夜播放| 国产成人av电影在线| 午夜精品国产更新| 国产精品视频你懂的| 欧美挠脚心视频网站| av亚洲精华国产精华精华| 美女尤物国产一区| 亚洲午夜一区二区| 久久这里都是精品| 欧美日韩国产色站一区二区三区| 大尺度一区二区| 青青草一区二区三区| 亚洲一区二区三区四区在线| 中文字幕乱码亚洲精品一区 | 舔着乳尖日韩一区| 中文字幕制服丝袜成人av| 欧美大肚乱孕交hd孕妇| 欧美亚洲愉拍一区二区| 成人免费毛片嘿嘿连载视频| 精东粉嫩av免费一区二区三区| 亚洲国产精品一区二区久久| 国产精品网曝门| 国产亚洲制服色| 欧美成人video| 在线综合视频播放| 欧美性三三影院| 色狠狠av一区二区三区| 不卡视频一二三| 成人av电影在线网| 国产精品一级片| 国产在线播放一区三区四| 日韩精品一二区| 五月激情综合色| 午夜精品福利在线| 午夜av区久久| 全部av―极品视觉盛宴亚洲| 日韩不卡一区二区三区| 午夜久久久影院| 免费高清成人在线| 精品一区二区三区免费播放| 人人狠狠综合久久亚洲| 麻豆成人在线观看| 美女在线视频一区| 精品影院一区二区久久久| 老司机精品视频在线| 精品在线播放免费| 国产精品一品二品| 99国产欧美久久久精品| 色综合咪咪久久| 欧美日韩视频在线一区二区| 在线不卡一区二区| 日韩亚洲欧美成人一区| 精品福利视频一区二区三区| 久久伊99综合婷婷久久伊| 欧美电影免费观看高清完整版在 | 欧美日韩第一区日日骚| 欧美在线观看视频在线| 欧美日韩电影在线播放| 欧美成人一区二区三区片免费 | 国产一区二区不卡| 国产成人av一区二区| 不卡视频一二三| 欧美日韩久久不卡| 日韩一区二区三区四区五区六区| 日韩欧美亚洲一区二区| 久久久亚洲高清| 国产精品传媒在线| 亚洲1区2区3区视频| 久久草av在线| 91免费观看视频在线| 欧美日韩国产高清一区二区三区| 欧美一区二区在线视频| 国产精品欧美极品| 日日夜夜精品视频天天综合网| 精品影院一区二区久久久| 99久久99久久综合| 欧美日韩国产另类一区| 国产午夜一区二区三区| 亚洲国产日韩精品| 精品一二线国产| 色婷婷av一区二区| 欧美videos中文字幕| 最新欧美精品一区二区三区| 三级一区在线视频先锋 | 成人a区在线观看| 欧美午夜精品免费| 国产欧美日韩综合精品一区二区| 亚洲精品日日夜夜| 国产精品资源在线看| 91成人国产精品| 国产精品视频看| 伦理电影国产精品| 欧洲精品一区二区| 中文字幕亚洲在| 精品一区二区久久| 欧美肥大bbwbbw高潮| 中文字幕综合网| 国产成人免费网站| 欧美一区中文字幕| 亚洲一线二线三线视频| 不卡高清视频专区| 国产午夜精品美女毛片视频| 午夜激情久久久| 成人精品在线视频观看| 精品国产一二三| 日精品一区二区| 欧美视频一区二区三区在线观看| 国产精品欧美久久久久一区二区| 久久av资源网| 欧美一区二区三区四区视频| 一区二区三区丝袜| 99热国产精品| 国产精品黄色在线观看| 高清国产一区二区| 久久伊99综合婷婷久久伊| 久久精品国产亚洲5555| 欧美精品在欧美一区二区少妇| 亚洲视频免费在线| 成人黄色一级视频| 国产精品久久久久久久浪潮网站| 国产精品一区二区在线观看不卡| 91精品久久久久久久99蜜桃| 亚洲午夜精品在线| 欧美日韩亚洲综合在线 | 国产精品国产三级国产专播品爱网| 日本在线播放一区二区三区| 欧美三级中文字幕在线观看| 亚洲一区免费视频|