This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/AM3358: Semaphore creation

Part Number: AM3358
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

There  are at least two way to create semaphore

 /* Create call back semaphore */

SPI_osalSemParamsInit(&cbSemParams);

cbSemParams.mode = SemaphoreP_Mode_BINARY;

SemaphoreP_Handle cbSem = SPI_osalCreateBlockingLock(0, &cbSemParams);

and

Semaphore_Handle sem_id;

Semaphore_Params params;

int16_t count = (state == Sem_State_Full) ? 1 : 0;

Semaphore_Params_init(&params);

if(order == Sem_Order_Fifo)

{

params.mode = ti_sysbios_knl_Semaphore_Mode_BINARY;

}

else

{

params.mode = ti_sysbios_knl_Semaphore_Mode_BINARY_PRIORITY;

}

Sem_Id_Type sem_id = Semaphore_create(count, &params, &eb);

What is their difference? Thanks