📄 main.c
字号:
/****************************************Copyright (c)****************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
**
** http://www.embedtools.com
**
**--------------File Info---------------------------------------------------------------------------------
** File name: main.c
** Last modified Date: 2004-09-16
** Last Version: 1.0
** Descriptions: The main() function example template
**
**--------------------------------------------------------------------------------------------------------
** Created by: Chenmingji
** Created date: 2004-09-16
** Version: 1.0
** Descriptions: The original version
**
**--------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
*********************************************************************************************************/
#include "main.h"
/*********************************************************************************************************
TASK0 任务ID、优先级、堆栈设置及函数声明
*********************************************************************************************************/
#define TASK0_ID 11 /* 任务的ID */
#define TASK0_PRIO TASK0_ID /* 任务的优先级 */
#define TASK0_STACK_SIZE 512 /* 定义用户堆栈长度 */
OS_STK TASK0_STACK[TASK0_STACK_SIZE]; /* 定义任务0 堆栈 */
void TASK0(void *pdata); /* 声明任务0 */
/*********************************************************************************************************
** Function name: main
** Descriptions: 主函数
** Input parameters: None
** output parameters: None
** Created Date:
*********************************************************************************************************/
int main (void)
{
OSInit();
OSTaskCreateExt(TASK0,
(void *)0,
&TASK0_STACK[TASK0_STACK_SIZE-1],
TASK0_PRIO,
TASK0_ID,
&TASK0_STACK[0],
TASK0_STACK_SIZE,
(void *)0,
OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);
OSStart();
return 0;
}
/*********************************************************************************************************
** Function name: TASK0
** Descriptions: None
** input parameters: None
** output parameters: None
*********************************************************************************************************/
void TASK0 (void *pdata)
{
pdata = pdata;
TargetInit();
ramdiskFormat(); /* 格式化存储区 */
usbDevInitialize(4); /* USB从机初始化 */
massDevInit(5); /* 大容量类从机初始化 */
while (1) {
OSTimeDly(OS_TICKS_PER_SEC);
}
}
/*********************************************************************************************************
END FILE
*********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -