Skip to content

Commit fba55fb

Browse files
committed
Merge pull request Arduino-IRremote#31 from X-Y/master
Multiple definition of "MATCH" error when running IRtest
2 parents 46b4e10 + acc1b6b commit fba55fb

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

IRremote.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ int MATCH_SPACE(int measured_ticks, int desired_us) {
6565
Serial.println(TICKS_HIGH(desired_us - MARK_EXCESS), DEC);
6666
return measured_ticks >= TICKS_LOW(desired_us - MARK_EXCESS) && measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS);
6767
}
68+
#else
69+
int MATCH(int measured, int desired) {return measured >= TICKS_LOW(desired) && measured <= TICKS_HIGH(desired);}
70+
int MATCH_MARK(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us + MARK_EXCESS));}
71+
int MATCH_SPACE(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us - MARK_EXCESS));}
72+
// Debugging versions are in IRremote.cpp
6873
#endif
6974

7075
void IRsend::sendNEC(unsigned long data, int nbits)

IRremoteInt.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,6 @@
175175
#define TICKS_LOW(us) (int) (((us)*LTOL/USECPERTICK))
176176
#define TICKS_HIGH(us) (int) (((us)*UTOL/USECPERTICK + 1))
177177

178-
#ifndef DEBUG
179-
int MATCH(int measured, int desired) {return measured >= TICKS_LOW(desired) && measured <= TICKS_HIGH(desired);}
180-
int MATCH_MARK(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us + MARK_EXCESS));}
181-
int MATCH_SPACE(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us - MARK_EXCESS));}
182-
// Debugging versions are in IRremote.cpp
183-
#endif
184-
185178
// receiver states
186179
#define STATE_IDLE 2
187180
#define STATE_MARK 3

0 commit comments

Comments
 (0)