3.26.7 Traps Driver
Overview
Traps are non-maskable, nestable interrupts that adhere to a fixed priority structure. Traps provide a means to correct erroneous operation during debugging and the operation of the application.
3.26.7.1 Module Documentation
3.26.7.1.1 Traps Driver
Traps driver with handler for all types of traps using dsPIC MCUs.
Module description
Traps driver with handler for all types of traps using dsPIC MCUs.
Enumerations
enum TRAPS_ERROR_CODE { TRAPS_DMA_BUS_ERR = 0, TRAPS_ILLEGALINSTRUCTION = 1, TRAPS_ADDRESS_ERR = 2, TRAPS_STACK_ERR = 3, TRAPS_DIV0_ERR = 4, TRAPS_DMT_ERR = 5, TRAPS_WDT_ERR = 6 }
Defines the TRAPS error codes.
Functions
void TRAPS_halt_on_error (uint16_t code)
Stores the trap error code and waits forever. This is a weak attribute function. The user can override and implement the same function without weak attribute.
Function Documentation
TRAPS_halt_on_error()
void TRAPS_halt_on_error (uint16_t code)
Stores the trap error code and waits forever. This is a weak attribute function. The user can override and implement the same function without weak attribute.
in | code |
- trap error code |
none |
Enumeration Type Documentation
TRAPS_ERROR_CODE
enum TRAPS_ERROR_CODE
Defines the TRAPS error codes.
TRAPS_DMA_BUS_ERR |
Bus error. |
TRAPS_ILLEGALINSTRUCTION |
Illegal instruction. |
TRAPS_ADDRESS_ERR |
Address error. |
TRAPS_STACK_ERR |
Stack error. |
TRAPS_DIV0_ERR |
Math error. |
TRAPS_DMT_ERR |
General error. |
TRAPS_WDT_ERR |
General error. |
3.26.7.2 File Documentation
3.26.7.2.1 source/traps.h File Reference
#include <stdint.h>
Functions
void TRAPS_halt_on_error (uint16_t code)
Stores the trap error code and waits forever. This is a weak attribute function. The user can override and implement the same function without weak attribute.
Enumerations
enum TRAPS_ERROR_CODE { TRAPS_DMA_BUS_ERR = 0, TRAPS_ILLEGALINSTRUCTION = 1, TRAPS_ADDRESS_ERR = 2, TRAPS_STACK_ERR = 3, TRAPS_DIV0_ERR = 4, TRAPS_DMT_ERR = 5, TRAPS_WDT_ERR = 6 }
Defines the TRAPS error codes.
Detailed Description
TRAPS Generated Driver Header File