Shrink debug code in TWIBus and disable by default

This commit is contained in:
Scott Lahteine
2016-04-20 12:35:56 -07:00
parent 21a6b66807
commit 1addb50b62
2 changed files with 42 additions and 13 deletions

View File

@ -23,6 +23,11 @@
#ifndef TWIBUS_H
#define TWIBUS_H
#include "macros.h"
// Print debug messages with M111 S2 (Uses 236 bytes of PROGMEM)
//#define DEBUG_TWIBUS
/**
* TWIBUS class
*
@ -117,6 +122,16 @@ class TWIBus {
* @param bytes the number of bytes to request
*/
void reqbytes(uint8_t bytes);
#if ENABLED(DEBUG_TWIBUS)
/**
* @brief Prints a debug message
* @details Prints a simple debug message "TWIBus::function: value"
*/
static void debug(const char func[], int32_t val = -1);
#endif
};
#endif //TWIBUS_H