?? main.c
字號:
/****************************************Copyright (c)****************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
**
** http://www.embedtools.com
**
**--------------File Info---------------------------------------------------------------------------------
** File Name: Main.c
** Last modified Date: 2007.12.12
** Last Version: v1.0
** Description: The main function example template 主函數(shù)例子模版
**
**--------------------------------------------------------------------------------------------------------
** Created By: Steven Zhou 周紹剛
** Created date: 2007.12.12
** Version: v1.0
** Descriptions: The original version 初始版本
**
**--------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Description:
**
*********************************************************************************************************/
#include <includes.h>
/*********************************************************************************************************
CONSTANTS 常量
*********************************************************************************************************/
/*********************************************************************************************************
VARIABLES 變量
*********************************************************************************************************/
static OS_STK GstkStart[TASK_START_STK_SIZE]; /* The stack of start task */
/* 啟動任務(wù)的堆棧 */
/*********************************************************************************************************
FUNCTION PROTOTYPES 函數(shù)聲明
*********************************************************************************************************/
static void taskStart (void *parg); /* The start task 啟動任務(wù) */
/*********************************************************************************************************
** Function name: main
** Descriptions: 該范例程序使用uC/OS做簡單任務(wù)去LED閃爍,以掌握uC/OS-II創(chuàng)建任務(wù)程序的編寫.
** input parameters: 無
** output parameters: 無
** Returned value: 0
** Created by: Steven Zhou 周紹剛
** Created Date: 2007.12.12
**--------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**--------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
int main (void)
{
intDisAll(); /* Disable all the interrupts */
/* 關(guān)閉所有中斷 */
OSInit(); /* Initialize the kernel of uC */
/* OS-II 初始化uC/OS-II的內(nèi)核 */
OSTaskCreate( taskStart,
(void *)0,
&GstkStart[TASK_START_STK_SIZE-1],
TASK_START_PRIO ); /* Initialize the start task */
/* 初始化啟動任務(wù) */
OSStart(); /* Start uC/OS-II 啟動uC/OS-II*/
return(0);
}
/*********************************************************************************************************
** Function name: Task_Start
** Descriptions: Start task
** input parameters: *p_arg
** output parameters: 無
** Returned value: 無
** Created by: Steven Zhou 周紹剛
** Created Date: 2007.01.18
**--------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
**--------------------------------------------------------------------------------------------------------
*********************************************************************************************************/
static void taskStart (void *parg)
{
(void)parg;
targetInit(); /* Initialize the target's MCU */
/* 初始化目標(biāo)單片機(jī) */
#if OS_TASK_STAT_EN > 0
OSStatInit(); /* Enable statistics */
/* 使能統(tǒng)計(jì)功能 */
#endif
/*
* Create the other tasks here. 在這里創(chuàng)建其他任務(wù)
*/
while (1) {
/*
* OSTaskSuspend(OS_PRIO_SELF);
* The start task can be pended here. 啟動任務(wù)可在這里掛起
*/
}
}
/*********************************************************************************************************
The other tasks 其他任務(wù)
*********************************************************************************************************/
/*
* Add the other tasks here . 在這里增加其他任務(wù)
*/
/*********************************************************************************************************
END FILE
*********************************************************************************************************/
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -