Module to declare HAL Atomic API. More...
Typedefs | |
typedef volatile uint32_t | atomic_t |
Functions | |
void | hal_atomic_start (atomic_t *p_atomic) |
Enters atomic section. More... | |
void | hal_atomic_end (atomic_t *p_atomic) |
Exits atomic section. More... | |
Module to declare HAL Atomic API.
The Atomic module implements atomic section interface. This is made by disabling the global interrupts, which is a hardware dependent feature. The user may call hal_atomic_start() to open an atomic section (disable interrupts) and hal_atomic_end() to exit from the section (restore interrupts). The algorithm supports nesting sections.
void hal_atomic_end | ( | atomic_t * | p_atomic | ) |
Exits atomic section.
Restores status register
[in] | p_atomic | pointer to buffer to restore current value of the status register from. |
void hal_atomic_start | ( | atomic_t * | p_atomic | ) |
Enters atomic section.
Disables global interrupts.
[in] | p_atomic | pointer to buffer to store current value of the status register. |