![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork to see if I can get working
Dependencies: BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated
Fork of xDotBridge_update_test20180823 by
Diff: xDotBridge/inc/dot_util.h
- Revision:
- 63:e1efbe3402d9
- Parent:
- 24:fdf87e4b72e5
- Child:
- 91:8196900df6fe
diff -r 9751a8504c82 -r e1efbe3402d9 xDotBridge/inc/dot_util.h --- a/xDotBridge/inc/dot_util.h Tue Mar 14 08:32:55 2017 -0600 +++ b/xDotBridge/inc/dot_util.h Tue Mar 14 09:54:04 2017 -0600 @@ -1,11 +1,12 @@ #ifndef __DOT_UTIL_H__ #define __DOT_UTIL_H__ +#include <inc/MyLog.h> #include "../config.h" #include "mbed.h" #include "mDot.h" +#include "MTSText.h" #include "MTSLog.h" -#include "MTSText.h" //#include "ISL29011.h" extern mDot* dot; @@ -38,4 +39,32 @@ void send_data(std::vector<uint8_t> data); +#ifdef MTS_DEBUG +#define logFatal(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::FATAL_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::FATAL_LABEL, ##__VA_ARGS__) +#define logError(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::ERROR_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::ERROR_LABEL, ##__VA_ARGS__) +#define logWarning(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::WARNING_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::WARNING_LABEL, ##__VA_ARGS__) +#define logInfo(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::INFO_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::INFO_LABEL, ##__VA_ARGS__) +#define logDebug(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::DEBUG_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::DEBUG_LABEL, ##__VA_ARGS__) +#define logTrace(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::TRACE_LEVEL, "%s:%s:%d| [%s] " format "\r\n", __CLASSNAME__, __func__, __LINE__, mts::MTSLog::TRACE_LABEL, ##__VA_ARGS__) +#else +#define mtsLogFatal(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::FATAL_LEVEL, "[%s] " format "\r\n", mts::MTSLog::FATAL_LABEL, ##__VA_ARGS__) +#define mtsLogError(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::ERROR_LEVEL, "[%s] " format "\r\n", mts::MTSLog::ERROR_LABEL, ##__VA_ARGS__) +#define mtsLogWarning(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::WARNING_LEVEL, "[%s] " format "\r\n", mts::MTSLog::WARNING_LABEL, ##__VA_ARGS__) +#define mtsLogInfo(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::INFO_LEVEL, "[%s] " format "\r\n", mts::MTSLog::INFO_LABEL, ##__VA_ARGS__) +#define mtsLogDebug(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::DEBUG_LEVEL, "[%s] " format "\r\n", mts::MTSLog::DEBUG_LABEL, ##__VA_ARGS__) +#define mtsLogTrace(format, ...) \ + mts::MTSLog::printMessage(mts::MTSLog::TRACE_LEVEL, "[%s] " format "\r\n", mts::MTSLog::TRACE_LABEL, ##__VA_ARGS__) #endif + +#endif