mirror of
https://github.com/Theaninova/Arduino-IRremote.git
synced 2026-01-20 16:22:55 +00:00
Fixed MATCH, MATCH_MARK, MATCH_SPACE when both IRremoteInt.h and IRremoteInt.h are included in sketch
This commit is contained in:
@@ -65,6 +65,11 @@ int MATCH_SPACE(int measured_ticks, int desired_us) {
|
|||||||
Serial.println(TICKS_HIGH(desired_us - MARK_EXCESS), DEC);
|
Serial.println(TICKS_HIGH(desired_us - MARK_EXCESS), DEC);
|
||||||
return measured_ticks >= TICKS_LOW(desired_us - MARK_EXCESS) && measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS);
|
return measured_ticks >= TICKS_LOW(desired_us - MARK_EXCESS) && measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
int MATCH(int measured, int desired) {return measured >= TICKS_LOW(desired) && measured <= TICKS_HIGH(desired);}
|
||||||
|
int MATCH_MARK(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us + MARK_EXCESS));}
|
||||||
|
int MATCH_SPACE(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us - MARK_EXCESS));}
|
||||||
|
// Debugging versions are in IRremote.cpp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void IRsend::sendNEC(unsigned long data, int nbits)
|
void IRsend::sendNEC(unsigned long data, int nbits)
|
||||||
|
|||||||
@@ -172,13 +172,6 @@
|
|||||||
#define TICKS_LOW(us) (int) (((us)*LTOL/USECPERTICK))
|
#define TICKS_LOW(us) (int) (((us)*LTOL/USECPERTICK))
|
||||||
#define TICKS_HIGH(us) (int) (((us)*UTOL/USECPERTICK + 1))
|
#define TICKS_HIGH(us) (int) (((us)*UTOL/USECPERTICK + 1))
|
||||||
|
|
||||||
#ifndef DEBUG
|
|
||||||
int MATCH(int measured, int desired) {return measured >= TICKS_LOW(desired) && measured <= TICKS_HIGH(desired);}
|
|
||||||
int MATCH_MARK(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us + MARK_EXCESS));}
|
|
||||||
int MATCH_SPACE(int measured_ticks, int desired_us) {return MATCH(measured_ticks, (desired_us - MARK_EXCESS));}
|
|
||||||
// Debugging versions are in IRremote.cpp
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// receiver states
|
// receiver states
|
||||||
#define STATE_IDLE 2
|
#define STATE_IDLE 2
|
||||||
#define STATE_MARK 3
|
#define STATE_MARK 3
|
||||||
|
|||||||
Reference in New Issue
Block a user