在移植Ucosii时,修改完程序后编译出现.\Obj\1116.axf: Error: L6218E: Undefined symbol OSTaskCreate (referred from main.o).的错误提示。程序如下:
#include "ucos_ii.h"
#include "stm32f10x.h"
static OS_STK startup_task_stk[STARTUP_TASK_STK_SIZE];
static void systick_init(void)
{
RCC_ClocksTypeDef rcc_clocks;
RCC_GetClocksFreq(&rcc_clocks);
SysTick_Config(rcc_clocks.HCLK_Frequency / OS_TICKS_PER_SEC);
}
static void startup_task(void *p_arg)
{
systick_init(); /* Initialize the SysTick. */
#if (OS_TASK_STAT_EN > 0)
OSStatInit(); /* Determine CPU capacity. */
#endif /* TODO: create application tasks here */
OSTaskDel(OS_PRIO_SELF);
}
int main(void)
{
OSInit();
OSTaskCreate(startup_task, (void *)0, &startup_task_stk[STARTUP_TASK_STK_SIZE - 1],
STARTUP_TASK_PRIO);
OSStart();
return 0;
} |