src/ssx/ssx/ssx_semaphore_core.c
/// An simple interrupt handler that posts to a semaphore.
///
/// To implement basic event-driven blocking of a thread, install
/// ssx_semaphore_post_handler() as the handler for a non-critical interrupt
/// and provide a pointer to the semaphore as the \a arg argument in
/// ssx_irq_handler_set().  The semaphore should be initialized with
/// ssx_semaphore_create(&sem, 0, 1).  This handler simply disables (masks)
/// the interrupt, clears the status and calls ssx_semaphore_post() on the
/// semaphore.
///
/// Note that clearing the status in the interrupt controller as done here is
/// effectively a no-op for level-sensitive interrupts. In the level-sensitive
/// case any thread pending on the semaphore must reset the interrupt
/// condition in the device before re-enabling the interrupt.
An simple interrupt handler that posts to a semaphore.
To implement basic event-driven blocking of a thread, install
ssx_semaphore_post_handler() as the handler for a non-critical interrupt
and provide a pointer to the semaphore as the \a arg argument in
ssx_irq_handler_set().  The semaphore should be initialized with
ssx_semaphore_create(&sem, 0, 1).  This handler simply disables (masks)
the interrupt, clears the status and calls ssx_semaphore_post() on the
semaphore.

Note that clearing the status in the interrupt controller as done here is
effectively a no-op for level-sensitive interrupts. In the level-sensitive
case any thread pending on the semaphore must reset the interrupt
condition in the device before re-enabling the interrupt.
An simple interrupt handler that posts to a semaphore . To implement basic event - driven blocking of a thread install ssx_semaphore_post_handler () as the handler for a non - critical interrupt and provide a pointer to the semaphore as the \ a arg argument in ssx_irq_handler_set () . The semaphore should be initialized with ssx_semaphore_create ( &sem 0 1 ) . This handler simply disables ( masks ) the interrupt clears the status and calls ssx_semaphore_post () on the semaphore . Note that clearing the status in the interrupt controller as done here is effectively a no - op for level - sensitive interrupts . In the level - sensitive case any thread pending on the semaphore must reset the interrupt condition in the device before re - enabling the interrupt .
void
ssx_semaphore_post_handler_full(void* arg, SsxIrqId irq, int priority)
{
    ssx_irq_disable(irq);
    ssx_irq_status_clear(irq);
    ssx_semaphore_post((SsxSemaphore*)arg);
}
void ssx_semaphore_post_handler_full ( void * arg , SsxIrqId irq , int priority ) { ssx_irq_disable ( irq ) ; ssx_irq_status_clear ( irq ) ; ssx_semaphore_post ( ( SsxSemaphore * ) arg ) ; }
An simple interrupt handler that posts to a semaphore.
An simple interrupt handler that posts to a semaphore .