swimtracker-firmware/lib/basic/Dtypes.h

21 lines
526 B
C++

#pragma once
inline void _assert(const char* expression, const char* message, const char* file, int line)
{
Serial.print("Assert ");
Serial.print(file);
Serial.print(" : ");
Serial.print(line);
Serial.print(" '");
Serial.print(expression);
Serial.println("' failed.");
Serial.println(message);
}
template< typename T>
inline String toString(const T & t) {
return String(t);
}
#define assert_msg(EXPRESSION, MSG) ((EXPRESSION) ? (void)0 : _assert(#EXPRESSION, #MSG, __FILE__, __LINE__))