Morse Micro IoT SDK  2.9.7

Detailed Description

Provides binary semaphore support for task synchronization.

Functions

struct mmosal_semb * mmosal_semb_create (const char *name)
 Create a new binary semaphore. More...
 
void mmosal_semb_delete (struct mmosal_semb *semb)
 Delete the given binary semaphore. More...
 
bool mmosal_semb_give (struct mmosal_semb *semb)
 Give a binary semaphore. More...
 
bool mmosal_semb_give_from_isr (struct mmosal_semb *semb)
 Give a binary semaphore (from ISR context). More...
 
bool mmosal_semb_wait (struct mmosal_semb *semb, uint32_t timeout_ms)
 Wait for a counting semaphore. More...
 

Function Documentation

◆ mmosal_semb_create()

struct mmosal_semb * mmosal_semb_create ( const char *  name)

Create a new binary semaphore.

Parameters
nameThe name of the semaphore.
Returns
an opaque handle to the semaphore, or NULL on failure.

Definition at line 76 of file mmosal_shim_bootloader.c.

◆ mmosal_semb_delete()

void mmosal_semb_delete ( struct mmosal_semb *  semb)

Delete the given binary semaphore.

Parameters
sembSemaphore to delete.

Definition at line 82 of file mmosal_shim_bootloader.c.

◆ mmosal_semb_give()

bool mmosal_semb_give ( struct mmosal_semb *  semb)

Give a binary semaphore.

Warning
May not be invoked from an ISR.
Parameters
sembThe semaphore to give.
Returns
true on success, else false.

Definition at line 87 of file mmosal_shim_bootloader.c.

◆ mmosal_semb_give_from_isr()

bool mmosal_semb_give_from_isr ( struct mmosal_semb *  semb)

Give a binary semaphore (from ISR context).

Warning
May only be invoked from an ISR.
Parameters
sembThe semaphore to give.
Returns
true on success, else false.

Definition at line 93 of file mmosal_shim_bootloader.c.

◆ mmosal_semb_wait()

bool mmosal_semb_wait ( struct mmosal_semb *  semb,
uint32_t  timeout_ms 
)

Wait for a counting semaphore.

Parameters
sembThe semaphore to wait for.
timeout_msTimeout after which to give up waiting (in milliseconds).
Returns
true if the the semaphore was taken successfully, else false.

Definition at line 99 of file mmosal_shim_bootloader.c.