Skip to content

Commit cf374e6

Browse files
committed
Support for old 2.x code
1 parent 48137fa commit cf374e6

File tree

23 files changed

+95
-42
lines changed

23 files changed

+95
-42
lines changed

.github/workflows/LibraryBuild.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
- arduino:avr:uno|SEND_PWM_BY_TIMER
5151
- arduino:avr:leonardo
5252
- arduino:megaavr:nona4809:mode=off
53+
- megaTinyCore:megaavr:atxy4:chip=1604,clock=16internal
5354
- digistump:avr:digispark-tiny:clock=clock1
5455
- ATTinyCore:avr:attinyx5:chip=85,clock=1internal
5556
- TinyCore:avr:tiny32
@@ -100,9 +101,9 @@ jobs:
100101
- arduino-boards-fqbn: arduino:samd:arduino_zero_native
101102
sketches-exclude: MinimalReceiver,IRDispatcherDemo
102103

103-
- arduino-boards-fqbn: SparkFun:avr:promicro
104-
arduino-platform: arduino:avr,SparkFun:avr
105-
platform-url: https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json # Arduino URL is not required here
104+
- arduino-boards-fqbn: megaTinyCore:megaavr:atxy4:chip=1604,clock=16internal
105+
platform-url: http://drazzy.com/package_drazzy.com_index.json
106+
sketches-exclude: MinimalReceiver,IRDispatcherDemo // digitalWriteFast.h not available for this board
106107

107108
- arduino-boards-fqbn: digistump:avr:digispark-tiny:clock=clock1
108109
platform-url: https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json
@@ -150,6 +151,10 @@ jobs:
150151
platform-url: http://dan.drown.org/stm32duino/package_STM32duino_index.json
151152
sketches-exclude: IR2Keyboard,MinimalReceiver
152153

154+
- arduino-boards-fqbn: SparkFun:avr:promicro
155+
arduino-platform: arduino:avr,SparkFun:avr
156+
platform-url: https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json # Arduino URL is not required here
157+
153158
- arduino-boards-fqbn: sandeepmistry:nRF5:BBCmicrobit
154159
platform-url: https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json
155160
sketches-exclude: IR2Keyboard,IRDispatcherDemo,MicroGirs,MinimalReceiver # no tone()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ If you use a core that does not use the `-flto` flag for compile, you can activa
6060
- Seldom used: `results.rawbuf` and `results.rawlen` must be replaced by `IrReceiver.decodedIRData.rawDataPtr->rawbuf` and `IrReceiver.decodedIRData.rawDataPtr->rawlen`.
6161

6262
# Running your 2.x program with the 3.x library version
63-
If you program is of style:
63+
If you program is like:
6464
```
6565
IRrecv irrecv(RECV_PIN);
6666
decode_results results;

examples/ControlRelay/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define tone(a,b,c) void() // no tone() available on ESP32
5959
#define noTone(a) void()
6060
#define TONE_PIN 42 // Dummy for examples using it
61+
#define APPLICATION_PIN 16 // RX2 pin
6162

6263
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)
6364
// BluePill in 2 flavors
@@ -108,6 +109,7 @@
108109
#elif defined(__AVR_ATtiny1604__)
109110
#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
110111
#define IR_SEND_PIN 3
112+
#define APPLICATION_PIN 5
111113
#define TONE_PIN 42 // Dummy for examples using it
112114
#define tone(a,b,c) void() // tone() uses the same vector as receive timer
113115
#define noTone(a) void()

examples/ReceiveAndSend/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define tone(a,b,c) void() // no tone() available on ESP32
5959
#define noTone(a) void()
6060
#define TONE_PIN 42 // Dummy for examples using it
61+
#define APPLICATION_PIN 16 // RX2 pin
6162

6263
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)
6364
// BluePill in 2 flavors
@@ -108,6 +109,7 @@
108109
#elif defined(__AVR_ATtiny1604__)
109110
#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
110111
#define IR_SEND_PIN 3
112+
#define APPLICATION_PIN 5
111113
#define TONE_PIN 42 // Dummy for examples using it
112114
#define tone(a,b,c) void() // tone() uses the same vector as receive timer
113115
#define noTone(a) void()

examples/ReceiveAndSend/ReceiveAndSend.ino

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@
5353

5454
#include <IRremote.h>
5555

56-
#if defined(ESP32)
57-
int SEND_BUTTON_PIN = 16; // RX2 pin
58-
#else
59-
int SEND_BUTTON_PIN = 12;
60-
#endif
56+
int SEND_BUTTON_PIN = APPLICATION_PIN;
6157
int STATUS_PIN = LED_BUILTIN;
6258

6359
int DELAY_BETWEEN_REPEAT = 50;

examples/ReceiveDemo/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define tone(a,b,c) void() // no tone() available on ESP32
5959
#define noTone(a) void()
6060
#define TONE_PIN 42 // Dummy for examples using it
61+
#define APPLICATION_PIN 16 // RX2 pin
6162

6263
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)
6364
// BluePill in 2 flavors
@@ -108,6 +109,7 @@
108109
#elif defined(__AVR_ATtiny1604__)
109110
#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
110111
#define IR_SEND_PIN 3
112+
#define APPLICATION_PIN 5
111113
#define TONE_PIN 42 // Dummy for examples using it
112114
#define tone(a,b,c) void() // tone() uses the same vector as receive timer
113115
#define noTone(a) void()

examples/ReceiveDump/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define tone(a,b,c) void() // no tone() available on ESP32
5959
#define noTone(a) void()
6060
#define TONE_PIN 42 // Dummy for examples using it
61+
#define APPLICATION_PIN 16 // RX2 pin
6162

6263
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)
6364
// BluePill in 2 flavors
@@ -108,6 +109,7 @@
108109
#elif defined(__AVR_ATtiny1604__)
109110
#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
110111
#define IR_SEND_PIN 3
112+
#define APPLICATION_PIN 5
111113
#define TONE_PIN 42 // Dummy for examples using it
112114
#define tone(a,b,c) void() // tone() uses the same vector as receive timer
113115
#define noTone(a) void()

examples/SendBoseWaveDemo/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define tone(a,b,c) void() // no tone() available on ESP32
5959
#define noTone(a) void()
6060
#define TONE_PIN 42 // Dummy for examples using it
61+
#define APPLICATION_PIN 16 // RX2 pin
6162

6263
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)
6364
// BluePill in 2 flavors
@@ -108,6 +109,7 @@
108109
#elif defined(__AVR_ATtiny1604__)
109110
#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
110111
#define IR_SEND_PIN 3
112+
#define APPLICATION_PIN 5
111113
#define TONE_PIN 42 // Dummy for examples using it
112114
#define tone(a,b,c) void() // tone() uses the same vector as receive timer
113115
#define noTone(a) void()

examples/SendDemo/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define tone(a,b,c) void() // no tone() available on ESP32
5959
#define noTone(a) void()
6060
#define TONE_PIN 42 // Dummy for examples using it
61+
#define APPLICATION_PIN 16 // RX2 pin
6162

6263
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)
6364
// BluePill in 2 flavors
@@ -108,6 +109,7 @@
108109
#elif defined(__AVR_ATtiny1604__)
109110
#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
110111
#define IR_SEND_PIN 3
112+
#define APPLICATION_PIN 5
111113
#define TONE_PIN 42 // Dummy for examples using it
112114
#define tone(a,b,c) void() // tone() uses the same vector as receive timer
113115
#define noTone(a) void()

examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define tone(a,b,c) void() // no tone() available on ESP32
5959
#define noTone(a) void()
6060
#define TONE_PIN 42 // Dummy for examples using it
61+
#define APPLICATION_PIN 16 // RX2 pin
6162

6263
#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)
6364
// BluePill in 2 flavors
@@ -108,6 +109,7 @@
108109
#elif defined(__AVR_ATtiny1604__)
109110
#define IR_RECEIVE_PIN 2 // To be compatible with interrupt example, pin 2 is chosen here.
110111
#define IR_SEND_PIN 3
112+
#define APPLICATION_PIN 5
111113
#define TONE_PIN 42 // Dummy for examples using it
112114
#define tone(a,b,c) void() // tone() uses the same vector as receive timer
113115
#define noTone(a) void()

0 commit comments

Comments
 (0)