#include <aversive/pgmspace.h>
#include <aversive.h>
#include <general_errors.h>
#include "error_config.h"
Go to the source code of this file.
Data Structures | |
struct | error |
struct | error_fct |
Defines | |
#define | ERROR_SEVERITY_EMERG 0 |
#define | ERROR_SEVERITY_ERROR 1 |
#define | ERROR_SEVERITY_WARNING 2 |
#define | ERROR_SEVERITY_NOTICE 3 |
#define | ERROR_SEVERITY_DEBUG 4 |
#define | EMERG(num, text,...) |
#define | ERROR(num, text,...) |
#define | WARNING(num, text,...) |
#define | NOTICE(num, text,...) |
#define | DEBUG(num, text,...) |
Functions | |
struct error | error_generate (uint8_t num, uint8_t severity, PGM_P t, PGM_P f, uint16_t l) |
void | error_register_emerg (void(*f)(struct error *,...)) |
void | error_register_error (void(*f)(struct error *,...)) |
void | error_register_warning (void(*f)(struct error *,...)) |
void | error_register_notice (void(*f)(struct error *,...)) |
void | error_register_debug (void(*f)(struct error *,...)) |
Variables | |
struct error_fct | g_error_fct |
#define DEBUG | ( | num, | |||
text, | |||||
... | ) |
Value:
do { \ if(g_error_fct.debug) { \ struct error e = error_generate(num, ERROR_SEVERITY_DEBUG, \ PSTR(text), \ PSTR(__FILE__),\ __LINE__); \ g_error_fct.debug(&e, ##__VA_ARGS__); \ } \ } while(0)
#define EMERG | ( | num, | |||
text, | |||||
... | ) |
Value:
do { \ if(g_error_fct.emerg) { \ struct error e = error_generate(num, ERROR_SEVERITY_EMERG, \ PSTR(text), \ PSTR(__FILE__),\ __LINE__); \ g_error_fct.emerg(&e, ##__VA_ARGS__); \ } \ } while(0)
#define ERROR | ( | num, | |||
text, | |||||
... | ) |
Value:
do { \ if(g_error_fct.error) { \ struct error e = error_generate(num, ERROR_SEVERITY_ERROR, \ PSTR(text), \ PSTR(__FILE__),\ __LINE__); \ g_error_fct.error(&e, ##__VA_ARGS__); \ } \ } while(0)
#define NOTICE | ( | num, | |||
text, | |||||
... | ) |
Value:
do { \ if(g_error_fct.notice) { \ struct error e = error_generate(num, ERROR_SEVERITY_NOTICE, \ PSTR(text), \ PSTR(__FILE__),\ __LINE__); \ g_error_fct.notice(&e, ##__VA_ARGS__); \ } \ } while(0)
#define WARNING | ( | num, | |||
text, | |||||
... | ) |
Value:
do { \ if(g_error_fct.warning) { \ struct error e = error_generate(num, ERROR_SEVERITY_WARNING, \ PSTR(text), \ PSTR(__FILE__),\ __LINE__); \ g_error_fct.warning(&e, ##__VA_ARGS__); \ } \ } while(0)
struct error error_generate | ( | uint8_t | num, | |
uint8_t | severity, | |||
PGM_P | t, | |||
PGM_P | f, | |||
uint16_t | l | |||
) | [read] |
Definition at line 44 of file error.c.
References error::err_num, parse_symbols::f, error::file, parse_symbols::l, error::line, error::severity, and error::text.
void error_register_debug | ( | void(*)(struct error *,...) | f | ) |
Register log function for DEBUG level
Definition at line 103 of file error.c.
References error_fct::debug, parse_symbols::f, g_error_fct, IRQ_LOCK, and IRQ_UNLOCK.
Referenced by main().
void error_register_emerg | ( | void(*)(struct error *,...) | f | ) |
Register log function for EMERG level
Definition at line 67 of file error.c.
References error_fct::emerg, parse_symbols::f, g_error_fct, IRQ_LOCK, and IRQ_UNLOCK.
Referenced by main().
void error_register_error | ( | void(*)(struct error *,...) | f | ) |
Register log function for ERROR level
Definition at line 76 of file error.c.
References error_fct::error, parse_symbols::f, g_error_fct, IRQ_LOCK, and IRQ_UNLOCK.
Referenced by main().
void error_register_notice | ( | void(*)(struct error *,...) | f | ) |
Register log function for NOTICE level
Definition at line 94 of file error.c.
References parse_symbols::f, g_error_fct, IRQ_LOCK, IRQ_UNLOCK, and error_fct::notice.
Referenced by main().
void error_register_warning | ( | void(*)(struct error *,...) | f | ) |
Register log function for WARNING level
Definition at line 85 of file error.c.
References parse_symbols::f, g_error_fct, IRQ_LOCK, IRQ_UNLOCK, and error_fct::warning.
Referenced by main().
struct error_fct g_error_fct |
Definition at line 32 of file error.c.
Referenced by error_init(), error_register_debug(), error_register_emerg(), error_register_error(), error_register_notice(), and error_register_warning().