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

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

?? app_main.c

?? UCOSII在mcs12dg128上的移植
?? C
字號:
//==================================================================================================
//| 文件名稱 | APP_MAIN.c
//|--------- |--------------------------------------------------------------------------------------
//| 文件描述 | 系統(tǒng)
//|--------- |--------------------------------------------------------------------------------------
//| 運行環(huán)境 | 所有C/++語言編譯器,包括單片機編譯器
//|--------- |--------------------------------------------------------------------------------------
//| 版權(quán)聲明 | Copyright2008
//|----------|--------------------------------------------------------------------------------------
//|  版本    |  時間       |  作者     | 描述
//|--------- |-------------|-----------|------------------------------------------------------------
//|  V1.0    | 2008.08.18 | chen       | 初版
//==================================================================================================


#define  APP_MAIN_GLOBALS
#include "..\sources\application\Include.h"

void main (void)
{
	DDRB_BIT0=1;
	DDRT_DDRT4=1; 
	DDRP_DDRP3=1;
    TASK_LED_BLUE=OFF;
   	TASK_LED_RED=OFF;
    TASK_LED_YELLOW=OFF;
	PLLINIT(24,5);		//25M總線頻率
    OSInit();                               /* Initialize "uC/OS-II, The Real-Time Kernel"             */
	OSTaskCreateExt(AppStartTask,
    			    (void *)0,
    			    (OS_STK *)&AppStartTaskStk[TASK_STK_SIZE-1],
    			    TASK_START_PRIO,
    			    TASK_START_PRIO,
    			    (OS_STK *)&AppStartTaskStk[0],
    			    TASK_STK_SIZE,
    			    (void *)0,
                    OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);  
    OSStart();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                          STARTUP TASK
*
* Description : This is an example of a startup task.  As mentioned in the book's text, you MUST
*               initialize the ticker only once multitasking has started.
* Arguments   : pdata   is the argument passed to 'AppStartTask()' by 'OSTaskCreate()'.
* Notes       : 1) The first line of code is used to prevent a compiler warning because 'pdata' is not
*                  used.  The compiler should not generate any code for this statement.
*               2) Interrupts are enabled once the task start because the I-bit of the CCR register was
*                  set to 0 by 'OSTaskCreate()'.
*********************************************************************************************************
*/

static void  AppStartTask (void *pdata)
{
    pdata = pdata;
    AppTickInit();                          /* Initialize the ticker                                   */
    OSStatInit();  	//Initialize the stat task.
    TrafficFlag=OSFlagCreate(0,err); //creat a semphore
    OSTaskCreateExt(AppTaskRedLed,
    			    (void *)0,
    			    (OS_STK *)&AppTaskRedLedStk[TASK_STK_SIZE-1],
    			    TASK_REDLED_PRIO,
    			    TASK_REDLED_PRIO,
    			    (OS_STK *)&AppTaskRedLedStk[0],
    			    TASK_STK_SIZE,
    			    (void *)0,
                    OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR); 
    OSTaskCreateExt(AppTaskBlueLed,
    			    (void *)0,
    			    (OS_STK *)&AppTaskBlueLedStk[TASK_STK_SIZE-1],
    			    TASK_BLUELED_PRIO,
    			    TASK_BLUELED_PRIO,
    			    (OS_STK *)&AppTaskBlueLedStk[0],
    			    TASK_STK_SIZE,
    			    (void *)0,
                    OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);  
    OSTaskCreateExt(AppTaskYellowLed,
    			    (void *)0,
    			    (OS_STK *)&AppTaskYellowLedStk[TASK_STK_SIZE-1],
    			    TASK_YELLOWLED_PRIO,
    			    TASK_YELLOWLED_PRIO,
    			    (OS_STK *)&AppTaskYellowLedStk[0],
    			    TASK_STK_SIZE,
    			    (void *)0,
                    OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);                                    
    while (TRUE) 
    {                          /* Task body, always written as an infinite loop.          */
   		TASK_LED_BLUE=OFF;
   		TASK_LED_RED=OFF;
    	TASK_LED_YELLOW=OFF;
    	OSFlagPost(TrafficFlag,BIT0MASK,OS_FLAG_SET,err);	//清除標志位0
		OSTaskSuspend(TASK_START_PRIO);
    }
}
/*
*********************************************************************************************************
*                                          AppTaskRedLed
*
* Description : This is a task to control red led which use a synchronize samphore. 
* Arguments   : pdata   is the argument passed to 'AppTaskRedLed()' by 'OSTaskCreate()'.
* Notes       : 1) The first line of code is used to prevent a compiler warning because 'pdata' is not
*                  used.  The compiler should not generate any code for this statement.
*               2) Interrupts are enabled once the task start because the I-bit of the CCR register was
*                  set to 0 by 'OSTaskCreate()'.
*********************************************************************************************************
*/

static void  AppTaskRedLed (void *pdata)
{
    pdata = pdata;
    while (TRUE) 
    {                          /* Task body, always written as an infinite loop.          */
    	OSFlagPend(TrafficFlag,BIT0MASK,OS_FLAG_WAIT_SET_ALL|OS_FLAG_CONSUME,0,err);
    	TASK_LED_RED=ON;
    	TASK_LED_BLUE=OFF;
    	TASK_LED_YELLOW=OFF;     	
    	OSTimeDlyHMSM(0, 0, 5, 0);
    	OSFlagPost(TrafficFlag,BIT1MASK,OS_FLAG_SET,err);
    }
} 

/*
*********************************************************************************************************
*                                          AppTaskBlueLed
*
* Description : This is a task to control blue led which use a synchronize samphore. 
* Arguments   : pdata   is the argument passed to 'AppTaskRedLed()' by 'OSTaskCreate()'.
* Notes       : 1) The first line of code is used to prevent a compiler warning because 'pdata' is not
*                  used.  The compiler should not generate any code for this statement.
*               2) Interrupts are enabled once the task start because the I-bit of the CCR register was
*                  set to 0 by 'OSTaskCreate()'.
*********************************************************************************************************
*/

static void  AppTaskBlueLed (void *pdata)
{
    pdata = pdata;
    while (TRUE) 
    {                          /* Task body, always written as an infinite loop.          */
    	OSFlagPend(TrafficFlag,BIT1MASK,OS_FLAG_WAIT_SET_ALL|OS_FLAG_CONSUME,0,err);
    	TASK_LED_RED=OFF;
    	TASK_LED_BLUE=ON;
    	TASK_LED_YELLOW=OFF;
    	OSTimeDlyHMSM(0, 0, 4, 0);
    	OSFlagPost(TrafficFlag,BIT2MASK,OS_FLAG_SET,err);
    }
}  

/*
*********************************************************************************************************
*                                          AppTaskYellowLed
*
* Description : This is a task to control red led which use a synchronize samphore. 
* Arguments   : pdata   is the argument passed to 'AppTaskRedLed()' by 'OSTaskCreate()'.
* Notes       : 1) The first line of code is used to prevent a compiler warning because 'pdata' is not
*                  used.  The compiler should not generate any code for this statement.
*               2) Interrupts are enabled once the task start because the I-bit of the CCR register was
*                  set to 0 by 'OSTaskCreate()'.
*********************************************************************************************************
*/

static void  AppTaskYellowLed (void *pdata)
{
	int i;
    pdata = pdata;
    while (TRUE) 
    {                          /* Task body, always written as an infinite loop.          */
		OSFlagPend(TrafficFlag,BIT2MASK,OS_FLAG_WAIT_SET_ALL|OS_FLAG_CONSUME,0,err);
    	TASK_LED_RED=OFF;
    	TASK_LED_BLUE=OFF;
    	for(i=0;i<5;i++) 
    	{
    		TASK_LED_YELLOW=ON;
    		OSTimeDlyHMSM(0, 0, 0, 100);
    		TASK_LED_YELLOW=OFF;
    		OSTimeDlyHMSM(0, 0, 0, 100);	
    	}    
		OSFlagPost(TrafficFlag,BIT0MASK,OS_FLAG_SET,err);
    }
}  
 
/*$PAGE*/
/*
*********************************************************************************************************
*                                      TICKER INITIALIZATION
*
* Description : This function is used to initialize one of the eight output compares to generate an
*               interrupt at the desired tick rate.  You must decide which output compare you will be
*               using by setting the configuration variable OS_TICK_OC (see OS_CFG.H and also OS_CPU_A.S) 
*               to 0..7 depending on which output compare to use.
*                   OS_TICK_OC set to 0 chooses output compare #0 as the ticker source
*                   OS_TICK_OC set to 1 chooses output compare #1 as the ticker source
*                   OS_TICK_OC set to 2 chooses output compare #2 as the ticker source
*                   OS_TICK_OC set to 3 chooses output compare #3 as the ticker source
*                   OS_TICK_OC set to 4 chooses output compare #4 as the ticker source
*                   OS_TICK_OC set to 5 chooses output compare #5 as the ticker source
*                   OS_TICK_OC set to 6 chooses output compare #6 as the ticker source
*                   OS_TICK_OC set to 7 chooses output compare #7 as the ticker source
* Arguments   : none
* Notes       : 1) It is assumed that you have set the prescaler rate of the free running timer within
*                  the first 64 E clock cycles of the 68HC12.
*               2) CPU registers are define in 6812dp256.h (see Metrowerks codewarrior compiler)
*********************************************************************************************************
*/

static void AppTickInit (void)
{
    TSCR2|=3; //預(yù)分頻器輸出時鐘頻率為P時鐘的1/8,定時器溢出時間為21.97ms 
   	TSCR1   = 0x80;                         /* Enable timer*/
        
#if OS_TICK_OC == 0
    TIOS  |= 0x01;                          /* Make channel an output compare                          */
    TC0    = TCNT + OS_TICK_OC_CNTS;        /* Set TC0 to present time + OS_TICK_OC_CNTS               */
    TCTL1  |= 0x01;	              			/* set timer control reg */
    TIE |= 0x01;                          /* Enable OC0 interrupt.                                   */
#endif

#if OS_TICK_OC == 1 
    TIOS  |= 0x02;                          /* Make channel an output compare                          */
    TC1    = TCNT + OS_TICK_OC_CNTS;        /* Set TC1 to present time + OS_TICK_OC_CNTS               */
    TCTL1  |= 0x02;	              			/* set timer control reg */
    TIE |= 0x02;                          /* Enable OC1 interrupt.                                   */
#endif

#if OS_TICK_OC == 2
    TIOS  |= 0x04;                          /* Make channel an output compare                          */
    TC2    = TCNT + OS_TICK_OC_CNTS;        /* Set TC2 to present time + OS_TICK_OC_CNTS               */
    TCTL1  |= 0x04;	              			/* set timer control reg */
    TIE |= 0x04;                          /* Enable OC2 interrupt.                                   */
#endif

#if OS_TICK_OC == 3
    TIOS  |= 0x08;                          /* Make channel an output compare                          */
    TC3    = TCNT + OS_TICK_OC_CNTS;        /* Set TC3 to present time + OS_TICK_OC_CNTS               */
    TCTL1  |= 0x08;	              			/* set timer control reg */
    TIE |= 0x08;                          /* Enable OC3 interrupt.                                   */
#endif

#if OS_TICK_OC == 4
    TIOS  |= 0x10;                          /* Make channel an output compare                          */
    TC4    = TCNT + OS_TICK_OC_CNTS;        /* Set TC4 to present time + OS_TICK_OC_CNTS               */
    TCTL1  |= 0x10;	              			/* set timer control reg */
    TIE |= 0x10;                          /* Enable OC4 interrupt.                                   */
#endif

#if OS_TICK_OC == 5
    TIOS  |= 0x20;                          /* Make channel an output compare                          */
    TC5    = TCNT + OS_TICK_OC_CNTS;        /* Set TC5 to present time + OS_TICK_OC_CNTS               */
    TCTL1  |= 0x20;	              			/* set timer control reg */
    TIE |= 0x20;                          /* Enable OC5 interrupt.                                   */
#endif

#if OS_TICK_OC == 6
    TIOS  |= 0x40;                          /* Make channel an output compare                          */
    TC6    = TCNT + OS_TICK_OC_CNTS;        /* Set TC6 to present time + OS_TICK_OC_CNTS */
    TCTL1  |= 0x40;	              			/* set timer control reg */
    TIE |= 0x40;                          /* Enable OC6 interrupt.                                   */
#endif

#if OS_TICK_OC == 7
    TIOS  |= 0x80;                          /* Make channel an output compare                          */
    TC7    = TCNT + OS_TICK_OC_CNTS;
    TCTL1  |= 0x80;							/* set timer control reg */
    TIE |= 0x80;                          /* Enable OC7 interrupt. */
   								                             
#endif
}

/******************************************************************
*函數(shù)名:PLLINIT
*入口參數(shù)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品在线播放| 亚洲女人****多毛耸耸8| 国产主播一区二区| 亚洲成人免费在线观看| 亚洲视频一二三| 亚洲免费观看高清完整版在线| 日韩二区三区四区| 免费看日韩精品| 久久99精品国产麻豆婷婷洗澡| 国产在线不卡视频| 大胆亚洲人体视频| 成人自拍视频在线| 欧美zozo另类异族| 久久综合色播五月| 久久精品人人做人人爽97| 99久久久久久| 久久久久国产精品麻豆ai换脸| 日韩欧美高清在线| 欧美成人vps| 亚洲一区二区成人在线观看| 日韩国产精品久久久| 91视视频在线直接观看在线看网页在线看 | 免费在线视频一区| 色综合久久中文字幕综合网| 一本到一区二区三区| 中文字幕免费在线观看视频一区| 国产精品美女久久久久久久久 | 欧美色图在线观看| 国产成人日日夜夜| 狠狠色狠狠色综合| 制服丝袜亚洲色图| 久久久久9999亚洲精品| 美女www一区二区| 欧美一区二区黄| 国产精品免费免费| 成人小视频免费观看| 国产欧美精品一区| 五月婷婷激情综合| 波多野结衣中文字幕一区二区三区| 欧美日韩一区高清| 亚洲成人资源在线| 日韩你懂的在线观看| 久久国产精品72免费观看| 91在线观看地址| 亚洲精品中文字幕在线观看| 精品一区二区三区在线播放| 精品国产制服丝袜高跟| 亚洲第一久久影院| 欧美日韩不卡一区| √…a在线天堂一区| 极品少妇一区二区三区精品视频| 精品美女在线观看| 国产一区二区不卡在线| 亚洲欧美怡红院| 欧美综合色免费| 中文字幕乱码久久午夜不卡| jiyouzz国产精品久久| 日韩午夜激情电影| 国产欧美一区二区精品性色| 国产成+人+日韩+欧美+亚洲| 欧美电影免费观看高清完整版在线 | 99久久精品费精品国产一区二区| 亚洲男人天堂一区| 91精品国产全国免费观看| 国产一区免费电影| 中文字幕日韩欧美一区二区三区| 色综合久久天天| 免费成人你懂的| 欧美国产一区在线| 欧美日韩免费不卡视频一区二区三区| 另类小说综合欧美亚洲| 国产精品欧美久久久久一区二区| 欧美视频一区在线| 国产成人免费视| 婷婷久久综合九色国产成人| 国产欧美1区2区3区| 欧美日韩久久久久久| 国产高清精品在线| 首页综合国产亚洲丝袜| 色94色欧美sute亚洲13| 最好看的中文字幕久久| 日韩一区二区在线看| 91久久精品午夜一区二区| 国内精品久久久久影院色| 亚洲一区二区三区美女| 中文一区在线播放| 日韩精品一区二| 欧美午夜精品久久久久久孕妇| 国产ts人妖一区二区| 日韩精品成人一区二区三区| 亚洲精品国产精品乱码不99| 久久综合狠狠综合| 欧美一级xxx| 欧美日本国产一区| 91在线视频播放地址| 国产乱码精品一区二区三区五月婷| 精品国产91久久久久久久妲己 | 69堂亚洲精品首页| 91麻豆高清视频| 国产a久久麻豆| 国产美女av一区二区三区| 亚欧色一区w666天堂| 樱花草国产18久久久久| 国产精品情趣视频| 国产精品第四页| 欧美日韩在线精品一区二区三区激情| 成人黄色软件下载| 高清不卡一区二区| 国产精品夜夜嗨| 国产中文字幕一区| 激情综合亚洲精品| 国产精品一区久久久久| 激情久久久久久久久久久久久久久久| 日韩精品成人一区二区在线| 日韩精品三区四区| 人禽交欧美网站| 美女在线一区二区| 韩国一区二区在线观看| 国产美女一区二区三区| 国产乱码精品一区二区三区av| 国产九色sp调教91| 国产ts人妖一区二区| caoporen国产精品视频| 972aa.com艺术欧美| 在线观看av不卡| 欧美精品777| 91网站最新地址| 91国在线观看| 欧美日韩高清一区二区三区| 国产精品白丝在线| 国产精品美女久久久久aⅴ| 国产精品国产三级国产普通话99| 亚洲欧美日韩中文字幕一区二区三区| 中文字幕一区二区三区在线不卡 | 成人av在线影院| 99精品久久只有精品| 91福利精品视频| 欧美日韩国产中文| 久久这里只有精品6| 国产精品灌醉下药二区| 亚洲尤物视频在线| 麻豆freexxxx性91精品| 成人性视频免费网站| 欧美无乱码久久久免费午夜一区 | 久久精品久久精品| 国产馆精品极品| 91精品福利在线| 精品乱人伦小说| 亚洲色图制服丝袜| 日本va欧美va欧美va精品| 国产乱人伦精品一区二区在线观看 | 欧美一区二区日韩| 91免费小视频| 精品污污网站免费看| 日韩欧美精品在线视频| 久久蜜桃一区二区| 亚洲美女偷拍久久| 免费在线视频一区| 色狠狠av一区二区三区| 欧美成人精品3d动漫h| 中文字幕精品—区二区四季| 亚洲超碰97人人做人人爱| 国内精品久久久久影院一蜜桃| 91麻豆精品一区二区三区| 欧美大片在线观看| 亚洲精品国产高清久久伦理二区| 另类调教123区| 日本乱人伦一区| 国产情人综合久久777777| 午夜免费久久看| 91热门视频在线观看| 久久综合中文字幕| 狠狠色丁香婷婷综合| 国产91在线看| 欧美一级理论片| 日本在线不卡视频一二三区| 成人精品一区二区三区中文字幕| 宅男噜噜噜66一区二区66| 一区二区三区免费在线观看| 亚洲国产岛国毛片在线| 视频在线在亚洲| 色www精品视频在线观看| 中文字幕av一区二区三区免费看| 久久99精品久久久久久动态图 | 99精品热视频| 国产亚洲欧美日韩在线一区| 另类小说一区二区三区| 91精品国产色综合久久久蜜香臀| 亚洲美女淫视频| 色婷婷激情综合| 综合精品久久久| 99久久er热在这里只有精品15| 国产午夜精品久久久久久免费视| 蜜桃av一区二区在线观看| 欧美人伦禁忌dvd放荡欲情| 一区二区三区不卡视频在线观看 | 国产在线播放一区| 欧美不卡123| 国内精品久久久久影院薰衣草| 日韩精品一区国产麻豆|