Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
wpt_error_handler.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include "app_print.h"
#include "app_error.h"

Go to the source code of this file.

Functions

void HardFault_Handler ()
 Hard Fault handler. More...
 
void app_error_fault_handler (uint32_t id, uint32_t pc, uint32_t info)
 Callback function for asserts in the SoftDevice. More...
 
void assert_nrf_callback (uint16_t line_num, const uint8_t *p_file_name)
 Assert macro callback function. More...
 

Function Documentation

void HardFault_Handler ( )

Hard Fault handler.

Warning
This handler is an example only and does not fit a final product. You need to analyze how your product is supposed to react in case of an hard fault.

Definition at line 27 of file wpt_error_handler.c.

28 {
29  while(true)
30  ;
31 }
void app_error_fault_handler ( uint32_t  id,
uint32_t  pc,
uint32_t  info 
)

Callback function for asserts in the SoftDevice.

Warning
This handler is an example only and does not fit a final product. You need to analyze how your product is supposed to react in case of an hard fault.

A pointer to this function will be passed to the SoftDevice. This function will be called by the SoftDevice if certain unrecoverable errors occur within the application or SoftDevice.

See nrf_fault_handler_t for more details.

Parameters
[in]idFault identifier. See NRF_FAULT_IDS.
[in]pcThe program counter of the instruction that triggered the fault, or 0 if unavailable.
[in]infoOptional additional information regarding the fault. Refer to each fault identifier for details.

Definition at line 50 of file wpt_error_handler.c.

51 {
52  print_string("\n\rError! ");
53  print_hex(id,4);
54 
55  while(true)
56  ;
57 }
void print_hex(uint32_t number, uint8_t byte_size)
Converts hex number into char and send it through UART TX.
Definition: app_print.c:42
void print_string(char *char_array)
Decomposes char array and send chars through UART TX.
Definition: app_print.c:25
void assert_nrf_callback ( uint16_t  line_num,
const uint8_t *  p_file_name 
)

Assert macro callback function.

This function will be called in case of an assert in the SoftDevice.

Warning
This handler is an example only and does not fit a final product. You need to analyze how your product is supposed to react in case of Assert.
On assert from the SoftDevice, the system can only recover on reset.
Parameters
[in]line_numLine number of the failing ASSERT call.
[in]p_file_nameFile name of the failing ASSERT call.

Definition at line 71 of file wpt_error_handler.c.

72 {
73  app_error_handler(0xDEADBEEF, line_num, p_file_name);
74 }
void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t *p_file_name)
Error handler function, which is called when an error has occurred.
Definition: main.c:180