** 实验名:-红龙429-uCOS内存管理
** KEIL MDK-ARM Standard Version:V5.10
** 软件库(keil) Version: unused
** 固件库(ST) Version: 1.5.0
** 使用外设:
实验现象: 串口打印0-31递增的数据.
/**
*
@file main.c
*
@author WB R&D Team - openmcu666
*
@version V0.1
* @date 2016.2.29
* @brief Main Program body
*/
#include "UserTask.h"
extern OS_STK startup_task_stk[];//启动任务栈
void Delay(uint32_t
time)
{
uint32_t i;
i = 0;
while (Time--)
{
for (i = 0; i < 5000; i++);
}
}
/*****************************************************************************
** Main Function main()
******************************************************************************/
int main(void)
{
USART1_Init();
printf("rn");
printf("Hello Welcome.rn");
printf("Thank You For Choosing Our Products.rn");
printf("Thank You Very Much.rn");
printf("This Example is uCOS-II Semaphore.rn");
printf("rn");
printf("GPIO Initialization...rn");
LED_Init();
SysTick_Init();
printf("Ok,Let's Go...rn");
OSInit();
OSTaskCreate(Task_Start, //指向任务代码的指针
(void *)0, //任务开始执行时,传递给任务的参数parg
&startup_task_stk[STARTUP_TASK_STK_SIZE-1],//分配给任务的堆栈的栈顶指针
STARTUP_TASK_PRIO); //分配给任务的优先级
OSStart();
return 0;
}