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

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

?? pc.c

?? S3C2410ARM處理器的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一区二区三区免费野_久草精品视频
日韩精品一区二区三区视频播放| 91麻豆福利精品推荐| 麻豆精品在线视频| 亚洲一区二区三区四区在线观看 | 久久品道一品道久久精品| 日韩一区二区免费电影| 91精品国产综合久久久久久久久久 | 欧美国产激情二区三区| 国产精品久久久久久户外露出| 亚洲国产精品精华液ab| 国产亚洲综合av| 中文字幕日韩精品一区 | 成人黄色av网站在线| 成人亚洲一区二区一| 不卡在线视频中文字幕| 欧美久久免费观看| 精品乱人伦小说| 国产精品日韩精品欧美在线| 亚洲情趣在线观看| 蜜臀久久99精品久久久画质超高清 | 91免费视频观看| 7777女厕盗摄久久久| 精品国内片67194| 中文字幕在线一区免费| 亚洲国产精品久久久久婷婷884| 日本亚洲三级在线| 91一区二区三区在线观看| 日韩亚洲欧美高清| 亚洲综合色丁香婷婷六月图片| 国产伦精品一区二区三区视频青涩 | 久久精品久久久精品美女| 欧洲另类一二三四区| 中文字幕免费不卡| 奇米色一区二区| 99r精品视频| 国产精品动漫网站| 丁香婷婷综合网| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲五码中文字幕| 欧美亚洲动漫另类| 亚洲在线一区二区三区| 99re6这里只有精品视频在线观看| 国产校园另类小说区| 国产综合久久久久影院| 中文字幕精品一区二区三区精品| 国产专区综合网| 日韩欧美一区在线| 国产在线国偷精品产拍免费yy| 精品国产凹凸成av人导航| 午夜精品视频在线观看| 日韩欧美亚洲一区二区| 麻豆一区二区99久久久久| 2欧美一区二区三区在线观看视频| 蜜乳av一区二区| 国产日韩欧美综合在线| 成人黄色小视频在线观看| 又紧又大又爽精品一区二区| 亚洲国产综合人成综合网站| 欧美日韩在线三级| 国产在线观看一区二区| 亚洲欧洲av在线| 欧美精品日韩精品| 国产大陆a不卡| 亚洲黄色av一区| 精品国产成人在线影院| 欧美无乱码久久久免费午夜一区| 日本欧美大码aⅴ在线播放| 国产亚洲成aⅴ人片在线观看| www.亚洲色图.com| 国产一区999| 免费在线视频一区| 亚洲一区二区五区| 国产精品色在线| 中文字幕制服丝袜一区二区三区| 国产成人久久精品77777最新版本| 欧美精品v国产精品v日韩精品 | 成人中文字幕合集| 中文字幕乱码日本亚洲一区二区| 欧美撒尿777hd撒尿| 91美女福利视频| 99国产精品久久久久| 国产白丝网站精品污在线入口| 日本中文字幕一区二区视频| 亚洲人成精品久久久久久| 国产网红主播福利一区二区| 国产三级精品在线| 国产精品美女久久久久久久久 | ...xxx性欧美| 国产精品丝袜91| 国产精品视频你懂的| 国产视频一区二区在线| 中文字幕一区二区视频| 精品成人私密视频| 欧美一区二区大片| 精品国产免费久久| 久久精品一区蜜桃臀影院| 欧美国产欧美亚州国产日韩mv天天看完整 | 成人91在线观看| 日本高清成人免费播放| 欧美日韩一区二区三区在线看| 欧美日韩视频第一区| 中文字幕免费观看一区| 亚洲高清三级视频| 天天综合色天天综合色h| 美国十次综合导航| 99热国产精品| 91精品国产日韩91久久久久久| 欧美国产日韩亚洲一区| 日韩av电影一区| 岛国精品在线播放| 一道本成人在线| 国产亚洲美州欧州综合国| 中文欧美字幕免费| 午夜精品久久久久| 高清久久久久久| 亚洲精品在线观看网站| 亚洲国产精品自拍| 一本到一区二区三区| 国产日韩欧美不卡| 精品亚洲成a人在线观看| 欧美精品自拍偷拍动漫精品| 亚洲婷婷在线视频| 国产成人av电影在线观看| 欧美精品99久久久**| 中文字幕一区视频| 国产成人av一区二区三区在线观看| 日韩一区二区三区高清免费看看| 夜夜嗨av一区二区三区网页| 国产.精品.日韩.另类.中文.在线.播放| 欧美欧美欧美欧美首页| 自拍偷拍欧美精品| 99国产欧美另类久久久精品| 国产欧美一区二区三区鸳鸯浴| 秋霞国产午夜精品免费视频| 在线观看三级视频欧美| 一区二区在线免费| 欧美绝品在线观看成人午夜影视| 亚洲一区二区欧美激情| 欧美午夜电影网| 国产精品资源在线看| 日韩理论片网站| 日韩午夜激情免费电影| 天天操天天色综合| 欧美变态tickle挠乳网站| 精品亚洲免费视频| 亚洲欧美日韩国产综合| 欧美日韩国产免费一区二区 | 99re热这里只有精品免费视频 | 国产一区 二区| 综合久久一区二区三区| 欧美日韩国产色站一区二区三区| 一区二区三区在线高清| 久久这里只有精品6| 欧美性感一类影片在线播放| 久久精品国产成人一区二区三区| 国产日产欧美一区| 精品视频一区二区不卡| 久88久久88久久久| 亚洲成a人在线观看| 国产精品久久久久aaaa| 91精品国产一区二区人妖| 99久久精品99国产精品| 久久国产尿小便嘘嘘尿| 婷婷六月综合网| 亚洲激情五月婷婷| 国产欧美日韩久久| 亚洲精品一线二线三线| 欧美va亚洲va| 91精品免费在线| 在线不卡欧美精品一区二区三区| 成人禁用看黄a在线| 福利电影一区二区| 国产高清精品在线| 国产成人在线色| 国产成人精品午夜视频免费| 韩国中文字幕2020精品| 国产91丝袜在线18| 99免费精品在线| 91麻豆swag| 在线亚洲免费视频| 精品视频999| 亚洲精品一区二区三区影院 | 日韩亚洲欧美高清| 欧美一二区视频| 国产日产亚洲精品系列| 中文无字幕一区二区三区| 亚洲国产精品传媒在线观看| 樱花影视一区二区| 久久国产综合精品| 色94色欧美sute亚洲线路一久| 91视频精品在这里| 欧美日韩精品一区二区在线播放| 欧美性猛片xxxx免费看久爱| 欧美日本韩国一区| 精品国产乱码久久久久久浪潮| 久久影院视频免费| 三级亚洲高清视频| zzijzzij亚洲日本少妇熟睡| 欧美伊人久久久久久久久影院 | 久久婷婷国产综合国色天香|