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

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

?? app.c

?? 飛思卡爾HCS12的OS移植(ucosII),實現了三個任務,IDE:CODEWARRIOR
?? C
?? 第 1 頁 / 共 2 頁
字號:
* Description: This task displays messages on the Dragon12 (16x2) LCD screen and is
*              responsible for initializing the LCD hardware. Care MUST be taken to
*              ensure that the LCD hardware is initialized before other tasks
*              attempt to write to it. If necessary the DispInit() function
*              may be called from the start task or bsp_init().
*********************************************************************************************************
*/

static  void  LCD_TestTask (void *p_arg)
{
       CPU_INT08S  i;
       CPU_INT08U  err;
                                                                        /* Keypad Enabled Message                                   */
const  CPU_INT08U  KeypadEnStr[18]    = {"Keypad Enabled"};                     

                                                                        /* Keypad Disabled Message                                  */                       
const  CPU_INT08U  KeypadDisStr[18]   = {"Keypad Disabled"};                    

                                                                        /* Power On Welcome Message. three seperate msgs / rows     */
const  CPU_INT08U  WelcomeStr[6][18]  = {"Welcome to the", "Dragon 12 EVB.  ",                                                                          
                                         "This demo runs", "Micrium uC/OS-II",  
                                         "on a 48 MHz   ", "MC9S12DG256B CPU"}; 
    
                                                                        /* Define a message to scroll on the LCDs top line          */
const  CPU_INT08U  aboutStr[]         = {"Did you know that uC/OS-II can "
                                         "provide multi-tasking and "
                                         "real-time services to your "
                                         "embedded applications? In fact, "
                                         "uC/OS-II provides services "
                                         "such as task delays, "
                                         "semaphores, message mailboxes, "  
                                         "timers, event flags, memory "		
                                         "management, mutexes, queues, "
                                         "and much more! "
                                         };
                                         
   CPU_INT08U  *aboutStrPtr;                                            /* Declare a pointer to aboutStr, used for scroll effect    */
    
                                   
                                  

   (void)p_arg;
                   
    DispInit(2, 16);                                                    /* Initialize uC/LCD for a 2 row by 16 column display       */

             
    while (DEF_TRUE) {                                                  /* All tasks bodies include an infinite loop                */           
        DispClrScr();                                                   /* Start by clearing the screen                             */

        for (i = 0; i < 6; i+=2) {										/* With the Keypad task suspended, both LCD rows are avail. */
            DispStr(0, 0, WelcomeStr[i]);                               /* Display row 0 of Welcome Message i                       */
            DispStr(1, 0, WelcomeStr[i+1]);                             /* Display row 1 of Welcome Message i                       */        
            OSTimeDlyHMSM(0, 0, 2, 0);                                  /* Delay between updating the message                       */
        }        

        DispClrLine(1);                                                 /* Clear LCD ROW 1 before unblocking the keypad task        */
                
        OSFlagPost(keypadEnFlagGrp, 0x01, OS_FLAG_SET, &err);           /* Set flag bit 0 of the keypad enable flag group           */
                                                                        /* This will unblock the keypad task which will use the     */
                                                                        /* bottom row of the LCD while not disabled                 */
                                                                            
        while (err != OS_NO_ERR) {                                      /* If a flag posting error occured,                         */
            OSTimeDlyHMSM(0, 0, 1, 0);                                  /* delay and try again until NO ERROR is returned           */
            OSFlagPost(keypadEnFlagGrp, 0x01, OS_FLAG_SET, &err);       /* Set flag bit 0 of the keypad enable flag group           */
        }


        DispClrLine(0);                                                 /* Clear line 0 of the LCD                                  */
        for (i = 0; i < 3; i++) {                                       /* Blink the Keypad Enabled String 3 times                  */
            DispStr(0, 0, KeypadEnStr);                                 /* Display the Keypad Enabled message                       */     
            OSTimeDlyHMSM(0, 0, 0,500);                                 /* Show the message for a while                             */
            DispClrLine(0);                                             /* Next clear line 0 of the LCD                             */
            OSTimeDlyHMSM(0, 0, 0,500);                                 /* Lastly, wait a bit before repeating the message          */
        }

        aboutStrPtr = aboutStr;                                         /* Point to the start of the about message string           */

																		/* Start scrolling from right to left. This involves        */
        																/* starting from the last column and working toward the     */
                                                                        /* first column until the screen fills up. The remaining    */
                                                                        /* characters may start from position 0.                    */
        for (i = 15; i >= 0; i--) {										/* For the first 16 characters...                           */
            if (*aboutStrPtr != '\0') {						            /* If we have not reached the end of the string             */
                DispStr(0, i, aboutStrPtr);                             /* Display (col i - distance to end of lcd line) # of chars */
                OSTimeDlyHMSM(0, 0, 0, 100);                            /* Delay before updating the screen with the shifted msg    */             
            }
        }

        while ((aboutStr + sizeof(aboutStr) - aboutStrPtr) >  16) {     /* While there are greater than 16 chars left to display    */
            DispStr(0, 0, aboutStrPtr++);                               /* Display 16 chars and increment (shift) message by 1 char */
            OSTimeDlyHMSM(0, 0, 0, 100);                                /* Delay before displaying the shifted message              */
        }

        for (i = 15; i >= 0; i--) {										/* For the last 16 characters                               */
            if (*aboutStrPtr != '\0') {						            /* If we have not reached the end of the string             */
                DispStr(0, 0, aboutStrPtr++);                           /* Display (col i - distance to end of lcd line) # of chars */
                DispChar(0, i, ' ');                                    /* Leave spaces chars behind as the str scrolls off screen  */
                OSTimeDlyHMSM(0, 0, 0, 100);                            /* Delay before updating the screen with the shifted msg    */             
            }
        }
                
        DispClrLine(1);                                                 /* Clear LCD ROW 1 before blocking the keypad task          */
        
        OSFlagPost(keypadEnFlagGrp, 0x01, OS_FLAG_CLR, &err);           /* Disable the keypad task by clearing its event flag 0     */

        while (err != OS_NO_ERR) {                                      /* If an error occured (perhaps the flag group is not       */
            OSTimeDlyHMSM(0, 0, 1, 0);                                  /* initialized yet, then delay and try again until no error */
            OSFlagPost(keypadEnFlagGrp, 0x01, OS_FLAG_CLR, &err);       /* Clear flag bit 0 of the keypad enable flag group         */
        }        
        
        DispClrScr();                                                   /* Clear the screen                                         */
        for (i = 0; i < 3; i++) {                                       /* Blink the Keypad Disabled String 3 times                 */
            DispStr(0, 0, KeypadDisStr);                                /* Display the Keypad Disabled message                      */     
            OSTimeDlyHMSM(0, 0, 0,500);                                 /* Show the message for a while                             */
            DispClrLine(0);                                             /* Next clear line 0 of the LCD                             */
            OSTimeDlyHMSM(0, 0, 0,500);                                 /* Lastly, wait a bit before repeating the message          */
        }          
    }
}


/*$PAGE*/
/*
*********************************************************************************************************
*                                             SevenSegWriteTask
*
* Description: This task displays messages on the Dragon12 (16x2) LCD screen
*********************************************************************************************************
*/

static  void  SevenSegTestTask (void *p_arg)
{
    CPU_INT16U  num;


   (void)p_arg;
   
    SevenSegDisp_Init();	                                            /* Initialize the 7-Seg I/O and periodic refresh interrupt  */
    
    num = 0;
        
    while (DEF_TRUE) {                                                  /* All tasks bodies include an infinite loop                */   
        SevenSegWrite(num);                                             /* Output the value to the screen                           */        
        num = ((num + 1) % 10000);                                      /* Increment the # being displayed, wrap after 9,999        */
        OSTimeDlyHMSM(0, 0, 0, 10);                                     /* Delay the task for 50ms and repeat the process           */
    }
}


/*$PAGE*/
/*
*********************************************************************************************************
*                                             Keypad Read Task
*
* Description: This task periodically reads the Wytec Dragon12 EVB keyapd and
*              displays the value on the bottom row of the LCD screen.
*********************************************************************************************************
*/

static  void  KeypadRdTask (void *p_arg)
{
    CPU_INT08U  key;
    CPU_INT08U  out_str[17];
    CPU_INT08U  key_map[] = {'1', '2', '3', 'A',
                             '4', '5', '6', 'B', 
                             '7', '8', '9', 'C',
                             '*', '0', '#', 'D'
                             };
    CPU_INT08U  err;
        

   (void)p_arg;
       
    KeypadInitPort();                                                   /* Initialize the keypad hardware                           */
    
    keypadEnFlagGrp = OSFlagCreate(0, &err);                            /* Create an event flag group. All flags initialized to 0   */
        
    while (err != OS_NO_ERR) {                                          /* If an error code was returned, loop until successful     */
        OSTimeDlyHMSM(0, 0, 1, 0);				                        /* Delay for 1 second, wait for resources to be freed       */
        keypadEnFlagGrp = OSFlagCreate(0, &err);                        /* Try to create the flag group again                       */
    }
    
    OSFlagPend(keypadEnFlagGrp, 0x01, OS_FLAG_WAIT_SET_ALL, 0, &err);   /* Wait until bit 1 of the flag group to become set         */
                                                                        /* The goal is to prevent this task from accessing the      */
                                                                        /* bottom row of the LCD until the LCD task has finished    */
                                                                        /* displaying its introduction message. This message will   */
                                                                        /* require both lines of the LCD, so we must wait to use it */
            
    DispClrLine(1);                                                     /* Clear the bottom line of the 2 line display              */
                
    while (DEF_TRUE) {                                                  /* All tasks bodies include an infinite loop                */   
        OSFlagPend(keypadEnFlagGrp, 0x01, OS_FLAG_WAIT_SET_ALL,0,&err); /* Suspend the task if flag 0 has been cleared              */
        key = KeypadReadPort();                                         /* Scan the keypad. Returns 0-15 or 0xFF if nothing pushed  */
        if (key == 0xFF) {            
            err = sprintf(out_str, "Keypad is IDLE");                   /* Write "You Pressed" and the key number 'n' to a string   */      
        } else {
            err = sprintf(out_str, "You Pressed: %c", key_map[key]);    /* Write "You Pressed" and the key number 'n' to a string   */      
        }
        
        DispStr(1, 0, out_str);                                         /* Display the keypad message on row 1 of the LCD screen    */        
        OSTimeDlyHMSM(0, 0, 0,100);                                     /* Read the keypad every 100ms                              */
    }
}



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区四区| 欧美日韩一区中文字幕| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 精品国产3级a| 欧洲亚洲国产日韩| 99re热视频精品| 国产精品99久久不卡二区| 日本不卡1234视频| 亚洲.国产.中文慕字在线| 亚洲免费成人av| 亚洲人精品午夜| 国产精品麻豆欧美日韩ww| 日韩一区二区中文字幕| 欧美一区二视频| 精品视频免费在线| 欧美在线色视频| 欧美性猛片xxxx免费看久爱| 成熟亚洲日本毛茸茸凸凹| 婷婷综合五月天| 亚洲成人激情综合网| 亚洲精品国产一区二区精华液| 国产精品国产自产拍高清av | 26uuu另类欧美亚洲曰本| 在线成人午夜影院| 日韩一本二本av| 日韩女同互慰一区二区| 亚洲国产精品黑人久久久| 大白屁股一区二区视频| 国产成人在线网站| 成人福利视频网站| 琪琪久久久久日韩精品| 久久99精品国产91久久来源| 久久99精品一区二区三区| 久久精品国产精品亚洲精品| 精品一区二区免费在线观看| 日本不卡123| 久久成人羞羞网站| 国产精品一区二区免费不卡| 国产成人av电影在线| 国产真实乱子伦精品视频| 国产成人免费视频网站| av一二三不卡影片| 在线观看日韩电影| 欧美丰满美乳xxx高潮www| 91精品国产入口| 精品蜜桃在线看| 国产精品嫩草影院av蜜臀| 一区二区三区四区av| 亚洲精品videosex极品| 日韩精品午夜视频| 国产毛片精品国产一区二区三区| 国产jizzjizz一区二区| 国产乱人伦偷精品视频免下载 | av在线这里只有精品| 久久亚区不卡日本| 国产精品乱人伦| 亚洲一区在线播放| 秋霞电影一区二区| 成人高清av在线| 91精品国产综合久久精品性色| 久久理论电影网| 亚洲欧美aⅴ...| 九色综合狠狠综合久久| a在线欧美一区| 欧美一级二级三级蜜桃| 日韩亚洲欧美高清| 亚洲欧洲三级电影| 日本美女一区二区三区视频| 成人一级黄色片| 91美女福利视频| 欧美电影免费观看高清完整版| 欧美激情一区二区三区四区| 亚洲福利一区二区三区| 国产一区二区三区四区在线观看| 色婷婷久久综合| 久久综合中文字幕| 亚洲五码中文字幕| 国产精品456| 欧美精品乱人伦久久久久久| 国产午夜精品一区二区| 午夜私人影院久久久久| 成人国产精品免费网站| 在线电影院国产精品| 中文字幕在线一区二区三区| 免费亚洲电影在线| 色综合久久中文综合久久97| 国产片一区二区三区| 激情欧美日韩一区二区| 欧美成人一区二区三区| 日韩av一区二区三区四区| 欧美丝袜丝交足nylons| 亚洲综合免费观看高清完整版| 成人黄动漫网站免费app| 国产午夜亚洲精品不卡| 国产一区欧美二区| 精品不卡在线视频| 久久国产精品第一页| 欧美一区二区在线看| 亚洲成人精品影院| 91麻豆精品久久久久蜜臀| 777奇米四色成人影色区| 国产99久久久国产精品潘金网站| 日韩一区二区三区在线| 看片网站欧美日韩| 日韩欧美中文一区| 久久99久久精品欧美| 欧美成人三级在线| 欧美午夜精品理论片a级按摩| 亚洲激情五月婷婷| 欧美午夜电影网| 午夜电影网一区| 日韩一区二区中文字幕| 狠狠久久亚洲欧美| 国产欧美日韩另类视频免费观看| 成人免费高清在线| 自拍偷拍国产亚洲| 欧美午夜不卡在线观看免费| 天天亚洲美女在线视频| 91精品国产美女浴室洗澡无遮挡| 另类的小说在线视频另类成人小视频在线 | 97久久精品人人澡人人爽| 亚洲天堂2014| 欧美视频一二三区| 免费一级欧美片在线观看| 久久男人中文字幕资源站| 99天天综合性| 亚洲成人你懂的| 精品免费国产一区二区三区四区| 国产福利一区在线观看| 亚洲男人的天堂在线观看| 欧美精品三级在线观看| 国产精品自产自拍| 亚洲视频在线观看三级| 欧美日韩中文字幕一区二区| 蜜桃精品在线观看| 国产亚洲自拍一区| 欧洲精品在线观看| 精品一区二区三区蜜桃| 国产精品视频免费看| 欧美性猛片aaaaaaa做受| 精品亚洲免费视频| 亚洲色大成网站www久久九九| 欧美美女bb生活片| 国产一区二区三区四| 一区二区三区久久久| 精品国产一区二区精华| 91看片淫黄大片一级在线观看| 天堂蜜桃91精品| 日韩视频免费观看高清在线视频| 国产99精品在线观看| 亚洲国产你懂的| 精品国产区一区| 一本色道**综合亚洲精品蜜桃冫| 日本不卡中文字幕| 国产精品传媒入口麻豆| 91精品综合久久久久久| 成人高清免费观看| 男女男精品视频| 亚洲美女区一区| 久久香蕉国产线看观看99| 精品视频免费在线| 成人国产精品视频| 久久99日本精品| 亚洲网友自拍偷拍| 中文成人av在线| 欧美一级欧美一级在线播放| 99r国产精品| 国产一区视频在线看| 午夜激情一区二区三区| 亚洲天堂中文字幕| 久久影院视频免费| 69av一区二区三区| 色综合天天综合| 国产成人午夜片在线观看高清观看| 亚洲成人在线免费| 亚洲男同性恋视频| 中文字幕精品—区二区四季| 日韩美女在线视频| 欧美日韩精品系列| 97久久精品人人澡人人爽| 国产盗摄一区二区| 久久99国产精品尤物| 亚洲成av人在线观看| 一区二区在线免费观看| 国产精品天美传媒| 26uuu色噜噜精品一区| 日韩一区二区三区视频在线观看 | 91精品国产美女浴室洗澡无遮挡| 91小视频免费观看| 99免费精品在线| 国产成a人亚洲精品| 国产精品一区二区免费不卡| 蜜桃视频一区二区三区在线观看| 午夜精品aaa| 天堂va蜜桃一区二区三区漫画版| 一区二区在线观看不卡| 国产精品不卡视频| 中文字幕一区二区三区在线播放| 日本一区二区三区久久久久久久久不| 精品少妇一区二区三区在线视频|