Skip to content

Commit

Permalink
Housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
ArminJo committed Nov 20, 2024
1 parent d0ca553 commit 070df40
Show file tree
Hide file tree
Showing 30 changed files with 191 additions and 104 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/LibraryBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ jobs:
- arduino:mbed_rp2040:pico
- rp2040:rp2040:arduino_nano_connect
# - digistump:avr:digispark-tiny:clock=clock16
- ATTinyCore:avr:attinyx5micr:LTO=enable,sketchclock=8pll
- ATTinyCore:avr:attinyx7micr:LTO=enable,sketchclock=16external,pinmapping=new,millis=enabled
- ATTinyCore:avr:attinyx8micr:LTO=enable,sketchclock=16external,pinmapping=mhtiny,millis=enabled # ATtiny88 China clone board @16 MHz
# - ATTinyCore:avr:attinyx5micr:LTO=enable,sketchclock=8pll
# - ATTinyCore:avr:attinyx7micr:LTO=enable,sketchclock=16external,pinmapping=new,millis=enabled
# - ATTinyCore:avr:attinyx8micr:LTO=enable,sketchclock=16external,pinmapping=mhtiny,millis=enabled # ATtiny88 China clone board @16 MHz
- megaTinyCore:megaavr:atxy6:chip=1616,clock=16internal
- megaTinyCore:megaavr:atxy7:chip=3217,clock=16internal
- MiniCore:avr:8:bootloader=uart0,eeprom=keep,BOD=2v7,LTO=Os_flto,clock=16MHz_external # ATmega8
Expand Down Expand Up @@ -93,20 +93,20 @@ jobs:
#
# ATTinyCore
#
- arduino-boards-fqbn: ATTinyCore:avr:attinyx5micr:LTO=enable,sketchclock=8pll
platform-url: http://drazzy.com/package_drazzy.com_index.json
required-libraries: ATtinySerialOut
sketches-exclude: AllProtocols,SendAllProtocols,ReceiveAndSendDynamicPins # Does not fit in FLASH
# - arduino-boards-fqbn: ATTinyCore:avr:attinyx5micr:LTO=enable,sketchclock=8pll
# platform-url: http://drazzy.com/package_drazzy.com_index.json
# required-libraries: ATtinySerialOut
# sketches-exclude: AllProtocols,SendAllProtocols,ReceiveAndSendDynamicPins # Does not fit in FLASH

- arduino-boards-fqbn: ATTinyCore:avr:attinyx8micr:LTO=enable,sketchclock=16external,pinmapping=mhtiny,millis=enabled
platform-url: http://drazzy.com/package_drazzy.com_index.json
required-libraries: ATtinySerialOut
sketches-exclude: AllProtocols,SendAllProtocols,ReceiveAndSendDynamicPins # Does not fit in FLASH
# - arduino-boards-fqbn: ATTinyCore:avr:attinyx8micr:LTO=enable,sketchclock=16external,pinmapping=mhtiny,millis=enabled
# platform-url: http://drazzy.com/package_drazzy.com_index.json
# required-libraries: ATtinySerialOut
# sketches-exclude: AllProtocols,SendAllProtocols,ReceiveAndSendDynamicPins # Does not fit in FLASH

- arduino-boards-fqbn: ATTinyCore:avr:attinyx7micr:LTO=enable,sketchclock=16external,pinmapping=new,millis=enabled
platform-url: http://drazzy.com/package_drazzy.com_index.json
required-libraries: ATtinySerialOut
sketches-exclude: AllProtocols,ReceiveAndSendDynamicPins # No Serial.available() function in ATtinySerialOut
# - arduino-boards-fqbn: ATTinyCore:avr:attinyx7micr:LTO=enable,sketchclock=16external,pinmapping=new,millis=enabled
# platform-url: http://drazzy.com/package_drazzy.com_index.json
# required-libraries: ATtinySerialOut
# sketches-exclude: AllProtocols,ReceiveAndSendDynamicPins # No Serial.available() function in ATtinySerialOut

#
# megaTinyCore
Expand Down Expand Up @@ -188,4 +188,3 @@ jobs:
sketches-exclude: ${{ matrix.sketches-exclude }}
build-properties: ${{ toJson(matrix.build-properties) }}
# debug-install: true
# cli-version: 0.33.0 # to avoid errors for ATTinyCore
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ The **tone library (using timer 2) is still available**. You can use it alternat
- IRSND enabled for non AVR platforms.
### Version 2.0.0
- Added IR send fuctionality (IRSND).
- Added IR send functionality (IRSND).
- Use `TIMER2_COMPB_vect` to be compatible with tone library.
- No longer required to call initPCIInterrupt() manually if IRMP_ENABLE_PIN_CHANGE_INTERRUPT is set.
- Separated code for timer to IRTimer.hpp.
Expand Down
2 changes: 2 additions & 0 deletions examples/AllProtocols/ADCUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,8 @@ uint16_t getVoltageMillivoltWith_1_1VoltReference(uint8_t aADCChannelForVoltageM

/*
* Return true if sVCCVoltageMillivolt is > 4.3 V and < 4.95 V
* This does not really work for the UNO board, because it has no series Diode in the USB VCC
* and therefore a very low voltage drop.
*/
bool isVCCUSBPowered() {
readVCCVoltageMillivolt();
Expand Down
2 changes: 1 addition & 1 deletion examples/AllProtocols/AllProtocols.ino
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void setup()
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217) \
|| defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)
delay(4000); // To be able to connect Serial monitor after reset or power on and before first printout
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
#endif
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRMP));
Expand Down
9 changes: 6 additions & 3 deletions examples/AllProtocols/PinDefinitionsAndMore.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@
#include <Arduino.h>
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
// tone() is included in ESP32 core since 2.0.2
#if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
#endif
# if !defined(ESP_ARDUINO_VERSION)
#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
# endif
# if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
# endif
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
void tone(uint8_t aPinNumber, unsigned int aFrequency){
Expand Down
1 change: 1 addition & 0 deletions examples/Callback/Callback.ino
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);

#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
Expand Down
9 changes: 6 additions & 3 deletions examples/Callback/PinDefinitionsAndMore.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@
#include <Arduino.h>
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
// tone() is included in ESP32 core since 2.0.2
#if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
#endif
# if !defined(ESP_ARDUINO_VERSION)
#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
# endif
# if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
# endif
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
void tone(uint8_t aPinNumber, unsigned int aFrequency){
Expand Down
2 changes: 0 additions & 2 deletions examples/IRDispatcherDemo/IRDispatcherDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ void doTone2200();
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
while (!Serial)
; // Wait for Serial to become available. Is optimized away for some cores.

#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
Expand Down
9 changes: 6 additions & 3 deletions examples/IRDispatcherDemo/PinDefinitionsAndMore.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@
#include <Arduino.h>
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
// tone() is included in ESP32 core since 2.0.2
#if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
#endif
# if !defined(ESP_ARDUINO_VERSION)
#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
# endif
# if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
# endif
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
void tone(uint8_t aPinNumber, unsigned int aFrequency){
Expand Down
2 changes: 1 addition & 1 deletion examples/Interrupt/Interrupt.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void setup() {
Serial.begin(115200);
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
delay(4000); // To be able to connect Serial monitor after reset or power up and before first printout
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
#endif
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRMP));
Expand Down
9 changes: 6 additions & 3 deletions examples/Interrupt/PinDefinitionsAndMore.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@
#include <Arduino.h>
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
// tone() is included in ESP32 core since 2.0.2
#if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
#endif
# if !defined(ESP_ARDUINO_VERSION)
#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
# endif
# if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
# endif
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
void tone(uint8_t aPinNumber, unsigned int aFrequency){
Expand Down
11 changes: 9 additions & 2 deletions examples/OneProtocol/OneProtocol.ino
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,17 @@ void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);

#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
// Wait until Serial Monitor is attached.
// Required for boards using USB code for Serial like Leonardo.
// Is void for USB Serial implementations using external chips e.g. a CH340.
while (!Serial)
;
// !!! Program will not proceed if no Serial Monitor is attached !!!
#endif

// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRMP));

Expand All @@ -112,7 +119,7 @@ void loop()
{
case 0x48:
case 0x40:
Serial.println(F("Received right code an do something"));
Serial.println(F("Received right code and do something"));
digitalWrite(LED_BUILTIN, HIGH);
break;
default:
Expand Down
9 changes: 6 additions & 3 deletions examples/OneProtocol/PinDefinitionsAndMore.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@
#include <Arduino.h>
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
// tone() is included in ESP32 core since 2.0.2
#if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
#endif
# if !defined(ESP_ARDUINO_VERSION)
#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
# endif
# if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
# endif
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
void tone(uint8_t aPinNumber, unsigned int aFrequency){
Expand Down
9 changes: 6 additions & 3 deletions examples/RFProtocols/PinDefinitionsAndMore.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@
#include <Arduino.h>
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
// tone() is included in ESP32 core since 2.0.2
#if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
#endif
# if !defined(ESP_ARDUINO_VERSION)
#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
# endif
# if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
# endif
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
void tone(uint8_t aPinNumber, unsigned int aFrequency){
Expand Down
9 changes: 8 additions & 1 deletion examples/RFProtocols/RFProtocols.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,17 @@ void setup()
// initialize the digital pin as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);

#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
// Wait until Serial Monitor is attached.
// Required for boards using USB code for Serial like Leonardo.
// Is void for USB Serial implementations using external chips e.g. a CH340.
while (!Serial)
;
// !!! Program will not proceed if no Serial Monitor is attached !!!
#endif

// Just to know which program is running on my Arduino
#if defined(ESP8266)
Serial.println();
Expand Down
9 changes: 6 additions & 3 deletions examples/ReceiveAndSend/PinDefinitionsAndMore.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@
#include <Arduino.h>
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
// tone() is included in ESP32 core since 2.0.2
#if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
#endif
# if !defined(ESP_ARDUINO_VERSION)
#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
# endif
# if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
# endif
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
void tone(uint8_t aPinNumber, unsigned int aFrequency){
Expand Down
1 change: 1 addition & 0 deletions examples/ReceiveAndSend/ReceiveAndSend.ino
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);

#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
Expand Down
9 changes: 6 additions & 3 deletions examples/ReceiveAndSendDynamicPins/PinDefinitionsAndMore.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@
#include <Arduino.h>
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
// tone() is included in ESP32 core since 2.0.2
#if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
#endif
# if !defined(ESP_ARDUINO_VERSION)
#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
# endif
# if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
# endif
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
void tone(uint8_t aPinNumber, unsigned int aFrequency){
Expand Down
15 changes: 11 additions & 4 deletions examples/ReceiverTimingAnalysis/ReceiverTimingAnalysis.ino
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ void measureTimingISR(void);

void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
while (!Serial)
; // Wait for Serial to become available. Is optimized away for some cores.

Serial.begin(115200);
#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
// Wait until Serial Monitor is attached.
// Required for boards using USB code for Serial like Leonardo.
// Is void for USB Serial implementations using external chips e.g. a CH340.
while (!Serial)
;
// !!! Program will not proceed if no Serial Monitor is attached !!!
#endif
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__));
Expand All @@ -70,7 +73,11 @@ void setup() {
EIMSK |= _BV(INT1); // enable interrupt on next change
# endif
#else
# if defined(ARDUINO_ARCH_SAMD) // see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/ paragraph: Syntax
attachInterrupt(IR_RECEIVE_PIN, measureTimingISR, CHANGE);
# else
attachInterrupt(digitalPinToInterrupt(IR_RECEIVE_PIN), measureTimingISR, CHANGE);
# endif
#endif
Serial.println(F("Ready to analyze NEC IR signal at pin " STR(IR_RECEIVE_PIN)));
Serial.println();
Expand Down
9 changes: 6 additions & 3 deletions examples/SendAllProtocols/PinDefinitionsAndMore.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@
#include <Arduino.h>
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
// tone() is included in ESP32 core since 2.0.2
#if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
#endif
# if !defined(ESP_ARDUINO_VERSION)
#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
# endif
# if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
# endif
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
void tone(uint8_t aPinNumber, unsigned int aFrequency){
Expand Down
9 changes: 6 additions & 3 deletions examples/SimpleReceiver/PinDefinitionsAndMore.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@
#include <Arduino.h>
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
// tone() is included in ESP32 core since 2.0.2
#if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
#endif
# if !defined(ESP_ARDUINO_VERSION)
#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
# endif
# if !defined(ESP_ARDUINO_VERSION_VAL)
#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch))
# endif
#if ESP_ARDUINO_VERSION <= ESP_ARDUINO_VERSION_VAL(2, 0, 2)
#define TONE_LEDC_CHANNEL 1 // Using channel 1 makes tone() independent of receiving timer -> No need to stop receiving timer.
void tone(uint8_t aPinNumber, unsigned int aFrequency){
Expand Down
9 changes: 8 additions & 1 deletion examples/SimpleReceiver/SimpleReceiver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,17 @@ IRMP_DATA irmp_data;

void setup() {
pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);

#if defined(__AVR_ATmega32U4__) || defined(SERIAL_PORT_USBVIRTUAL) || defined(SERIAL_USB) /*stm32duino*/|| defined(USBCON) /*STM32_stm32*/ \
|| defined(SERIALUSB_PID) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_attiny3217)
delay(4000); // To be able to connect Serial monitor after reset or power up and before first print out. Do not wait for an attached Serial Monitor!
// Wait until Serial Monitor is attached.
// Required for boards using USB code for Serial like Leonardo.
// Is void for USB Serial implementations using external chips e.g. a CH340.
while (!Serial)
;
// !!! Program will not proceed if no Serial Monitor is attached !!!
#endif

// Just to know which program is running on my Arduino
Expand Down
Loading

0 comments on commit 070df40

Please sign in to comment.