EmbeddedEtcher
error.h
Go to the documentation of this file.
1 
9 #ifndef OS_ERROR_H
10 #define OS_ERROR_H
11 
12 //--------------Includes-----------------
13 #include"ostypes.h"
14 #include"ossettings.h"
15 
16 //--------------Preprocessor Hacks-------
17 
21 #if(DEBUG_MODE == ON)
22 #define DEBUG_MSG(MSG, ...)\
23  osPrintf("%s:%d: debug: ", __FILE__, __LINE__);\
24  osPrintf(MSG, ##__VA_ARGS__)
25 #else
26 #define DEBUG_MSG(MSG, ...)
27 #endif
28 
32 #define THROW_ERROR(ERROR_TYPE)\
33  osPrintError(__FILE__, __LINE__, ERROR_TYPE)
34 
38 #define THROW_WARNING(WARNING_TYPE)\
39  osPrintWarning(__FILE__, __LINE__, WARNING_TYPE)
40 
41 //--------------Funtions-----------------
42 
51 uint8_t osExplainError(const char* ifile, const uint8_t iline, const osError_t ierror, char* iomessage);
52 
60 uint8_t osPrintError(const char* ifile, const int iline, const osError_t ierror);
61 
70 uint8_t osExplainWarning(const char* ifile, const uint8_t iline, const osWarning_t ierror, char* iomessage);
71 
79 uint8_t osPrintWarning(const char* ifile, const int iline, const osWarning_t ierror);
80 
81 #endif
uint8_t osExplainError(const char *ifile, const uint8_t iline, const osError_t ierror, char *iomessage)
Definition: error.c:9
osWarning_t
Definition: ostypes.h:72
Different types the operating system uses are defined here.
uint8_t osPrintWarning(const char *ifile, const int iline, const osWarning_t ierror)
Definition: error.c:77
osError_t
Definition: ostypes.h:56
uint8_t osExplainWarning(const char *ifile, const uint8_t iline, const osWarning_t ierror, char *iomessage)
Definition: error.c:57
File where all settings take place.
uint8_t osPrintError(const char *ifile, const int iline, const osError_t ierror)
Definition: error.c:46