Arduino-GPIO
General Purpose Input/Output (GPIO) library for Arduino
assert.h File Reference

Go to the source code of this file.

Macros

#define TRACE(expr)
 
#define ASSERT(expr)
 

Detailed Description

Version
1.0

License

Copyright (C) 2017, Mikael Patel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

Definition in file assert.h.

Macro Definition Documentation

#define ASSERT (   expr)
Value:
do { \
if (!(expr)) { \
Serial.print(__LINE__); \
Serial.println(F(":assert:" #expr)); \
Serial.flush(); \
exit(0); \
} \
} while (0)
Software::Serial< BOARD::D0 > Serial
Definition: Benchmark.ino:5

Assert support macro. Used in the form:

1 ASSERT(expr)

Checks that the expression is true, otherwise prints line number, and assert message with expression, and stops execution.

Parameters
[in]exprexpression to execute and check.

Definition at line 53 of file assert.h.

#define TRACE (   expr)
Value:
do { \
Serial.print(F(#expr "=")); \
Serial.println(expr); \
Serial.flush(); \
} while (0)
Software::Serial< BOARD::D0 > Serial
Definition: Benchmark.ino:5

Trace support macro. Used in the form:

1 TRACE(expr)

Prints message with expression, executes and prints value.

Parameters
[in]exprexpression to execute and print.

Definition at line 33 of file assert.h.