[mw_shl_code=c,true] #include <stdio.h>[/mw_shl_code]
[mw_shl_code=c,true]#include "hw_config.h"
#include "stm32f10x.h"
#include <ucos_ii.h>
#include "os_cpu.h"
#include <cpu.h>
#include <app_cfg.h>
#include "usart.h"
#define APP_TASK_STK_SIZE 256
static OS_STK AppTaskStk[APP_TASK_STK_SIZE];
static OS_STK AppTask1Stk[APP_TASK1_STK_SIZE];
static OS_STK AppTask2Stk[APP_TASK2_STK_SIZE];
static void AppTaskCreate(void *p_arg);
static void AppTask1(void *p_arg);
static void AppTask2(void *p_arg);
INT8U err;
OS_EVENT *Str_Box;
char *s="Hollo!";
char* ss;
int main (void)
{
SysTick_Configuration();
USART_Configuration();
OSInit(); //usos ii??????
USART_Send_Str("Create Task Start;\r\n");
err = OSTaskCreate(AppTaskCreate,
(void *)0,
(OS_STK *)&AppTaskStk[APP_TASK_STK_SIZE-1],
0);
if(err==OS_NO_ERR)
{USART_Send_Str("AppTask Created seccess;\r\n");}
else
{USART_Send_Str("AppTask Created Fault;\r\n");}
USART_Send_Str("Create a Mbox;\r\n");
Str_Box=OSMboxCreate((void*)0);
OSStart();
}[/mw_shl_code]
[mw_shl_code=c,true]这一段代码和[/mw_shl_code]
[mw_shl_code=c,true]
[mw_shl_code=c,true]#include <stdio.h>
#include "hw_config.h"
#include "stm32f10x.h"
#include <ucos_ii.h>
#include "os_cpu.h"
#include <cpu.h>
#include <app_cfg.h>
#include "usart.h"
#define APP_TASK_STK_SIZE 256
static OS_STK AppTaskStk[APP_TASK_STK_SIZE];
static OS_STK AppTask1Stk[APP_TASK1_STK_SIZE];
static OS_STK AppTask2Stk[APP_TASK2_STK_SIZE];
static void AppTaskCreate(void *p_arg);
static void AppTask1(void *p_arg);
static void AppTask2(void *p_arg);
INT8U err;
int main (void)
{
SysTick_Configuration();
USART_Configuration();
OSInit();
err = OSTaskCreate(AppTaskCreate,
(void *)0,
(OS_STK *)&AppTaskStk[APP_TASK_STK_SIZE-1],
0);
if(err==OS_NO_ERR)
{USART_Send_Str("AppTask Created seccess;\r\n");}
else
{USART_Send_Str("AppTask Created Fault;\r\n");}
OSStart();
return 0 ;
}[/mw_shl_code]
这两段代码几乎一样的任务创建方式,而且都是同一个 工程里修改的,为什么上面的代码在串口显示失败,而下面的显示任务创建成功呢。。。求教[/mw_shl_code]
|