mirror of
https://github.com/Theaninova/Arduino-IRremote.git
synced 2026-03-20 11:52:03 +00:00
Fix some minor problems in boarddefs.h and IRremote.cpp (#505)
* Removed some trailing spaces in IRremote.cpp. * IRremote.cpp: fix some compiler warnings (-Wall -Wextra). Remark: braces necessitated by the macro nature of DBG_PRINTLN. * boarddefs.h: removed spurious #. Nuked trailing spaces. Credits: bengtmartensson
This commit is contained in:
committed by
Rafi Khan
parent
4eb95a3272
commit
7245efd2f5
@@ -52,11 +52,12 @@ int MATCH (int measured, int desired)
|
|||||||
DBG_PRINT(TICKS_HIGH(desired), DEC);
|
DBG_PRINT(TICKS_HIGH(desired), DEC);
|
||||||
|
|
||||||
bool passed = ((measured >= TICKS_LOW(desired)) && (measured <= TICKS_HIGH(desired)));
|
bool passed = ((measured >= TICKS_LOW(desired)) && (measured <= TICKS_HIGH(desired)));
|
||||||
if (passed)
|
if (passed) {
|
||||||
DBG_PRINTLN(F("?; passed"));
|
DBG_PRINTLN(F("?; passed"));
|
||||||
else
|
} else {
|
||||||
DBG_PRINTLN(F("?; FAILED"));
|
DBG_PRINTLN(F("?; FAILED"));
|
||||||
return passed;
|
}
|
||||||
|
return passed;
|
||||||
}
|
}
|
||||||
|
|
||||||
//+========================================================
|
//+========================================================
|
||||||
@@ -68,7 +69,7 @@ int MATCH_MARK (int measured_ticks, int desired_us)
|
|||||||
DBG_PRINT(measured_ticks * USECPERTICK, DEC);
|
DBG_PRINT(measured_ticks * USECPERTICK, DEC);
|
||||||
DBG_PRINT(F("us vs "));
|
DBG_PRINT(F("us vs "));
|
||||||
DBG_PRINT(desired_us, DEC);
|
DBG_PRINT(desired_us, DEC);
|
||||||
DBG_PRINT("us");
|
DBG_PRINT("us");
|
||||||
DBG_PRINT(": ");
|
DBG_PRINT(": ");
|
||||||
DBG_PRINT(TICKS_LOW(desired_us + MARK_EXCESS) * USECPERTICK, DEC);
|
DBG_PRINT(TICKS_LOW(desired_us + MARK_EXCESS) * USECPERTICK, DEC);
|
||||||
DBG_PRINT(F(" <= "));
|
DBG_PRINT(F(" <= "));
|
||||||
@@ -78,11 +79,12 @@ int MATCH_MARK (int measured_ticks, int desired_us)
|
|||||||
|
|
||||||
bool passed = ((measured_ticks >= TICKS_LOW (desired_us + MARK_EXCESS))
|
bool passed = ((measured_ticks >= TICKS_LOW (desired_us + MARK_EXCESS))
|
||||||
&& (measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS)));
|
&& (measured_ticks <= TICKS_HIGH(desired_us + MARK_EXCESS)));
|
||||||
if (passed)
|
if (passed) {
|
||||||
DBG_PRINTLN(F("?; passed"));
|
DBG_PRINTLN(F("?; passed"));
|
||||||
else
|
} else {
|
||||||
DBG_PRINTLN(F("?; FAILED"));
|
DBG_PRINTLN(F("?; FAILED"));
|
||||||
return passed;
|
}
|
||||||
|
return passed;
|
||||||
}
|
}
|
||||||
|
|
||||||
//+========================================================
|
//+========================================================
|
||||||
@@ -94,7 +96,7 @@ int MATCH_SPACE (int measured_ticks, int desired_us)
|
|||||||
DBG_PRINT(measured_ticks * USECPERTICK, DEC);
|
DBG_PRINT(measured_ticks * USECPERTICK, DEC);
|
||||||
DBG_PRINT(F("us vs "));
|
DBG_PRINT(F("us vs "));
|
||||||
DBG_PRINT(desired_us, DEC);
|
DBG_PRINT(desired_us, DEC);
|
||||||
DBG_PRINT("us");
|
DBG_PRINT("us");
|
||||||
DBG_PRINT(": ");
|
DBG_PRINT(": ");
|
||||||
DBG_PRINT(TICKS_LOW(desired_us - MARK_EXCESS) * USECPERTICK, DEC);
|
DBG_PRINT(TICKS_LOW(desired_us - MARK_EXCESS) * USECPERTICK, DEC);
|
||||||
DBG_PRINT(F(" <= "));
|
DBG_PRINT(F(" <= "));
|
||||||
@@ -104,11 +106,12 @@ int MATCH_SPACE (int measured_ticks, int desired_us)
|
|||||||
|
|
||||||
bool passed = ((measured_ticks >= TICKS_LOW (desired_us - MARK_EXCESS))
|
bool passed = ((measured_ticks >= TICKS_LOW (desired_us - MARK_EXCESS))
|
||||||
&& (measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS)));
|
&& (measured_ticks <= TICKS_HIGH(desired_us - MARK_EXCESS)));
|
||||||
if (passed)
|
if (passed) {
|
||||||
DBG_PRINTLN(F("?; passed"));
|
DBG_PRINTLN(F("?; passed"));
|
||||||
else
|
} else {
|
||||||
DBG_PRINTLN(F("?; FAILED"));
|
DBG_PRINTLN(F("?; FAILED"));
|
||||||
return passed;
|
}
|
||||||
|
return passed;
|
||||||
}
|
}
|
||||||
|
|
||||||
//+=============================================================================
|
//+=============================================================================
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
# undef HAS_AVR_INTERRUPT_H
|
# undef HAS_AVR_INTERRUPT_H
|
||||||
|
|
||||||
// Sending not implemented
|
// Sending not implemented
|
||||||
# undef SENDING_SUPPORTED#
|
# undef SENDING_SUPPORTED
|
||||||
|
|
||||||
// Supply own enbleIRIn
|
// Supply own enbleIRIn
|
||||||
# undef USE_DEFAULT_ENABLE_IR_IN
|
# undef USE_DEFAULT_ENABLE_IR_IN
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
|| defined(__AVR_ATmega164P__)
|
|| defined(__AVR_ATmega164P__)
|
||||||
//#define IR_USE_TIMER1 // tx = pin 13
|
//#define IR_USE_TIMER1 // tx = pin 13
|
||||||
#define IR_USE_TIMER2 // tx = pin 14
|
#define IR_USE_TIMER2 // tx = pin 14
|
||||||
|
|
||||||
//MegaCore - ATmega64, ATmega128
|
//MegaCore - ATmega64, ATmega128
|
||||||
#elif defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__)
|
#elif defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__)
|
||||||
#define IR_USE_TIMER1 // tx = pin 13
|
#define IR_USE_TIMER1 // tx = pin 13
|
||||||
@@ -624,7 +624,7 @@
|
|||||||
#define TIMER_RESET
|
#define TIMER_RESET
|
||||||
#define TIMER_ENABLE_PWM // Not presently used
|
#define TIMER_ENABLE_PWM // Not presently used
|
||||||
#define TIMER_DISABLE_PWM
|
#define TIMER_DISABLE_PWM
|
||||||
#define TIMER_ENABLE_INTR NVIC_EnableIRQ(TC3_IRQn) // Not presently used
|
#define TIMER_ENABLE_INTR NVIC_EnableIRQ(TC3_IRQn) // Not presently used
|
||||||
#define TIMER_DISABLE_INTR NVIC_DisableIRQ(TC3_IRQn)
|
#define TIMER_DISABLE_INTR NVIC_DisableIRQ(TC3_IRQn)
|
||||||
#define TIMER_INTR_NAME TC3_Handler // Not presently used
|
#define TIMER_INTR_NAME TC3_Handler // Not presently used
|
||||||
#define TIMER_CONFIG_KHZ(f)
|
#define TIMER_CONFIG_KHZ(f)
|
||||||
@@ -645,7 +645,7 @@
|
|||||||
#ifndef SENDPIN_ON
|
#ifndef SENDPIN_ON
|
||||||
#define SENDPIN_ON(pin) digitalWrite(pin, HIGH)
|
#define SENDPIN_ON(pin) digitalWrite(pin, HIGH)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SENDPIN_OFF
|
#ifndef SENDPIN_OFF
|
||||||
#define SENDPIN_OFF(pin) digitalWrite(pin, LOW)
|
#define SENDPIN_OFF(pin) digitalWrite(pin, LOW)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user