2019-09-08 18:00:09 +02:00
|
|
|
#pragma once
|
|
|
|
|
2019-08-22 21:33:36 +02:00
|
|
|
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.");
|
2019-09-08 18:00:09 +02:00
|
|
|
Serial.println(message);
|
2019-08-22 21:33:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
template< typename T>
|
|
|
|
inline String toString(const T & t) {
|
|
|
|
return String(t);
|
|
|
|
}
|
|
|
|
|
2020-06-05 20:55:01 +02:00
|
|
|
#define assert_msg(EXPRESSION, MSG) ((EXPRESSION) ? (void)0 : _assert(#EXPRESSION, #MSG, __FILE__, __LINE__))
|