31 #if defined(PIOS_INCLUDE_CHIBIOS)
38 #if defined(PIOS_INCLUDE_CHIBIOS)
57 chBSemInit(&sema->sema,
false);
77 return chBSemWait(&sema->sema) == RDY_OK;
78 else if (timeout_ms == 0)
79 return chBSemWaitTimeout(&sema->sema, TIME_IMMEDIATE) == RDY_OK;
81 return chBSemWaitTimeout(&sema->sema, MS2ST(timeout_ms)) == RDY_OK;
97 chBSemSignal(&sema->sema);
135 chBSemSignalI(&sema->sema);
136 chSysUnlockFromIsr();
181 uint32_t temp_sema_count;
184 if ((temp_sema_count = sema->
sema_count) != 0)
187 }
while (temp_sema_count == 0 &&
190 return temp_sema_count != 0;
uint32_t PIOS_DELAY_DiffuS(uint32_t raw)
Subtract raw time from now and convert to us.
int32_t PIOS_IRQ_Enable(void)
#define PIOS_SEMAPHORE_TIMEOUT_MAX
Main PiOS header to include all the compiled in PiOS options.
void * PIOS_malloc(size_t size)
bool PIOS_Semaphore_Give_FromISR(struct pios_semaphore *sema, bool *woken)
void * PIOS_malloc_no_dma(size_t size)
struct pios_semaphore * PIOS_Semaphore_Create(void)
Creates a binary semaphore.
bool PIOS_Semaphore_Take_FromISR(struct pios_semaphore *sema, bool *woken)
bool PIOS_Semaphore_Give(struct pios_semaphore *sema)
Gives binary semaphore.
int32_t PIOS_IRQ_Disable(void)
bool PIOS_Semaphore_Take(struct pios_semaphore *sema, uint32_t timeout_ms)
Takes binary semaphore.
#define PIOS_Assert(test)
uint32_t PIOS_DELAY_GetRaw()
Get the raw delay timer, useful for timing.