Microchip® Advanced Software Framework

wireless/lorawan/hal/src/sys.c File Reference
#include "sys.h"
#include "atomic.h"
#include "delay.h"
#include "system_interrupt.h"

Functions

void system_enter_critical_section (void)
 Enters a critical section. More...
 
uint16_t System_GetAnalogReading (uint8_t channel)
 
void System_GetExternalEui (uint8_t *id)
 
void system_leave_critical_section (void)
 Leaves a critical section. More...
 
void SystemBlockingWaitMs (uint32_t ms)
 Performs a blocking delay. More...
 

void system_enter_critical_section ( void  )

Enters a critical section.

Disables global interrupts. To support nested critical sections, an internal count of the critical section nesting will be kept, so that global interrupts are only re-enabled upon leaving the outermost nested critical section.

References system_interrupt_enter_critical_section().

uint16_t System_GetAnalogReading ( uint8_t  channel)
void System_GetExternalEui ( uint8_t *  id)
void system_leave_critical_section ( void  )

Leaves a critical section.

Enables global interrupts. To support nested critical sections, an internal count of the critical section nesting will be kept, so that global interrupts are only re-enabled upon leaving the outermost nested critical section.

References system_interrupt_leave_critical_section().

void SystemBlockingWaitMs ( uint32_t  ms)

Performs a blocking delay.

Parameters
[in]msDelay time in milliseconds
Note
: This function should allow interrupts to happen (unless it was called from an interrupt itself) and keep its timing accurate. Ideally it should do the waiting with the MCU in sleep. Find out how long it takes the MCU to go to and wake up from sleep to see if it makes sense to go to sleep at all

References delay_ms.

Referenced by RADIO_ReadRandom(), RADIO_Reset(), and Radio_WriteMode().