|
用的workbench3.0
选的是SIMNTdiab,编译通过,但是下载.OUT文件的时候
提示如下:
“Please resolve following symbols before next download
semBSmCreate
smNameAdd”
不知道该如何解决,我是初学者一个。
源程序如下:
#include
#include "semLib.h"
#include "semSmLib.h"
#include "smNameLib.h"
#include "stdio.h"
#include "taskLib.h"
#include "semExample.h"
#include "sysLib.h"
/************************************************************************
*
* semTask1 - shared semaphore user
*
*/
STATUS semTask1 (void)
{
SEM_ID semSmId;
/* create shared semaphore */
if ((semSmId = semBSmCreate (SEM_Q_FIFO, SEM_FULL)) == NULL)
return (ERROR);
/* add object to name database */
if (smNameAdd (SEM_NAME, semSmId, T_SM_SEM_B) == ERROR)
return (ERROR);
/* grab shared semaphore and hold it for awhile */
semTake (semSmId, WAIT_FOREVER);
/* normally do something useful */
printf ("Task1 has the shared semaphore\n");
taskDelay (sysClkRateGet () * 5);
printf ("Task1 is releasing the shared semaphore\n");
/* release shared semaphore */
semGive (semSmId);
return (OK);
}
|
|