Callisto4Bootloader: include/c4_error_codes.h File Reference

Callisto4Bootloader

Macros | Enumerations | Functions
c4_error_codes.h File Reference

Enumeration of Error Codes. More...

`#include "c4_colours.h"`
`#include <stdbool.h>`

Go to the source code of this file.

## Macros

#define | ERROR_LIST
| Error codes and strings. More...
#define | CALLISTO_ERR(name, text, col_code) C4_ERR_##name,
| X-Macro to construct error codes, printable strings, and flash codes. More...

## Enumerations

enum | exit_code_t { C4_ERR_MAX }
| Enumeration of error codes. More...

## Functions

void | C4_displayError (const char *text, exit_code_t errVal, bool fatal)
| Print exit code on serial line and flash led. More...

## Detailed Description

Enumeration of Error Codes.

Copyright
  2020 Remsdaq Ltd.

Date
  20 May 2020

Author
  Dan Smithers dwhs@.nosp@m.rems.nosp@m.daq.c.nosp@m.om

Definition in file c4_error_codes.h.

## Macro Definition Documentation

## ◆ CALLISTO_ERR

#define CALLISTO_ERR | ( |  | name,
|  |  | text,
|  |  | col_code
| ) |  | C4_ERR_##name,

X-Macro to construct error codes, printable strings, and flash codes.

Parameters

  name | Error ID
  text | Printable string
  col_code | Array containing LED colour and flash code.

Definition at line 99 of file c4_error_codes.h.

## ◆ ERROR_LIST

#define ERROR_LIST

Error codes and strings.

The macro values are used to construct matching enumeration and string array using the x-macro strategy.

Definition at line 36 of file c4_error_codes.h.

## Enumeration Type Documentation

## ◆ exit_code_t

enum exit_code_t

Enumeration of error codes.

Enumerator
C4_ERR_MAX |

Definition at line 96 of file c4_error_codes.h.

## Function Documentation

## ◆ C4_displayError()

void C4_displayError | ( | const char * | text,
|  | exit_code_t | errVal,
|  | bool | fatal
| ) |  |

Print exit code on serial line and flash led.

This function will enter a continuous loop if fatal is true and anything other than C4_ERR_OK is sent.

Parameters

  [in] | text | Optional user text to display.
  [in] | errVal | Exit code.
  [in] | fatal | If true this error is fatal and the code loops forever.

Definition at line 44 of file c4_error_codes.c.

References BL_SysTick_DelayTicks(), C4_flashError(), DIT, err_strings, FlashCode, and g_ditLength.