User API



Set the interrupt priorities of the REXIS exception routines.

void rexis_UserSetIRQPriorities(void);

User function to call when initializing the system

int  rexis_UserSysInit(int *pmsecs_per_task);

User function to call when resetting the system

void rexis_UserSysReset(void);

User function to call when there is a System Unrecoverable Error

void rexis_UserSOS(int code, PROC_DUMP *pd);

User function to call when there is a system call error

int  rexis_UserSyscallError(char *, enum rexis_error);

User function to call when starting the system

void rexis_UserSysStart(void);

User function to call when starting the SysTick timer

void rexis_UserStartSystickTimer(void);

User function to call at SysTick timer interrupt

void rexis_UserSysTick_Handler(void);

User function to enable the watchdog

void rexis_UserEnableWatchdog(void);

User function to pet the watchdog

void rexis_UserPetWatchdog(void);


rexis_UserSysTick_Handler is called at every SysTick timer interrupt, and thus should be as short as possible. The default code does nothing, and should be replaced as needed.


rexis_UserSetIRQPriorities is for setting the IRQ priorities of the REXIS interrupts. These interrupts should be set to the lowest “urgency” level (ARM parlance differentiates between priority and urgency levels in somewhat unexpected manner). The default one is suitable for Cortex-M4 and Cortex-M7 based MCUs, as it assumes priority groups of four (please refer to ARM documentation for priority group details, but it corresponds to the number of bits used in urgency levels) and thus uses the lowest urgency level of 0xF (four bits). Other Cortex series MCUs may require different priority groups and urgency level numbers.


The last two routines rexis_UserEnableWatchdog and rexis_UserPetWatchdogare for the watchdog system. The default REXIS code does nothing, as the watchdog timer is MCU specific. See Watchdog Reset for further details.