diff --git a/examples/AllProtocolsOnLCD/PinDefinitionsAndMore.h b/examples/AllProtocolsOnLCD/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/AllProtocolsOnLCD/PinDefinitionsAndMore.h +++ b/examples/AllProtocolsOnLCD/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/ControlRelay/PinDefinitionsAndMore.h b/examples/ControlRelay/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/ControlRelay/PinDefinitionsAndMore.h +++ b/examples/ControlRelay/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/IRDispatcherDemo/PinDefinitionsAndMore.h b/examples/IRDispatcherDemo/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/IRDispatcherDemo/PinDefinitionsAndMore.h +++ b/examples/IRDispatcherDemo/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h b/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h +++ b/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/MicroGirs/PinDefinitionsAndMore.h b/examples/MicroGirs/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/MicroGirs/PinDefinitionsAndMore.h +++ b/examples/MicroGirs/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/ReceiveAndSend/PinDefinitionsAndMore.h b/examples/ReceiveAndSend/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/ReceiveAndSend/PinDefinitionsAndMore.h +++ b/examples/ReceiveAndSend/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h b/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h +++ b/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/ReceiveDemo/PinDefinitionsAndMore.h b/examples/ReceiveDemo/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/ReceiveDemo/PinDefinitionsAndMore.h +++ b/examples/ReceiveDemo/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/ReceiveDump/PinDefinitionsAndMore.h b/examples/ReceiveDump/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/ReceiveDump/PinDefinitionsAndMore.h +++ b/examples/ReceiveDump/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h b/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h +++ b/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/SendAndReceive/PinDefinitionsAndMore.h b/examples/SendAndReceive/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/SendAndReceive/PinDefinitionsAndMore.h +++ b/examples/SendAndReceive/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h b/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h +++ b/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/SendDemo/PinDefinitionsAndMore.h b/examples/SendDemo/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/SendDemo/PinDefinitionsAndMore.h +++ b/examples/SendDemo/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h b/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h +++ b/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/SendProntoDemo/PinDefinitionsAndMore.h b/examples/SendProntoDemo/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/SendProntoDemo/PinDefinitionsAndMore.h +++ b/examples/SendProntoDemo/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/SendRawDemo/PinDefinitionsAndMore.h b/examples/SendRawDemo/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/SendRawDemo/PinDefinitionsAndMore.h +++ b/examples/SendRawDemo/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/SimpleReceiver/PinDefinitionsAndMore.h b/examples/SimpleReceiver/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/SimpleReceiver/PinDefinitionsAndMore.h +++ b/examples/SimpleReceiver/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h b/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h +++ b/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/SimpleSender/PinDefinitionsAndMore.h b/examples/SimpleSender/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/SimpleSender/PinDefinitionsAndMore.h +++ b/examples/SimpleSender/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/examples/UnitTest/PinDefinitionsAndMore.h b/examples/UnitTest/PinDefinitionsAndMore.h index d794db4a..aa85fddd 100644 --- a/examples/UnitTest/PinDefinitionsAndMore.h +++ b/examples/UnitTest/PinDefinitionsAndMore.h @@ -153,8 +153,8 @@ # endif # endif // defined(__AVR_ATtiny25__)... -#elif defined(ARDUINO_ARCH_RENESAS_UNO) // UNO R4 -// To be compatible with UNO R3. +#elif defined(ARDUINO_ARCH_RENESAS_UNO) // Uno R4 +// To be compatible with Uno R3. #define IR_RECEIVE_PIN 2 #define IR_SEND_PIN 3 #define TONE_PIN 4 diff --git a/src/IRReceive.hpp b/src/IRReceive.hpp index a1bf0b48..ddbd6a23 100644 --- a/src/IRReceive.hpp +++ b/src/IRReceive.hpp @@ -124,7 +124,7 @@ IRrecv::IRrecv(uint_fast8_t aReceivePin, uint_fast8_t aFeedbackLEDPin) { #if defined(ESP8266) || defined(ESP32) IRAM_ATTR #endif -void IRReceiveTimerInterruptHandler(){ +void IRReceiveTimerInterruptHandler() { #if defined(_IR_MEASURE_TIMING) && defined(_IR_TIMING_TEST_PIN) digitalWriteFast(_IR_TIMING_TEST_PIN, HIGH); // 2 clock cycles #endif @@ -173,7 +173,7 @@ void IRReceiveTimerInterruptHandler(){ irparams.rawlen = 1; irparams.StateForISR = IR_REC_STATE_MARK; } // otherwise stay in idle state - irparams.TickCounterForISR = 0;// reset counter in both cases + irparams.TickCounterForISR = 0; // reset counter in both cases } } else if (irparams.StateForISR == IR_REC_STATE_MARK) { // Timing mark @@ -186,7 +186,7 @@ void IRReceiveTimerInterruptHandler(){ #endif irparams.rawbuf[irparams.rawlen++] = irparams.TickCounterForISR; // record mark irparams.StateForISR = IR_REC_STATE_SPACE; - irparams.TickCounterForISR = 0;// This resets the tick counter also at end of frame :-) + irparams.TickCounterForISR = 0; // This resets the tick counter also at end of frame :-) } } else if (irparams.StateForISR == IR_REC_STATE_SPACE) { // Timing space @@ -664,6 +664,7 @@ bool IRrecv::decodePulseDistanceWidthData(uint_fast8_t aNumberOfBits, uint_fast8 // get one mark and space pair unsigned int tMarkTicks; unsigned int tSpaceTicks; + bool tBitValue; if (isPulseDistanceProtocol) { /* @@ -676,6 +677,7 @@ bool IRrecv::decodePulseDistanceWidthData(uint_fast8_t aNumberOfBits, uint_fast8 tRawBufPointer++; #endif tSpaceTicks = *tRawBufPointer++; // maybe buffer overflow for last bit, but we do not evaluate this value :-) + tBitValue = matchSpace(tSpaceTicks, aOneSpaceMicros); // Check for variable length space indicating a 1 or 0 #if defined DECODE_STRICT_CHECKS // Check for constant length mark @@ -698,6 +700,8 @@ bool IRrecv::decodePulseDistanceWidthData(uint_fast8_t aNumberOfBits, uint_fast8 * Pulse width here, it is not required to check (constant) space duration and zero mark duration. */ tMarkTicks = *tRawBufPointer++; + tBitValue = matchMark(tMarkTicks, aOneMarkMicros); // Check for variable length mark indicating a 1 or 0 + #if defined DECODE_STRICT_CHECKS tSpaceTicks = *tRawBufPointer++; // maybe buffer overflow for last bit, but we do not evaluate this value :-) #else @@ -710,17 +714,7 @@ bool IRrecv::decodePulseDistanceWidthData(uint_fast8_t aNumberOfBits, uint_fast8 if (aMSBfirst) { tDecodedData <<= 1; } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" - bool tBitValue; - if (isPulseDistanceProtocol) { - // Check for variable length space indicating a 1 or 0 - tBitValue = matchSpace(tSpaceTicks, aOneSpaceMicros); // tSpaceTicks is initialized here, even if some compiler are complaining! - } else { - // Check for variable length mark indicating a 1 or 0 - tBitValue = matchMark(tMarkTicks, aOneMarkMicros); // tMarkTicks is initialized here, even if some compiler are complaining! - } -#pragma GCC diagnostic pop + if (tBitValue) { // It's a 1 -> set the bit if (aMSBfirst) { diff --git a/src/digitalWriteFast.h b/src/digitalWriteFast.h index 5da51110..1bb8eb50 100644 --- a/src/digitalWriteFast.h +++ b/src/digitalWriteFast.h @@ -27,6 +27,8 @@ # define BIT_WRITE(value, bit, bitvalue) (bitvalue ? BIT_SET(value, bit) : BIT_CLEAR(value, bit)) #endif +#include // declarations for the fallback to digitalWrite(), digitalRead() etc. + // --- Arduino Mega and ATmega128x/256x based boards --- #if (defined(ARDUINO_AVR_MEGA) || \ defined(ARDUINO_AVR_MEGA1280) || \