Skip to content

Commit 1174617

Browse files
committed
fix: DEBUG macro definition for ESP32
Refactor to IR_DEBUG since DEBUG is too generic and might interfere with other definitions.
1 parent 700422b commit 1174617

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/IRrecv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,12 @@ void IRrecv::enableIRIn(const bool pullup) {
368368
// Initialise the ESP32 timer.
369369
// 80MHz / 80 = 1 uSec granularity.
370370
timer = timerBegin(_timer_num, 80, true);
371-
#ifdef DEBUG
371+
#ifdef IR_DEBUG
372372
if (timer == NULL) {
373373
DPRINT("FATAL: Unable enable system timer: ");
374374
DPRINTLN((uint16_t)_timer_num);
375375
}
376-
#endif // DEBUG
376+
#endif // IR_DEBUG
377377
assert(timer != NULL); // Check we actually got the timer.
378378
// Set the timer so it only fires once, and set it's trigger in uSeconds.
379379
timerAlarmWrite(timer, MS_TO_USEC(params.timeout), ONCE);

src/IRremoteESP8266.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,9 +1503,9 @@ const uint16_t kYorkStateLength = 17;
15031503
#define WHYNTER_BITS kWhynterBits
15041504

15051505
// Turn on Debugging information by uncommenting the following line.
1506-
// #define DEBUG 1
1506+
// #define IR_DEBUG 1
15071507

1508-
#ifdef DEBUG
1508+
#ifdef IR_DEBUG
15091509
#ifdef UNIT_TEST
15101510
#define DPRINT(x) do { \
15111511
std::cout << x; \
@@ -1525,18 +1525,18 @@ const uint16_t kYorkStateLength = 17;
15251525
Serial.println(x); \
15261526
} \
15271527
while (0)
1528-
#endif // ARDUINO
15291528
#elif defined(ESP32)
15301529
#define DPRINT(x) do { \
15311530
std::cout << x; \
15321531
} while (0)
15331532
#define DPRINTLN(x) do { \
15341533
std::cout << x << std::endl; \
15351534
} while (0)
1536-
#else // DEBUG
1535+
#endif // ARDUINO
1536+
#else // IR_DEBUG
15371537
#define DPRINT(x)
15381538
#define DPRINTLN(x)
1539-
#endif // DEBUG
1539+
#endif // IR_DEBUG
15401540

15411541
#ifdef UNIT_TEST
15421542
#ifndef F

0 commit comments

Comments
 (0)