\section{aversive\_\-10-03-12/modules/debug/error/error.h File Reference}
\label{modules_2debug_2error_2error_8h}\index{aversive\_\-10-03-12/modules/debug/error/error.h@{aversive\_\-10-03-12/modules/debug/error/error.h}}
{\tt \#include $<$aversive/pgmspace.h$>$}\par
{\tt \#include $<$aversive.h$>$}\par
{\tt \#include $<$general\_\-errors.h$>$}\par
{\tt \#include \char`\"{}error\_\-config.h\char`\"{}}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct {\bf error}
\item 
struct {\bf error\_\-fct}
\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf ERROR\_\-SEVERITY\_\-EMERG}~0
\item 
\#define {\bf ERROR\_\-SEVERITY\_\-ERROR}~1
\item 
\#define {\bf ERROR\_\-SEVERITY\_\-WARNING}~2
\item 
\#define {\bf ERROR\_\-SEVERITY\_\-NOTICE}~3
\item 
\#define {\bf ERROR\_\-SEVERITY\_\-DEBUG}~4
\item 
\#define {\bf EMERG}(num, text,...)
\item 
\#define {\bf ERROR}(num, text,...)
\item 
\#define {\bf WARNING}(num, text,...)
\item 
\#define {\bf NOTICE}(num, text,...)
\item 
\#define {\bf DEBUG}(num, text,...)
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
struct {\bf error} {\bf error\_\-generate} (uint8\_\-t num, uint8\_\-t severity, PGM\_\-P t, PGM\_\-P f, uint16\_\-t l)
\item 
void {\bf error\_\-register\_\-emerg} (void($\ast$f)(struct {\bf error} $\ast$,...))
\item 
void {\bf error\_\-register\_\-error} (void($\ast$f)(struct {\bf error} $\ast$,...))
\item 
void {\bf error\_\-register\_\-warning} (void($\ast$f)(struct {\bf error} $\ast$,...))
\item 
void {\bf error\_\-register\_\-notice} (void($\ast$f)(struct {\bf error} $\ast$,...))
\item 
void {\bf error\_\-register\_\-debug} (void($\ast$f)(struct {\bf error} $\ast$,...))
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
struct {\bf error\_\-fct} {\bf g\_\-error\_\-fct}
\end{CompactItemize}


\subsection{Define Documentation}
\index{modules/debug/error/error.h@{modules/debug/error/error.h}!DEBUG@{DEBUG}}
\index{DEBUG@{DEBUG}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[DEBUG]{\setlength{\rightskip}{0pt plus 5cm}\#define DEBUG(num, \/  text, \/   {\em ...})}\label{modules_2debug_2error_2error_8h_401433570f96d9048bf715073683114e}


\textbf{Value:}

\begin{Code}\begin{verbatim}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)
\end{verbatim}
\end{Code}
Call this macro to log DEBUG events 

Definition at line 127 of file error.h.\index{modules/debug/error/error.h@{modules/debug/error/error.h}!EMERG@{EMERG}}
\index{EMERG@{EMERG}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[EMERG]{\setlength{\rightskip}{0pt plus 5cm}\#define EMERG(num, \/  text, \/   {\em ...})}\label{modules_2debug_2error_2error_8h_d64bcf63d2ea4b837fd4852acf7eb73f}


\textbf{Value:}

\begin{Code}\begin{verbatim}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)
\end{verbatim}
\end{Code}
Call this macro to log EMERG events 

Definition at line 83 of file error.h.\index{modules/debug/error/error.h@{modules/debug/error/error.h}!ERROR@{ERROR}}
\index{ERROR@{ERROR}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[ERROR]{\setlength{\rightskip}{0pt plus 5cm}\#define ERROR(num, \/  text, \/   {\em ...})}\label{modules_2debug_2error_2error_8h_b228df501cfee26717248c3aa7772b1e}


\textbf{Value:}

\begin{Code}\begin{verbatim}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)
\end{verbatim}
\end{Code}
Call this macro to log ERROR events 

Definition at line 94 of file error.h.\index{modules/debug/error/error.h@{modules/debug/error/error.h}!ERROR\_\-SEVERITY\_\-DEBUG@{ERROR\_\-SEVERITY\_\-DEBUG}}
\index{ERROR\_\-SEVERITY\_\-DEBUG@{ERROR\_\-SEVERITY\_\-DEBUG}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[ERROR\_\-SEVERITY\_\-DEBUG]{\setlength{\rightskip}{0pt plus 5cm}\#define ERROR\_\-SEVERITY\_\-DEBUG~4}\label{modules_2debug_2error_2error_8h_f9c73b36fdff9fc2419f10a82dedd4c2}




Definition at line 39 of file error.h.

Referenced by mylog().\index{modules/debug/error/error.h@{modules/debug/error/error.h}!ERROR\_\-SEVERITY\_\-EMERG@{ERROR\_\-SEVERITY\_\-EMERG}}
\index{ERROR\_\-SEVERITY\_\-EMERG@{ERROR\_\-SEVERITY\_\-EMERG}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[ERROR\_\-SEVERITY\_\-EMERG]{\setlength{\rightskip}{0pt plus 5cm}\#define ERROR\_\-SEVERITY\_\-EMERG~0}\label{modules_2debug_2error_2error_8h_b441883eedcb9886feedd155d46f0a85}




Definition at line 35 of file error.h.

Referenced by mylog().\index{modules/debug/error/error.h@{modules/debug/error/error.h}!ERROR\_\-SEVERITY\_\-ERROR@{ERROR\_\-SEVERITY\_\-ERROR}}
\index{ERROR\_\-SEVERITY\_\-ERROR@{ERROR\_\-SEVERITY\_\-ERROR}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[ERROR\_\-SEVERITY\_\-ERROR]{\setlength{\rightskip}{0pt plus 5cm}\#define ERROR\_\-SEVERITY\_\-ERROR~1}\label{modules_2debug_2error_2error_8h_7e0d2259abb3331576684a495d1b9dd2}




Definition at line 36 of file error.h.

Referenced by mylog().\index{modules/debug/error/error.h@{modules/debug/error/error.h}!ERROR\_\-SEVERITY\_\-NOTICE@{ERROR\_\-SEVERITY\_\-NOTICE}}
\index{ERROR\_\-SEVERITY\_\-NOTICE@{ERROR\_\-SEVERITY\_\-NOTICE}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[ERROR\_\-SEVERITY\_\-NOTICE]{\setlength{\rightskip}{0pt plus 5cm}\#define ERROR\_\-SEVERITY\_\-NOTICE~3}\label{modules_2debug_2error_2error_8h_27deadd7eaccaa42939bbef48f311d80}




Definition at line 38 of file error.h.

Referenced by mylog().\index{modules/debug/error/error.h@{modules/debug/error/error.h}!ERROR\_\-SEVERITY\_\-WARNING@{ERROR\_\-SEVERITY\_\-WARNING}}
\index{ERROR\_\-SEVERITY\_\-WARNING@{ERROR\_\-SEVERITY\_\-WARNING}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[ERROR\_\-SEVERITY\_\-WARNING]{\setlength{\rightskip}{0pt plus 5cm}\#define ERROR\_\-SEVERITY\_\-WARNING~2}\label{modules_2debug_2error_2error_8h_efee3dc013c4c5250b5ac5149bb2522d}




Definition at line 37 of file error.h.

Referenced by mylog().\index{modules/debug/error/error.h@{modules/debug/error/error.h}!NOTICE@{NOTICE}}
\index{NOTICE@{NOTICE}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[NOTICE]{\setlength{\rightskip}{0pt plus 5cm}\#define NOTICE(num, \/  text, \/   {\em ...})}\label{modules_2debug_2error_2error_8h_1ac851a4c7ea12afc5cc082d0708944e}


\textbf{Value:}

\begin{Code}\begin{verbatim}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)
\end{verbatim}
\end{Code}
Call this macro to log NOTICE events 

Definition at line 116 of file error.h.\index{modules/debug/error/error.h@{modules/debug/error/error.h}!WARNING@{WARNING}}
\index{WARNING@{WARNING}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[WARNING]{\setlength{\rightskip}{0pt plus 5cm}\#define WARNING(num, \/  text, \/   {\em ...})}\label{modules_2debug_2error_2error_8h_8359aeebf5146d8e7e09aa46a7dacc95}


\textbf{Value:}

\begin{Code}\begin{verbatim}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)
\end{verbatim}
\end{Code}
Call this macro to log WARNING events 

Definition at line 105 of file error.h.

\subsection{Function Documentation}
\index{modules/debug/error/error.h@{modules/debug/error/error.h}!error\_\-generate@{error\_\-generate}}
\index{error\_\-generate@{error\_\-generate}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[error\_\-generate]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf error} error\_\-generate (uint8\_\-t {\em num}, \/  uint8\_\-t {\em severity}, \/  PGM\_\-P {\em t}, \/  PGM\_\-P {\em f}, \/  uint16\_\-t {\em l})\hspace{0.3cm}{\tt  [read]}}\label{modules_2debug_2error_2error_8h_8f4143525729b852a2c80764bfdd6eb5}




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.\index{modules/debug/error/error.h@{modules/debug/error/error.h}!error\_\-register\_\-debug@{error\_\-register\_\-debug}}
\index{error\_\-register\_\-debug@{error\_\-register\_\-debug}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[error\_\-register\_\-debug]{\setlength{\rightskip}{0pt plus 5cm}void error\_\-register\_\-debug (void($\ast$)(struct {\bf error} $\ast$,...) {\em f})}\label{modules_2debug_2error_2error_8h_d972f00321483913eea7b0ed563ce6dc}


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().\index{modules/debug/error/error.h@{modules/debug/error/error.h}!error\_\-register\_\-emerg@{error\_\-register\_\-emerg}}
\index{error\_\-register\_\-emerg@{error\_\-register\_\-emerg}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[error\_\-register\_\-emerg]{\setlength{\rightskip}{0pt plus 5cm}void error\_\-register\_\-emerg (void($\ast$)(struct {\bf error} $\ast$,...) {\em f})}\label{modules_2debug_2error_2error_8h_28d5c7dd7bac56c85dd0d486c759f377}


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().\index{modules/debug/error/error.h@{modules/debug/error/error.h}!error\_\-register\_\-error@{error\_\-register\_\-error}}
\index{error\_\-register\_\-error@{error\_\-register\_\-error}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[error\_\-register\_\-error]{\setlength{\rightskip}{0pt plus 5cm}void error\_\-register\_\-error (void($\ast$)(struct {\bf error} $\ast$,...) {\em f})}\label{modules_2debug_2error_2error_8h_9b30e7010645dd79602f440acb56fa13}


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().\index{modules/debug/error/error.h@{modules/debug/error/error.h}!error\_\-register\_\-notice@{error\_\-register\_\-notice}}
\index{error\_\-register\_\-notice@{error\_\-register\_\-notice}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[error\_\-register\_\-notice]{\setlength{\rightskip}{0pt plus 5cm}void error\_\-register\_\-notice (void($\ast$)(struct {\bf error} $\ast$,...) {\em f})}\label{modules_2debug_2error_2error_8h_88b1cddf1c5afe6cb0c59459b859eac2}


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().\index{modules/debug/error/error.h@{modules/debug/error/error.h}!error\_\-register\_\-warning@{error\_\-register\_\-warning}}
\index{error\_\-register\_\-warning@{error\_\-register\_\-warning}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[error\_\-register\_\-warning]{\setlength{\rightskip}{0pt plus 5cm}void error\_\-register\_\-warning (void($\ast$)(struct {\bf error} $\ast$,...) {\em f})}\label{modules_2debug_2error_2error_8h_63ab530e7a20b0a43472d20067e641ce}


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().

\subsection{Variable Documentation}
\index{modules/debug/error/error.h@{modules/debug/error/error.h}!g\_\-error\_\-fct@{g\_\-error\_\-fct}}
\index{g\_\-error\_\-fct@{g\_\-error\_\-fct}!modules/debug/error/error.h@{modules/debug/error/error.h}}
\subsubsection[g\_\-error\_\-fct]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf error\_\-fct} {\bf g\_\-error\_\-fct}}\label{modules_2debug_2error_2error_8h_d8a8984248fe1027324e8b89c2cfc457}




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().