Add SemWaitI() to FreeRTOS
This commit is contained in:
parent
6f54bde79c
commit
58cf2d2b35
@ -107,6 +107,20 @@ bool_t gfxSemWait(gfxSem* psem, delaytime_t ms)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool_t gfxSemWaitI(gfxSem* psem)
|
||||
{
|
||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
psem->counter--;
|
||||
|
||||
if (xSemaphoreTakeFromISR(psem->sem,&xHigherPriorityTaskWoken) == pdTRUE)
|
||||
return TRUE;
|
||||
|
||||
psem->counter++;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void gfxSemSignal(gfxSem* psem)
|
||||
{
|
||||
taskENTER_CRITICAL();
|
||||
|
@ -94,6 +94,7 @@ void gfxSleepMicroseconds(delaytime_t ms);
|
||||
void gfxSemInit(gfxSem* psem, semcount_t val, semcount_t limit);
|
||||
void gfxSemDestroy(gfxSem* psem);
|
||||
bool_t gfxSemWait(gfxSem* psem, delaytime_t ms);
|
||||
bool_t gfxSemWaitI(gfxSem* psem);
|
||||
void gfxSemSignal(gfxSem* psem);
|
||||
void gfxSemSignalI(gfxSem* psem);
|
||||
#define gfxSemCounterI(psem) ((psem)->counter)
|
||||
|
Loading…
Reference in New Issue
Block a user