Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Armin committed Aug 5, 2023
1 parent 6251c69 commit 8cedd6b
Show file tree
Hide file tree
Showing 22 changed files with 50 additions and 54 deletions.
4 changes: 2 additions & 2 deletions examples/AllProtocolsOnLCD/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/ControlRelay/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/IRDispatcherDemo/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/IRremoteExtensionTest/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/MicroGirs/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/ReceiveAndSend/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/ReceiveDemo/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/ReceiveDump/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/SendAndReceive/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/SendBoseWaveDemo/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/SendDemo/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/SendProntoDemo/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/SendRawDemo/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/SimpleReceiver/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/SimpleSender/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions examples/UnitTest/PinDefinitionsAndMore.h
Expand Up @@ -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
Expand Down
22 changes: 8 additions & 14 deletions src/IRReceive.hpp
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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) {
/*
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/digitalWriteFast.h
Expand Up @@ -27,6 +27,8 @@
# define BIT_WRITE(value, bit, bitvalue) (bitvalue ? BIT_SET(value, bit) : BIT_CLEAR(value, bit))
#endif

#include <Arduino.h> // declarations for the fallback to digitalWrite(), digitalRead() etc.

// --- Arduino Mega and ATmega128x/256x based boards ---
#if (defined(ARDUINO_AVR_MEGA) || \
defined(ARDUINO_AVR_MEGA1280) || \
Expand Down

0 comments on commit 8cedd6b

Please sign in to comment.