OVVE / software-controller

Software for the Arduino Mega
Other
2 stars 7 forks source link

Add debug infrastructure #26

Closed mrrosen closed 4 years ago

mrrosen commented 4 years ago

Add standard debug infrastructure to the code via src/util/debug.h - use DEBUG_PRINT like you would printf in C. Note that you should only every include the header file directly from a source file and you need to define DEBUG_MODULE as a string representing the file in the log (see src/main.cpp for an example). You must also define DEBUG to enable the print messages.

To avoid spamming the log with print messages that happen very frequently, you can use DEBUG_PRINT_EVERY to print every n times the statement is reached.

Note, it uses the default programming interface serial connection