I defined as follows with MC9S12XEP100 and using main CPU and XGATE.
#define SET_SEMPHR_XGATE(sem_id) while((!_ssem(sem_id))&&(UI_t)(t1msec-Xgsem_timer)<msec1)){};
#define CLR_SEMPHR_XGATE(sem_id) _csem(sem_id)
SET_SEMPHR_XGATE(0)
CLR_SEMPHR_XGATE(0)
But while compiling with IDE 5.1 it showing as follow warnings
warning: C1801 Implicit parameter declaration for '_ssem'
warning: C1801 Implicit parameter declaration for '_csem'
warning: C1420 Result of function call is ignored (showing at CLR_SEMPHR_XGATE(0) )
In example programs also _ssem & _csem are not available.
Please provide solution to eliminate all warnings as soon as possible.
Thank you,
Rajesh.
Hi Maddula,
You are right, it seems that _csem() and _csem() functions are not implemented in CW files – just defined in intrinsics_xgate.h file.
In fact, such functions may be quite redundant since they should do just single assembler commands.
You may use
asm SSEM #sem_id
instruction for semaphore locking try.
Additionally, you should check result whether semaphore was locked or not.
Similarly, you may use
asm CSEM #sem_id
for semaphore release.
Please look at attached simple example code.
I hope it helps you.
Best regards
Radek