2.29.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.

2.29.7.1 Module Documentation

2.29.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.

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.

Parameters:
in code

- trap error code

Returns:

none

Enumeration Type Documentation

TRAPS_ERROR_CODE

enum TRAPS_ERROR_CODE

Defines the TRAPS error codes.

TRAPS_OSC_FAIL

Oscillator Fail Trap vector

TRAPS_STACK_ERR

Stack Error Trap Vector

TRAPS_ADDRESS_ERR

Address error Trap vector

TRAPS_MATH_ERR

Math Error Trap vector

TRAPS_HARD_ERR

Generic Hard Trap vector

TRAPS_DOOVR_ERR

Generic Soft Trap vector

TRAPS_APLL_ERR

Generic Soft Trap vector

TRAPS_NVM_ERR

Generic Soft Trap vector

TRAPS_CAN_ERR

Generic Soft Trap vector

2.29.7.2 File Documentation

2.29.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.

Detailed Description

TRAPS Generated Driver Header File