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.  

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

Detailed Description

TRAPS Generated Driver Header File