1.5.2.2 Using the Library
The PRIME Reset Handler service library is called by the fault interrupt handlers as well as by the user application and the PRIME Library when they need to trigger a reset.
To read the stored reset information, the PRIME User PIBs library is used (see User PIBs Service). The information is kept in the GPBRs on PIC32CXMT devices and in the emulated EEPROM on the SAMD20.
The following example illustrates how to trigger a reset from the user application.
Example of PRIME Reset Handler Library Usage
#include <string.h> #include "app.h" #include "service/reset_handler/srv_reset_handler.h" #include "bsp/bsp.h" void APP_Tasks ( void ) { /* Trigger reset */ SRV_RESET_HANDLER_RestartSystem(RESET_HANDLER_SOFTWARE_RESET); }
