mirror of
https://github.com/Theaninova/Arduino-IRremote.git
synced 2026-01-03 12:02:56 +00:00
Cleaned up the DEBUG output
This commit is contained in:
67
IRremote.cpp
67
IRremote.cpp
@@ -24,6 +24,15 @@
|
|||||||
// Provides ISR
|
// Provides ISR
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// Debug directives
|
||||||
|
#ifdef DEBUG
|
||||||
|
# define DBG_PRINTLN(s) Serial.println(s);
|
||||||
|
#else
|
||||||
|
# define DBG_PRINTLN(s)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
volatile irparams_t irparams;
|
volatile irparams_t irparams;
|
||||||
|
|
||||||
// These versions of MATCH, MATCH_MARK, and MATCH_SPACE are only for debugging.
|
// These versions of MATCH, MATCH_MARK, and MATCH_SPACE are only for debugging.
|
||||||
@@ -87,7 +96,6 @@ int MATCH_SPACE (int measured_ticks, int desired_us)
|
|||||||
{
|
{
|
||||||
return MATCH(measured_ticks, (desired_us - MARK_EXCESS));
|
return MATCH(measured_ticks, (desired_us - MARK_EXCESS));
|
||||||
}
|
}
|
||||||
// Debugging versions are in IRremote.cpp
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -481,86 +489,62 @@ int IRrecv::decode (decode_results *results)
|
|||||||
results->rawlen = irparams.rawlen;
|
results->rawlen = irparams.rawlen;
|
||||||
if (irparams.rcvstate != STATE_STOP) return ERR ;
|
if (irparams.rcvstate != STATE_STOP) return ERR ;
|
||||||
#ifdef DECODE_NEC
|
#ifdef DECODE_NEC
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting NEC decode");
|
||||||
Serial.println("Attempting NEC decode");
|
|
||||||
#endif
|
|
||||||
if (decodeNEC(results)) return DECODED ;
|
if (decodeNEC(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_SONY
|
#ifdef DECODE_SONY
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting Sony decode");
|
||||||
Serial.println("Attempting Sony decode");
|
|
||||||
#endif
|
|
||||||
if (decodeSony(results)) return DECODED ;
|
if (decodeSony(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_SANYO
|
#ifdef DECODE_SANYO
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting Sanyo decode");
|
||||||
Serial.println("Attempting Sanyo decode");
|
|
||||||
#endif
|
|
||||||
if (decodeSanyo(results)) return DECODED ;
|
if (decodeSanyo(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_MITSUBISHI
|
#ifdef DECODE_MITSUBISHI
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting Mitsubishi decode");
|
||||||
Serial.println("Attempting Mitsubishi decode");
|
|
||||||
#endif
|
|
||||||
if (decodeMitsubishi(results)) return DECODED ;
|
if (decodeMitsubishi(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_RC5
|
#ifdef DECODE_RC5
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting RC5 decode");
|
||||||
Serial.println("Attempting RC5 decode");
|
|
||||||
#endif
|
|
||||||
if (decodeRC5(results)) return DECODED ;
|
if (decodeRC5(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_RC6
|
#ifdef DECODE_RC6
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting RC6 decode");
|
||||||
Serial.println("Attempting RC6 decode");
|
|
||||||
#endif
|
|
||||||
if (decodeRC6(results)) return DECODED ;
|
if (decodeRC6(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_PANASONIC
|
#ifdef DECODE_PANASONIC
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting Panasonic decode");
|
||||||
Serial.println("Attempting Panasonic decode");
|
|
||||||
#endif
|
|
||||||
if (decodePanasonic(results)) return DECODED ;
|
if (decodePanasonic(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_LG
|
#ifdef DECODE_LG
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting LG decode");
|
||||||
Serial.println("Attempting LG decode");
|
|
||||||
#endif
|
|
||||||
if (decodeLG(results)) return DECODED ;
|
if (decodeLG(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_JVC
|
#ifdef DECODE_JVC
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting JVC decode");
|
||||||
Serial.println("Attempting JVC decode");
|
|
||||||
#endif
|
|
||||||
if (decodeJVC(results)) return DECODED ;
|
if (decodeJVC(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_SAMSUNG
|
#ifdef DECODE_SAMSUNG
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting SAMSUNG decode");
|
||||||
Serial.println("Attempting SAMSUNG decode");
|
|
||||||
#endif
|
|
||||||
if (decodeSAMSUNG(results)) return DECODED ;
|
if (decodeSAMSUNG(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DECODE_WHYNTER
|
#ifdef DECODE_WHYNTER
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting Whynter decode");
|
||||||
Serial.println("Attempting Whynter decode");
|
|
||||||
#endif
|
|
||||||
if (decodeWhynter(results)) return DECODED ;
|
if (decodeWhynter(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef AIWA_RC_T501
|
#ifdef AIWA_RC_T501
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN("Attempting Aiwa RC-T501 decode");
|
||||||
Serial.println("Attempting Aiwa RC-T501 decode");
|
|
||||||
#endif
|
|
||||||
if (decodeAiwaRCT501(results)) return DECODED ;
|
if (decodeAiwaRCT501(results)) return DECODED ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -848,14 +832,7 @@ int IRrecv::getRClevel (decode_results *results, int *offset, int *used, int
|
|||||||
*used = 0;
|
*used = 0;
|
||||||
(*offset)++;
|
(*offset)++;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
DBG_PRINTLN( (val == MARK) ? "MARK" : "SPACE" );
|
||||||
if (val == MARK) {
|
|
||||||
Serial.println("MARK");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Serial.println("SPACE");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user