mirror of
https://github.com/wled/WLED.git
synced 2025-07-15 23:06:36 +00:00
usermod_mpu6050: Fix debug prints
The MPU6050 library happens to choose the same defines as WLED, which collide and result in nothing printing. Un- and re-define the macros to work around this.
This commit is contained in:
parent
43f5e4360d
commit
d2dbaf52a1
@ -33,6 +33,9 @@
|
||||
|
||||
#include "I2Cdev.h"
|
||||
|
||||
#undef DEBUG_PRINT
|
||||
#undef DEBUG_PRINTLN
|
||||
#undef DEBUG_PRINTF
|
||||
#include "MPU6050_6Axis_MotionApps20.h"
|
||||
//#include "MPU6050.h" // not necessary if using MotionApps include file
|
||||
|
||||
@ -42,6 +45,23 @@
|
||||
#include "Wire.h"
|
||||
#endif
|
||||
|
||||
// Restore debug macros
|
||||
// MPU6050 unfortunately uses the same macro names as WLED :(
|
||||
#undef DEBUG_PRINT
|
||||
#undef DEBUG_PRINTLN
|
||||
#undef DEBUG_PRINTF
|
||||
#ifdef WLED_DEBUG
|
||||
#define DEBUG_PRINT(x) DEBUGOUT.print(x)
|
||||
#define DEBUG_PRINTLN(x) DEBUGOUT.println(x)
|
||||
#define DEBUG_PRINTF(x...) DEBUGOUT.printf(x)
|
||||
#else
|
||||
#define DEBUG_PRINT(x)
|
||||
#define DEBUG_PRINTLN(x)
|
||||
#define DEBUG_PRINTF(x...)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// ================================================================
|
||||
// === INTERRUPT DETECTION ROUTINE ===
|
||||
// ================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user