Skip to content

A Hardware Hacking Tool with Web-Based CLI That Speaks Every Protocol

correct iremote lib for m5 devices, update the state to includ ir pins

Geo401fbc8f7068
diff --git a/lib/IRremote/.github/ISSUE_TEMPLATE/bug_report.yml b/lib/IRremote/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 00000000..95c4245c
--- /dev/null
+++ b/lib/IRremote/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,227 @@
+name: "🐛 Bug Report"
+description: Only if something isn't working as expected 🤔, otherwise please open a discussion.
+title: "[Bug]: "
+
+body:
+ - type: markdown
+ attributes:
+ value: |
+ **Thanks for reporting an issue!**
+
+ **Issues are expected to lead to changes in the repository, like code or documentation improvements or bug fixes.**
+ If you have handling problems or questions, consider to post in [Discussions](../discussions) instead.
+
+ # Environment
+
+ - type: dropdown
+ id: Board
+ attributes:
+ label: The type of board you are using.
+ options:
+ - Arduino ATmega328* board (Uno, Nano, etc.)
+ - Arduino ATmega2560 board (Mega)
+ - Arduino ATmega32U4 board (Leonardo, etc.)
+ - Arduino ATmega4809 megaAVR board (NanoEvery)
+ - Arduino SAM board (Due)
+ - Arduino SAMD board (Zero, MKR*)
+ - ATtiny85 board (ATTinyCore by Spence Conde)
+ - Digispark board
+ - ATtiny3217 board (TinyCore)
+ - ESP32 board - first check https://github.com/crankyoldgit/IRremoteESP8266
+ - STM32F1 board (BluePill)
+ - Teensy board
+ - Other - please specify below
+ validations:
+ required: true
+
+ - type: input
+ id: Other_board_NAME_FQBN
+ attributes:
+ label: The boards name or FQBN (e.g. esp8266:esp8266:d1_mini:eesz=4M3M,xtal=80) for unspecified board.
+ validations:
+ required: false
+
+ - type: input
+ id: Other_board_URL
+ attributes:
+ label: The board manager URL used for unspecified board.
+ value: "https://"
+ validations:
+ required: false
+
+ - type: dropdown
+ id: IDE
+ attributes:
+ label: What IDE are you using?
+ options:
+ - Arduino IDE
+ - Arduino Web Editor
+ - Arduino Pro IDE
+ - Sloeber IDE
+ - PlatformIO IDE
+ - Other - please specify below
+ multiple: false
+ validations:
+ required: true
+
+ - type: dropdown
+ id: IR_Protocol
+ attributes:
+ label: What IR protocol are you using?
+ options:
+ - Unknown
+ - BoseWave
+ - Denon
+ - Dish
+ - FAST
+ - JVC
+ - Lego
+ - LG
+ - NEC
+ - Panasonic
+ - RC5, RC6
+ - Samsung
+ - Sharp
+ - Sony
+ - Whynter
+ - Other - please specify below
+ multiple: true
+ validations:
+ required: true
+
+ - type: input
+ id: IR_Pin
+ attributes:
+ label: Pin(s) used for IR-receive, if not default.
+ value: "Arduino pin number: default"
+ validations:
+ required: false
+
+ - type: checkboxes
+ id: Checked_examples
+ attributes:
+ label: Example(s) you have checked while hunting the bug.
+ description: Please do not submit a bug report without testing at least one or more examples!
+ options:
+ - label: SimpleReceiver
+ - label: ReceiveDemo
+ - label: SendRawDemo
+ - label: ReceiverTimingAnalysis
+ - label: TinyReceiver
+ - label: TinySender
+ - label: ReceiveAndSend
+ - label: SimpleSender
+ - label: SendDemo
+ - label: SendLGAirConditionerDemo
+ - label: UnitTest
+ - label: Other - please specify below
+ - label: I checked, if at least one of the examples was working.
+ required: true
+
+ - type: checkboxes
+ id: Failed_examples
+ attributes:
+ label: Example(s) to reproduce the issue.
+ description: Select only the examples which shows your error.
+ options:
+ - label: SimpleReceiver
+ - label: ReceiveDemo
+ - label: SendRawDemo
+ - label: ReceiverTimingAnalysis
+ - label: TinyReceiver
+ - label: TinySender
+ - label: ReceiveAndSend
+ - label: SimpleSender
+ - label: SendDemo
+ - label: SendLGAirConditionerDemo
+ - label: UnitTest
+ - label: Other - please specify below
+
+ - type: checkboxes
+ id: Version
+ attributes:
+ label: The library version you are working with.
+ description: |
+ You may use the latest repo version, which is not (yet) released, but may contain some bugfixes.
+ Your current library version number can be found with *Arduino > Tools > Manage Libraries..* (Ctrl+Shift+I)
+ and is printed to serial output at the startup of every example.
+ options:
+ - label: I use the [latest Arduino library version](../releases) and verified this!
+ - label: I use the latest repo version ([download link](../archive/master.zip)) and verified this!
+
+ - type: markdown
+ attributes:
+ value: |
+ # Bug descripion
+
+ - type: textarea
+ id: bug-steps
+ attributes:
+ label: What are the steps to reproduce this issue?
+ placeholder: |
+ 1.
+ 2.
+ 3.
+ 4. See error
+ validations:
+ required: true
+
+ - type: textarea
+ id: bug-description
+ attributes:
+ label: What happens?
+ description: A clear and concise description of what the bug is.
+ validations:
+ required: true
+
+ - type: textarea
+ id: bug-logs
+ attributes:
+ label: The serial output which indicates the error happened.
+ description: |
+ Please copy and paste any relevant serial output. This will be automatically formatted into code, so no need for backticks.
+ render: shell
+ validations:
+ required: false
+
+ - type: textarea
+ id: bug-expectation
+ attributes:
+ label: What were you expecting to happen?
+ description: A clear and concise description of what was supposed to happen.
+ validations:
+ required: false
+
+ - type: textarea
+ id: bug-context
+ attributes:
+ label: Additional context.
+ description: Add any other context you can provide about the problem here.
+ validations:
+ required: false
+
+ - type: markdown
+ attributes:
+ value: |
+ # Checklist
+
+ - type: checkboxes
+ id: Commitments
+ attributes:
+ label: Final checklist for the bug report.
+ options:
+ - label: I have **read** the README.md file thoroughly
+ required: true
+ - label: I have searched existing issues to see if there is anything I have missed.
+ required: true
+ - label: I have browsed the examples for one, that matches my use case.
+ required: true
+ - label: The title of the issue is helpful and relevant.
+ required: true
+
+ - type: markdown
+ attributes:
+ value: |
+ ** We will start to close or delete issues that do not follow these guidelines
+ as it doesn't help the contributors who spend time trying to solve issues if the community ignores guidelines!**
+
diff --git a/lib/IRremote/.github/ISSUE_TEMPLATE/config.yml b/lib/IRremote/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 00000000..3ba13e0c
--- /dev/null
+++ b/lib/IRremote/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1 @@
+blank_issues_enabled: false
diff --git a/lib/IRremote/.github/workflows/LibraryBuild.yml b/lib/IRremote/.github/workflows/LibraryBuild.yml
new file mode 100644
index 00000000..c6dbb9b0
--- /dev/null
+++ b/lib/IRremote/.github/workflows/LibraryBuild.yml
@@ -0,0 +1,312 @@
+# https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/.github/workflows/LibraryBuild.yml
+# Github workflow script to test compile all examples of an Arduino library repository.
+#
+# Copyright (C) 2020-2023 Armin Joachimsmeyer
+# https://github.com/ArminJo/Github-Actions
+#
+# Before being able to push to my .github\workflows directories,
+# I had to create a new personal token with workflow enabled at https://github.com/settings/tokens
+
+# This is the name of the workflow, visible on GitHub UI.
+name: LibraryBuild
+on:
+ workflow_dispatch: # To run it manually
+ description: 'manual build check'
+ push: # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
+ paths:
+ - '**.ino'
+ - '**.cpp'
+ - '**.hpp'
+ - '**.h'
+ - '**LibraryBuild.yml'
+ pull_request:
+ paths:
+ - '**.ino'
+ - '**.cpp'
+ - '**.hpp'
+ - '**.h'
+ - '**LibraryBuild.yml'
+
+jobs:
+ build:
+ name: ${{ matrix.arduino-boards-fqbn }} - test compiling examples
+
+ runs-on: ubuntu-22.04 # I picked Ubuntu to use shell scripts.
+
+ strategy:
+ matrix:
+ # The matrix will produce one job for each configuration parameter of type `arduino-boards-fqbn`
+ # In the Arduino IDE, the fqbn is printed in the first line of the verbose output for compilation as parameter -fqbn=... for the "arduino-builder -dump-prefs" command
+ #
+ # Examples: arduino:avr:uno, arduino:avr:leonardo, arduino:avr:nano, arduino:avr:mega
+ # arduino:sam:arduino_due_x, arduino:samd:arduino_zero_native"
+ # ATTinyCore:avr:attinyx5:chip=85,clock=1internal
+ # STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8
+ # esp8266:esp8266:huzzah:eesz=4M3M,xtal=80, esp32:esp32:featheresp32:FlashFreq=80
+ # You may add a suffix behind the fqbn with "|" to specify one board for e.g. different compile options like arduino:avr:uno|trace
+ #############################################################################################################
+ arduino-boards-fqbn:
+ - arduino:avr:uno
+ - arduino:avr:uno|DEBUG
+ - arduino:avr:uno|USE_NO_SEND_PWM
+ - arduino:avr:uno|SEND_PWM_BY_TIMER
+ - arduino:avr:uno|USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN
+ - arduino:avr:mega:cpu=atmega2560
+ - arduino:avr:leonardo
+ - arduino:megaavr:nona4809:mode=off
+ - arduino:samd:arduino_zero_native
+ - arduino:renesas_uno:unor4wifi
+ - adafruit:samd:adafruit_metro_m4:cache=on,speed=120,opt=small,maxqspi=50,usbstack=arduino,debug=off
+ - arduino:mbed:nano33ble
+ - arduino:mbed_rp2040:pico
+ - rp2040:rp2040:arduino_nano_connect
+# - ATTinyCore:avr:attinyx5micr:LTO=enable,sketchclock=16pll
+# - 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
+ - MegaCore:avr:128:bootloader=no_bootloader,eeprom=keep,BOD=2v7,LTO=Os_flto,clock=8MHz_internal # ATmega128
+ - SparkFun:avr:promicro
+# - megaTinyCore:megaavr:atxy4:chip=1604,clock=16internal # https://github.com/SpenceKonde/megaTinyCore/issues/935
+# - megaTinyCore:megaavr:atxy7:chip=3217,clock=16internal # https://github.com/SpenceKonde/megaTinyCore/issues/935
+ - esp8266:esp8266:d1_mini:eesz=4M3M,xtal=80
+ - esp32:esp32:featheresp32:FlashFreq=80
+ - esp32:esp32:esp32c3
+ - STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8
+ - STMicroelectronics:stm32:GenL0:pnum=THUNDERPACK_L072
+ - stm32duino:STM32F1:genericSTM32F103C
+ - sandeepmistry:nRF5:BBCmicrobit
+ - Seeeduino:samd:seeed_XIAO_m0:usbstack=arduino,debug=off,sercom4=include
+
+ # Specify parameters for each board.
+ # With sketches-exclude you may exclude specific examples for a board. Use a comma separated list.
+ #############################################################################################################
+ include:
+ - arduino-boards-fqbn: arduino:avr:uno
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ ReceiveDemo: -DIR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=1200 -DIR_SEND_PIN=3
+
+ - arduino-boards-fqbn: arduino:avr:uno|DEBUG
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750 -DIR_SEND_PIN=3
+ TinyReceiver: -DUSE_CALLBACK_FOR_TINY_RECEIVER
+ All: -DEBUG
+
+ - arduino-boards-fqbn: arduino:avr:uno|USE_NO_SEND_PWM
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750 -DIR_SEND_PIN=3
+ TinyReceiver: -DUSE_FAST_PROTOCOL
+ TinySender: -DUSE_FAST_PROTOCOL
+ All: -DUSE_NO_SEND_PWM
+
+ - arduino-boards-fqbn: arduino:avr:uno|SEND_PWM_BY_TIMER
+ sketches-exclude: UnitTest
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750 -DIR_SEND_PIN=3 -DSEND_PWM_BY_TIMER
+ ReceiveDemo: -DDECODE_ONKYO
+ TinyReceiver: -DUSE_ONKYO_PROTOCOL
+ TinySender: -DUSE_ONKYO_PROTOCOL
+ All: -DSEND_PWM_BY_TIMER
+
+ - arduino-boards-fqbn: arduino:avr:uno|USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750 -DIR_SEND_PIN=3 -DUSE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN
+ SimpleSender: -DSEND_PWM_BY_TIMER
+ TinyReceiver: -DENABLE_NEC2_REPEATS
+ TinySender: -DENABLE_NEC2_REPEATS
+ All: -DUSE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN
+
+ - arduino-boards-fqbn: arduino:avr:mega:cpu=atmega2560
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750
+ SimpleSender: -DSEND_PWM_BY_TIMER
+ TinyReceiver: -DDISABLE_PARITY_CHECKS
+ TinySender: -DDISABLE_PARITY_CHECKS
+
+ - arduino-boards-fqbn: arduino:avr:leonardo
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750
+ TinyReceiver: -DNO_LED_FEEDBACK_CODE
+ TinySender: -DNO_LED_FEEDBACK_CODE
+# sketches-exclude: ReceiveAndSend # Not enough RAM for default RAW_BUFFER_LENGTH
+
+ - arduino-boards-fqbn: arduino:megaavr:nona4809:mode=off
+ sketches-exclude: TinyReceiver,IRDispatcherDemo
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750
+ SimpleSender: -DSEND_PWM_BY_TIMER
+ TinyReceiver: -DUSE_ONKYO_PROTOCOL -DENABLE_NEC2_REPEATS -DNO_LED_FEEDBACK_CODE -DUSE_CALLBACK_FOR_TINY_RECEIVER
+ TinySender: -DUSE_ONKYO_PROTOCOL -DENABLE_NEC2_REPEATS -DNO_LED_FEEDBACK_CODE
+
+ - arduino-boards-fqbn: arduino:samd:arduino_zero_native
+ sketches-exclude: TinyReceiver,IRDispatcherDemo
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750
+
+ - arduino-boards-fqbn: arduino:renesas_uno:unor4wifi
+ sketches-exclude: TinyReceiver,IRDispatcherDemo
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750
+
+ - arduino-boards-fqbn: adafruit:samd:adafruit_metro_m4:cache=on,speed=120,opt=small,maxqspi=50,usbstack=arduino,debug=off
+ platform-url: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
+ sketches-exclude: TinyReceiver,IRDispatcherDemo
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750
+
+ - arduino-boards-fqbn: arduino:mbed:nano33ble
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750
+ SimpleSender: -DSEND_PWM_BY_TIMER
+
+#
+# RP2040
+#
+ - arduino-boards-fqbn: arduino:mbed_rp2040:pico
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=750
+ SimpleSender: -DSEND_PWM_BY_TIMER
+
+ - arduino-boards-fqbn: rp2040:rp2040:arduino_nano_connect
+ platform-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ IRremoteExtensionTest: -DSEND_PWM_BY_TIMER
+ SimpleSender: -DSEND_PWM_BY_TIMER
+ All: -DRAW_BUFFER_LENGTH=750
+
+#
+# megaTinyCore
+#
+# https://github.com/SpenceKonde/megaTinyCore/issues/935
+# - arduino-boards-fqbn: megaTinyCore:megaavr:atxy4:chip=1604,clock=16internal
+# arduino-platform: megaTinyCore:megaavr
+# platform-url: http://drazzy.com/package_drazzy.com_index.json
+# sketches-exclude: AllProtocolsOnLCD
+# build-properties: # the flags were put in compiler.cpp.extra_flags
+# IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=360
+
+# https://github.com/SpenceKonde/megaTinyCore/issues/935
+# - arduino-boards-fqbn: megaTinyCore:megaavr:atxy7:chip=3217,clock=16internal
+# arduino-platform: megaTinyCore:megaavr
+# platform-url: http://drazzy.com/package_drazzy.com_index.json
+# sketches-exclude: AllProtocolsOnLCD
+# build-properties: # the flags were put in compiler.cpp.extra_flags
+# IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=360
+
+#
+# ATTinyCore
+#
+# - arduino-boards-fqbn: ATTinyCore:avr:attinyx5micr:LTO=enable,sketchclock=16pll
+# platform-url: http://drazzy.com/package_drazzy.com_index.json
+# required-libraries: ATtinySerialOut
+# sketch-names: TinyReceiver.ino,IRremoteInfo.ino,SimpleReceiver.ino,ReceiveDemo.ino,ControlRelay.ino,SimpleSender.ino,SendDemo.ino,SendRawDemo.ino,SendAndReceive.ino
+# build-properties: # the flags were put in compiler.cpp.extra_flags
+# SimpleSender: -DSEND_PWM_BY_TIMER
+
+# - 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
+# sketch-names: TinyReceiver.ino,IRremoteInfo.ino,SimpleReceiver.ino,ReceiveDemo.ino,ControlRelay.ino,SimpleSender.ino,SendDemo.ino,SendRawDemo.ino,SendAndReceive.ino
+# build-properties: # the flags were put in compiler.cpp.extra_flags
+# SimpleSender: -DSEND_PWM_BY_TIMER
+
+# - arduino-boards-fqbn: ATTinyCore:avr:attinyx8micr:LTO=enable,sketchclock=16external,pinmapping=mhtiny,millis=enabled # ATtiny88 China clone board @16 MHz
+# platform-url: http://drazzy.com/package_drazzy.com_index.json
+# required-libraries: ATtinySerialOut
+# sketch-names: TinyReceiver.ino,IRremoteInfo.ino,SimpleReceiver.ino,ReceiveDemo.ino,ControlRelay.ino,SimpleSender.ino,SendDemo.ino,SendRawDemo.ino,SendAndReceive.ino
+# build-properties: # the flags were put in compiler.cpp.extra_flags
+# SimpleSender: -DSEND_PWM_BY_TIMER
+
+#
+# MegaCore
+#
+ - arduino-boards-fqbn: MegaCore:avr:128:bootloader=no_bootloader,eeprom=keep,BOD=2v7,LTO=Os_flto,clock=8MHz_internal
+ platform-url: https://mcudude.github.io/MegaCore/package_MCUdude_MegaCore_index.json
+ arduino-platform: arduino:avr,MegaCore:avr # gcc is taken from arduino:avr
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ SimpleSender: -DSEND_PWM_BY_TIMER
+ All: -DRAW_BUFFER_LENGTH=750
+
+#
+# ESP
+#
+ - arduino-boards-fqbn: esp8266:esp8266:d1_mini:eesz=4M3M,xtal=80
+ platform-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
+ sketches-exclude: TinyReceiver
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ All: -DRAW_BUFFER_LENGTH=750
+
+ - arduino-boards-fqbn: esp32:esp32:featheresp32:FlashFreq=80
+ platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
+ arduino-platform: esp32:[email protected] # latest 2.x version as of 5/2024
+ sketches-exclude: TinyReceiver # undefined reference to `TwoWire::onReceive(void (*)(int))'
+ build-properties: # the flags were put in compiler.cpp.extra_flags. SEND_PWM_BY_TIMER is always enabled!
+ IRremoteExtensionTest: -Wno-error=maybe-uninitialized
+ All: -DRAW_BUFFER_LENGTH=750 -Wno-error=maybe-uninitialized # https://github.com/espressif/arduino-esp32/issues/7024
+
+ - arduino-boards-fqbn: esp32:esp32:esp32c3
+ platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
+ arduino-platform: esp32:[email protected] # latest 2.x version as of 5/2024
+ sketches-exclude: TinyReceiver # undefined reference to `TwoWire::onReceive(void (*)(int))'
+ build-properties: # the flags were put in compiler.cpp.extra_flags. SEND_PWM_BY_TIMER is always enabled!
+ IRremoteExtensionTest: -Wno-error=maybe-uninitialized
+ All: -DRAW_BUFFER_LENGTH=750 -Wno-error=maybe-uninitialized # https://github.com/espressif/arduino-esp32/issues/7024
+
+#
+# STM
+#
+ - arduino-boards-fqbn: STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 # ST version
+ platform-url: https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/main/package_stmicroelectronics_index.json
+ sketches-exclude: TinyReceiver
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ All: -DRAW_BUFFER_LENGTH=750
+
+ - arduino-boards-fqbn: STMicroelectronics:stm32:GenL0:pnum=THUNDERPACK_L072 # ST version
+ platform-url: https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/main/package_stmicroelectronics_index.json
+ sketches-exclude: TinyReceiver,IRDispatcherDemo
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ All: -DRAW_BUFFER_LENGTH=750
+
+ - arduino-boards-fqbn: stm32duino:STM32F1:genericSTM32F103C # Roger Clark version
+ platform-url: http://dan.drown.org/stm32duino/package_STM32duino_index.json
+ sketches-exclude: TinyReceiver
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ All: -DRAW_BUFFER_LENGTH=750
+
+#
+# Others
+#
+ - arduino-boards-fqbn: SparkFun:avr:promicro
+ arduino-platform: arduino:avr,SparkFun:avr
+ platform-url: https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json # Arduino URL is not required here
+ build-properties: # the flags were put in compiler.cpp.extra_flags. SEND_PWM_BY_TIMER is always enabled!
+ All: -DRAW_BUFFER_LENGTH=750
+
+ - arduino-boards-fqbn: sandeepmistry:nRF5:BBCmicrobit
+ platform-url: https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json
+ sketches-exclude: IRDispatcherDemo,MicroGirs,TinyReceiver
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ All: -DRAW_BUFFER_LENGTH=750
+
+ - arduino-boards-fqbn: Seeeduino:samd:seeed_XIAO_m0:usbstack=arduino,debug=off,sercom4=include
+ platform-url: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
+ sketches-exclude: AllProtocolsOnLCD,UnitTest,ReceiveAndSendDistanceWidth # No print(uint64_t,.) available
+ build-properties: # the flags were put in compiler.cpp.extra_flags
+ All: -DRAW_BUFFER_LENGTH=750
+
+# fail-fast: false # false -> do not cancel all jobs / architectures if one job fails
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+
+ - name: Compile all examples using the arduino-test-compile action
+ uses: ArminJo/arduino-test-compile@master
+ with:
+ arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
+ arduino-platform: ${{ matrix.arduino-platform }}
+ platform-url: ${{ matrix.platform-url }}
+ required-libraries: ${{ matrix.required-libraries }}
+ sketch-names: ${{ matrix.sketch-names }}
+ sketches-exclude: ${{ matrix.sketches-exclude }}
+ build-properties: ${{ toJson(matrix.build-properties) }}
+ cli-version: 0.33.0 # to avoid errors for ATTinyCore
diff --git a/lib/IRremote/.github/workflows/PlatformIoPublish.yml b/lib/IRremote/.github/workflows/PlatformIoPublish.yml
new file mode 100644
index 00000000..cc9b32a1
--- /dev/null
+++ b/lib/IRremote/.github/workflows/PlatformIoPublish.yml
@@ -0,0 +1,43 @@
+# PlatformIoPublish.yml
+# Github workflow script to publish a release to PlatformIo.
+#
+# Copyright (C) 2021-2023 Armin Joachimsmeyer
+# https://github.com/ArminJo/Github-Actions
+#
+
+# This is the name of the workflow, visible on GitHub UI.
+name: PlatformIo publishing
+on:
+ workflow_dispatch: # To run it manually
+ description: manual PlatformIo publishing
+ release: # see: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#example-using-multiple-events-with-activity-types-or-configuration
+ types:
+ - created
+
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ steps:
+
+ - name: Checkout
+ uses: actions/checkout@master
+
+ - name: Set up Python
+ uses: actions/setup-python@master
+ with:
+ python-version: '3.x'
+
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install platformio
+
+ - name: Build and publish
+ env:
+ PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_TOKEN }}
+ run: |
+ pio package publish --owner arminjo --non-interactive
+# run: |
+# pio package pack
+# pio package publish --owner arminjo --non-interactive
+
\ No newline at end of file
diff --git a/lib/IRremote/.piopm b/lib/IRremote/.piopm
index 4a46513a..780e0a06 100644
--- a/lib/IRremote/.piopm
+++ b/lib/IRremote/.piopm
@@ -1 +1 @@
-{"type": "library", "name": "IRremote", "version": "4.4.3", "spec": {"owner": "z3t0", "id": 4, "name": "IRremote", "requirements": null, "uri": null}}
\ No newline at end of file
+{"type": "library", "name": "IRremote", "version": "4.4.1", "spec": {"owner": "z3t0", "id": 4, "name": "IRremote", "requirements": null, "uri": null}}
\ No newline at end of file
diff --git a/lib/IRremote/Contributing.md b/lib/IRremote/Contributing.md
index 7483472d..4424f809 100644
--- a/lib/IRremote/Contributing.md
+++ b/lib/IRremote/Contributing.md
@@ -18,7 +18,7 @@ Refrain from using overly long or capitalized titles as they are usually annoyin
We use the original [C Style by Kerninghan / Ritchie](https://en.wikipedia.org/wiki/Indentation_style#K&R_style) in [variant: 1TBS (OTBS)](https://en.wikipedia.org/wiki/Indentation_style#Variant:_1TBS_(OTBS)).<br/>
In short: 4 spaces indentation, no tabs, opening braces on the same line, braces are mandatory on all if/while/do, no hard line length limit.<br/>
To beautify your code, you may use the online formatter [here](https://www.freecodeformat.com/c-format.php).
-#### Cover **all** occurrences of the problem / addition you address with your PR
+#### Cover **all** occurences of the problem / addition you address with your PR
Do not forget the documentation like it is done for existing code. Code changes without proper documentation will be rejected!
## Adding new protocols
diff --git a/lib/IRremote/Contributors.md b/lib/IRremote/Contributors.md
index f016310a..40c04046 100644
--- a/lib/IRremote/Contributors.md
+++ b/lib/IRremote/Contributors.md
@@ -32,6 +32,5 @@ These are the active contributors of this project that you may contact if there
- [Joe Ostrander](https://github.com/joeostrander) Added support for attiny1614.
- [Buzzerb](https://github.com/Buzzerb) Added Extended NEC protocol to TinyIR and making it more consistent.
- [akellai](https://github.com/akellai) Added ESP 3.0 support.
-- [Hayden McAfee](https://github.com/haydenmc) Help with UnoR4 support.
Note: Please let [ArminJo](https://github.com/ArminJo) know if you have been missed.
diff --git a/lib/IRremote/README.md b/lib/IRremote/README.md
index 10289a46..8280c069 100644
--- a/lib/IRremote/README.md
+++ b/lib/IRremote/README.md
@@ -32,33 +32,25 @@ Available as [Arduino library "IRremote"](https://www.arduinolibraries.info/libr
# Table of content
- [Supported IR Protocols](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#supported-ir-protocols)
-- [Common problem with IRremote](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#common-problem-with-irremote)
-- [Using the new library version for old examples](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#using-the-new-library-version-for-old-examples)
- * [New features of version 4.x](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#new-features-of-version-4x)
- * [New features of version 3.x](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#new-features-of-version-3x)
- * [Converting your 2.x program to the 4.x version](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#converting-your-2x-program-to-the-4x-version)
+- [Features](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#features)
+ * [New features with version 4.x](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#new-features-with-version-4x)
+ * [New features with version 3.x](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#new-features-with-version-3x)
+- [Converting your 2.x program to the 4.x version](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#converting-your-2x-program-to-the-4x-version)
* [How to convert old MSB first 32 bit IR data codes to new LSB first 32 bit IR data codes](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#how-to-convert-old-msb-first-32-bit-ir-data-codes-to-new-lsb-first-32-bit-ir-data-codes)
- * [Errors when using the 3.x versions for old tutorials](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#errors-when-using-the-3x-versions-for-old-tutorials)
+- [Errors with using the 3.x versions for old tutorials](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#errors-with-using-the-3x-versions-for-old-tutorials)
* [Staying on 2.x](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#staying-on-2x)
- [Why *.hpp instead of *.cpp](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#why-hpp-instead-of-cpp)
- [Using the new *.hpp files](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#using-the-new-hpp-files)
-- [Tutorials](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#tutorials)
- [3 ways to specify an IR code](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#3-ways-to-specify-an-ir-code)
- [IRReceiver pinouts](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#irreceiver-pinouts)
- [Receiving IR codes](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#receiving-ir-codes)
* [decodedIRData structure](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#decodedirdata-structure)
* [Ambiguous protocols](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#ambiguous-protocols)
+ * [Unknown protocol](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#unknown-protocol)
* [RAM usage of different protocolsl](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#ram-usage-of-different-protocols)
- * [Handling unknown Protocols](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#handling-unknown-protocols)
- * [Disclaimer](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#disclaimer)
- * [Other libraries, which may cover these protocols](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#other-libraries-which-may-cover-these-protocols)
- * [Protocol=PULSE_DISTANCE](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#protocolpulse_distance)
- * [Protocol=UNKNOWN](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#protocolunknown)
- * [How to deal with protocols not supported by IRremote](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#how-to-deal-with-protocols-not-supported-by-irremote)
- [Sending IR codes](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#sending-ir-codes)
* [Sending IRDB IR codes](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#sending-irdb-ir-codes)
* [Send pin](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#send-pin)
- * [Polarity of send pin](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#polarity-of-send-pin)
+ [List of public IR code databases](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#list-of-public-ir-code-databases)
- [Tiny NEC receiver and sender](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#tiny-nec-receiver-and-sender)
- [The FAST protocol](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#the-fast-protocol)
@@ -67,13 +59,17 @@ Available as [Arduino library "IRremote"](https://www.arduinolibraries.info/libr
* [Receiving sets overflow flag](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#receiving-sets-overflow-flag)
* [Problems with Neopixels, FastLed etc.](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#problems-with-neopixels-fastled-etc)
* [Does not work/compile with another library](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#does-not-workcompile-with-another-library)
- * [Multiple IR receiver and sender instances](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#multiple-ir-receiver-and-sender-instances)
+ * [Multiple IR receiver](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#multiple-ir-receiver)
* [Increase strength of sent output signal](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#increase-strength-of-sent-output-signal)
* [Minimal CPU clock frequency](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#minimal-cpu-clock-frequency)
* [Bang & Olufsen protocol](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#bang--olufsen-protocol)
+- [Handling unknown Protocols](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#handling-unknown-protocols)
+ * [Disclaimer](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#disclaimer)
+ * [Protocol=PULSE_DISTANCE](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#protocolpulse_distance)
+ * [Protocol=UNKNOWN](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#protocolunknown)
+ * [How to deal with protocols not supported by IRremote](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#how-to-deal-with-protocols-not-supported-by-irremote)
- [Examples for this library](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#examples-for-this-library)
- [WOKWI online examples](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#wokwi-online-examples)
-- [IR control of a robot car](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#ir-control-of-a-robot-car)
- [Issues and discussions](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#issues-and-discussions)
- [Compile options / macros for this library](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#compile-options--macros-for-this-library)
+ [Changing include (*.h) files with Arduino IDE](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#changing-include-h-files-with-arduino-ide)
@@ -114,15 +110,12 @@ Protocols can be switched off and on by defining macros before the line `#includ
```
<br/>
-# Common problem with IRremote
-Or *"I build a gadged with 2 motors controlled by IR and the [IR stops after the first motor command](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#receiving-stops-after-analogwrite-or-tone-or-after-running-a-motor)"*.<br/>
-This is due to the fact, that the motor control by AnalogWrite() uses the same timer as IR receiving.<br/>
-See [this table](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#timer-and-pin-usage) for the list of timers and pins.
+# Features
+- Lots of tutorials and examples.
+- Actively maintained.
+- Allows receiving and sending of **raw timing data**.
-# Using the new library version for old examples
-This library has been refactored, breaking backward compatibility with the old version, on which many examples on the Internet are based.
-
-## New features of version 4.x
+## New features with version 4.x
- **Since 4.3 `IrSender.begin(DISABLE_LED_FEEDBACK)` will no longer work**, use `IrSender.begin(DISABLE_LED_FEEDBACK, 0)` instead.
- New universal **Pulse Distance / Pulse Width / Pulse Distance Width decoder** added, which covers many previous unknown protocols.
- Printout of code how to send received command by `IrReceiver.printIRSendUsage(&Serial)`.
@@ -132,18 +125,18 @@ This library has been refactored, breaking backward compatibility with the old v
- New FAST protocol.
- Automatic printout of the **corresponding send function** with `printIRSendUsage()`.
-### Converting your 3.x program to the 4.x version
+#### Converting your 3.x program to the 4.x version
- You must replace `#define DECODE_DISTANCE` by `#define DECODE_DISTANCE_WIDTH` (only if you explicitly enabled this decoder).
- The parameter `bool hasStopBit` is not longer required and removed e.g. for function `sendPulseDistanceWidth()`.
-## New features of version 3.x
+## New features with version 3.x
- **Any pin** can be used for receiving and if `SEND_PWM_BY_TIMER` is not defined also for sending.
- Feedback LED can be activated for sending / receiving.
- An 8/16 bit ****command** value as well as an 16 bit **address** and a protocol number is provided for decoding (instead of the old 32 bit value).
- Protocol values comply to **protocol standards**.<br/>
NEC, Panasonic, Sony, Samsung and JVC decode & send LSB first.
- Supports **Universal Distance protocol**, which covers a lot of previous unknown protocols.
-- Compatible with **tone()** library. See the [ReceiveDemo](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino#L284-L298) example.
+- Compatible with **tone()** library. See the [ReceiveDemo](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/21b5747a58e9d47c9e3f1beb056d58c875a92b47/examples/ReceiveDemo/ReceiveDemo.ino#L159-L169) example.
- Simultaneous sending and receiving. See the [SendAndReceive](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SendAndReceive/SendAndReceive.ino#L167-L170) example.
- Supports **more platforms**.
- Allows for the generation of non PWM signal to just **simulate an active low receiver signal** for direct connect to existent receiving devices without using IR.
@@ -155,13 +148,12 @@ This library has been refactored, breaking backward compatibility with the old v
<br/>
-## Converting your 2.x program to the 4.x version
+# Converting your 2.x program to the 4.x version
Starting with the 3.1 version, **the generation of PWM for sending is done by software**, thus saving the hardware timer and **enabling arbitrary output pins for sending**.<br/>
-If you use an (old) Arduino core that does not use the `-flto` flag for compile, you can activate the line `#define SUPPRESS_ERROR_MESSAGE_FOR_BEGIN` in IRRemote.h,
-if you get false error messages regarding begin() during compilation.
+If you use an (old) Arduino core that does not use the `-flto` flag for compile, you can activate the line `#define SUPPRESS_ERROR_MESSAGE_FOR_BEGIN` in IRRemote.h, if you get false error messages regarding begin() during compilation.
- **IRreceiver** and **IRsender** object have been added and can be used without defining them, like the well known Arduino **Serial** object.
-- Just remove the line `IRrecv IrReceiver(IR_RECEIVE_PIN);` and/or `IRsend IrSender;` in your program and replace all occurrences of `IRrecv.` or `irrecv.` with `IrReceiver` and replace all `IRsend` or `irsend` with `IrSender`.
+- Just remove the line `IRrecv IrReceiver(IR_RECEIVE_PIN);` and/or `IRsend IrSender;` in your program, and replace all occurrences of `IRrecv.` or `irrecv.` with `IrReceiver` and replace all `IRsend` or `irsend` with `IrSender`.
- Since the decoded values are now in `IrReceiver.decodedIRData` and not in `results` any more, remove the line `decode_results results` or similar.
- Like for the Serial object, call [`IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK)`](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino#L106)
or `IrReceiver.begin(IR_RECEIVE_PIN, DISABLE_LED_FEEDBACK)` instead of the `IrReceiver.enableIRIn()` or `irrecv.enableIRIn()` in setup().<br/>
@@ -173,9 +165,7 @@ If IR_SEND_PIN is not defined (before the line `#include <IRremote.hpp>`) you mu
- Overflow, Repeat and other flags are now in [`IrReceiver.receivedIRData.flags`](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRProtocol.h#L90-L101).
- Seldom used: `results.rawbuf` and `results.rawlen` must be replaced by `IrReceiver.decodedIRData.rawDataPtr->rawbuf` and `IrReceiver.decodedIRData.rawDataPtr->rawlen`.
-- The 5 protocols **NEC, Panasonic, Sony, Samsung and JVC** have been converted to LSB first. Send functions for sending old MSB data were renamed to `sendNECMSB`, `sendSamsungMSB()`, `sendSonyMSB()` and `sendJVCMSB()`.
-The old `sendSAMSUNG()` and `sendSony()` MSB functions are still available.
-The old MSB version of `sendPanasonic()` function was deleted, since it had bugs nobody recognized and therefore was assumed to be never used.<br/>
+- The 5 protocols **NEC, Panasonic, Sony, Samsung and JVC** have been converted to LSB first. Send functions for sending old MSB data were renamed to `sendNECMSB`, `sendSamsungMSB()`, `sendSonyMSB()` and `sendJVCMSB()`. The old `sendSAMSUNG()` and `sendSony()` MSB functions are still available. The old MSB version of `sendPanasonic()` function was deleted, since it had bugs nobody recognized and therfore was assumed to be never used.<br/>
For converting MSB codes to LSB see [below](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#how-to-convert-old-msb-first-32-bit-ir-data-codes-to-new-lsb-first-32-bit-ir-data-codes).
### Example
@@ -230,54 +220,32 @@ void loop() {
}
```
-#### Sample output
-For more, see the [UnitTest log](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/UnitTest/UnitTest.log).
-
-```
-Protocol=NEC Address=0xF1 Command=0x76 Raw-Data=0x89760EF1 32 bits LSB first
-Send with: IrSender.sendNEC(0xF1, 0x76, <numberOfRepeats>);
-
-Protocol=Kaseikyo_Denon Address=0xFF1 Command=0x76 Raw-Data=0x9976FF10 48 bits LSB first
-Send with: IrSender.sendKaseikyo_Denon(0xFF1, 0x76, <numberOfRepeats>);
-```
-
## How to convert old MSB first 32 bit IR data codes to new LSB first 32 bit IR data codes
For the new decoders for **NEC, Panasonic, Sony, Samsung and JVC**, the result `IrReceiver.decodedIRData.decodedRawData` is now **LSB-first**, as the definition of these protocols suggests!<br/>
<br/>
-To convert one into the other, you must reverse the nibble (4 bit / Hex numbers) positions and then reverse all bit positions of each nibble or write it as one binary string and reverse/mirror it.
-
-### Nibble reverse
-`0xCB 34 01 02` MSB value<br/>
+To convert one into the other, you must reverse the byte/nibble positions and then reverse all bit positions of each byte/nibble or write it as one binary string and reverse/mirror it.<br/><br/>
+Example:
+`0xCB 34 01 02`<br/>
`0x20 10 43 BC` after nibble reverse<br/>
-`0x40 80 2C D3` LSB value after bit reverse of each nibble
-
-### Nibble reverse map
+`0x40 80 2C D3` after bit reverse of each nibble<br/><br/>
+### Nibble reverse map:
```
0->0 1->8 2->4 3->C
4->2 5->A 6->6 7->E
8->1 9->9 A->5 B->D
C->3 D->B E->7 F->F
```
-
-### Binary string reverse
-If you **read the first binary sequence backwards** (right to left), you get the second sequence.<br/>
`0xCB340102` is binary `1100 1011 0011 0100 0000 0001 0000 0010`.<br/>
-`0x40802CD3` is binary `0100 0000 1000 0000 0010 1100 1101 0011`.
-
-### IRremote functions
-Use `bitreverseOneByte()` or `bitreverse32Bit()` for reversing.
+`0x40802CD3` is binary `0100 0000 1000 0000 0010 1100 1101 0011`.<br/>
+If you **read the first binary sequence backwards** (right to left), you get the second sequence.
+You may use `bitreverseOneByte()` or `bitreverse32Bit()` for this.
-### Online tool which reverses every byte, but not the order of the bytes
-Use this [tool provided by analysir](https://www.analysir.com/hex2nec.php).
-
-### Send MSB directly
Sending old MSB codes without conversion can be done by using `sendNECMSB()`, `sendSonyMSB()`, `sendSamsungMSB()`, `sendJVCMSB()`.
<br/>
-## Errors when using the 4.x versions for old tutorials
-If you suffer from errors with old tutorial code including `IRremote.h` instead of `IRremote.hpp`,
-just try to rollback to [Version 2.4.0](https://github.com/Arduino-IRremote/Arduino-IRremote/releases/tag/v2.4.0).<br/>
+# Errors with using the 4.x versions for old tutorials
+If you suffer from errors with old tutorial code including `IRremote.h` instead of `IRremote.hpp`, just try to rollback to [Version 2.4.0](https://github.com/Arduino-IRremote/Arduino-IRremote/releases/tag/v2.4.0).<br/>
Most likely your code will run and you will not miss the new features.
<br/>
@@ -303,8 +271,7 @@ In the Arduino IDE the calls are executed when you click on *Verify* or *Upload*
And now our problem with Arduino is:<br/>
**How to set [compile options](#compile-options--macros-for-this-library) for all *.cpp files, especially for libraries used?**<br/>
-IDE's like [Sloeber](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-sloeber-ide) or
-[PlatformIO](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-platformio) support this by allowing to specify a set of options per project.
+IDE's like [Sloeber](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-sloeber-ide) or [PlatformIO](https://github.com/ArminJo/ServoEasing#modifying-compile-options--macros-with-platformio) support this by allowing to specify a set of options per project.
They add these options at each compiler call e.g. `-DTRACE`.
But Arduino lacks this feature.
@@ -336,10 +303,6 @@ The following macros will definitely be overridden with default values otherwise
<br/>
-# Tutorials
-- A very elaborated introduction to IR remotes and IRremote library from [DroneBot Workshop ](https://dronebotworkshop.com/ir-remotes/).
-
-
# 3 ways to specify an IR code
There are 3 different ways of specifying a particular IR code.
@@ -387,9 +350,6 @@ Often the address is also constant, which further reduces memory requirements.
# IRReceiver pinouts
![IRReceiver Pinout](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/pictures/IRReceiverPinout.jpg)
-[Adafruit IR Sensor tutorial](https://learn.adafruit.com/ir-sensor)
-
-
# Receiving IR codes
In your program you check for a **completely received IR frame** with:<br/>
`if (IrReceiver.decode()) {}`<br/>
@@ -440,8 +400,7 @@ IrReceiver.printIRResultShort(&Serial);
```c++
IrReceiver.printIRResultRawFormatted(&Serial, true);`
```
-The raw data depends on the internal state of the Arduino timer in relation to the received signal and might therefore be slightly different each time. (resolution problem).
-The decoded values are the interpreted ones which are tolerant to such slight differences!
+The raw data depends on the internal state of the Arduino timer in relation to the received signal and might therefore be slightly different each time. (resolution problem). The decoded values are the interpreted ones which are tolerant to such slight differences!
#### Print how to send the received data:
```c++
@@ -475,10 +434,16 @@ But be careful, the NEC2 protocol can only be detected by the NEC library decode
### Samsung, SamsungLG
On a long press, the **SamsungLG protocol** does not repeat its frame, it sends a special short repeat frame.
+## Unknown protocol
+Use the **ReceiveDemo example** to print out all informations about your IR protocol.<br/>
+The **ReceiveDump example** gives you more information but has bad repeat detection.
+
+If your protocol seems not to be supported by this library, you may try the [IRMP library](https://github.com/IRMP-org/IRMP), which especially supports manchester protocols much better.
+
## RAM usage of different protocols
The `RAW_BUFFER_LENGTH` determines the length of the **byte buffer** where the received IR timing data is stored before decoding.<br/>
**100** is sufficient for standard protocols **up to 48 bits**, with 1 bit consisting of one mark and space.
-We always require additional 4 bytes, 1 byte for initial gap, 2 bytes for header and 1 byte for stop bit.
+We always require additional 4 btes, 1 byte for initial gap, 2 bytes for header and 1 byte for stop bit.
- **48** bit protocols are PANASONIC, KASEIKYO, SAMSUNG48, RC6.
- **32** bit protocols like NEC, SAMSUNG, WHYNTER, SONY(20), LG(28) require a **buffer length of 68**.
- **16** bit protocols like BOSEWAVE, DENON, FAST, JVC, LEGO_PF, RC5, SONY(12 or 15) require a **buffer length of 36**.
@@ -488,71 +453,8 @@ We always require additional 4 bytes, 1 byte for initial gap, 2 bytes for header
If the record gap determined by `RECORD_GAP_MICROS` is changed from the default 8 ms to more than 20 ms, the buffer is no longer a byte but a uint16_t buffer, requiring twice as much RAM.
<br/>
-## Handling unknown Protocols
-### Disclaimer
-**This library was designed to fit inside MCUs with relatively low levels of resources and was intended to work as a library together with other applications which also require some resources of the MCU to operate.**
-
-Use the **ReceiveDemo example** to print out all informations about your IR protocol.<br/>
-The **ReceiveDump example** gives you more information but has bad repeat detection due to the time required for printing the information.
-
-### Other libraries, which may cover these protocols
-#### IRMP
-If your protocol seems not to be supported by this library, you may try the [IRMP library](https://github.com/IRMP-org/IRMP), which especially supports manchester protocols much better.
-
-#### IRremoteESP8266
-For **air conditioners** , you may try the [IRremoteESP8266 library](https://github.com/crankyoldgit/IRremoteESP8266), which supports an impressive set of protocols and a lot of air conditioners and works also on ESP32.
-
-#### rawirdecode and HeatpumpIR
-[Raw-IR-decoder-for-Arduino](https://github.com/ToniA/Raw-IR-decoder-for-Arduino) is not a library, but an arduino example sketch, which provides many methods of decoding especially **air conditioner** protocols. Sending of these protocols can be done by the Arduino library [HeatpumpIR](https://github.com/ToniA/arduino-heatpumpir).
-
-
-### Protocol=PULSE_DISTANCE
-If you get something like this:
-```
-PULSE_DISTANCE: HeaderMarkMicros=8900 HeaderSpaceMicros=4450 MarkMicros=550 OneSpaceMicros=1700 ZeroSpaceMicros=600 NumberOfBits=56 0x43D8613C 0x3BC3BC
-```
-then you have a code consisting of **56 bits**, which is probably from an air conditioner remote.<br/>
-You can send it with `sendPulseDistanceWidth()`.
-```c++
-uint32_t tRawData[] = { 0xB02002, 0xA010 };
-IrSender.sendPulseDistance(38, 3450, 1700, 450, 1250, 450, 400, &tRawData[0], 48, false, 0, 0);
-```
-You can send it with calling `sendPulseDistanceWidthData()` twice, once for the first 32 bit and next for the remaining 24 bits.<br/>
-The `PULSE_DISTANCE` / `PULSE_WIDTH` decoder just decodes a timing stream to a bitstream stored as hex values.
-These decoders can not put any semantics like address, command or checksum on this bitstream.
-But the bitstream is way more readable, than a timing stream. This bitstream is read **LSB first by default**.
-If LSB does not suit for further research, you can change it [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/ir_DistanceProtocol.hpp#L78).
-
-**If RAM is not more than 2k, the decoder only accepts mark or space durations up to 2500 microseconds to save RAM space, otherwise it accepts durations up to 10 ms.**
-
-### Protocol=UNKNOWN
-If you see something like `Protocol=UNKNOWN Hash=0x13BD886C 35 bits received` as output of e.g. the ReceiveDemo example, you either have a problem with decoding a protocol, or an unsupported protocol.
-
-- If you have an **odd number of bits** received, your receiver circuit probably has problems. Maybe because the IR signal is too weak.
-- If you see timings like `+ 600,- 600 + 550,- 150 + 200,- 100 + 750,- 550` then one 450 &micro;s space was split into two 150 and 100 &micro;s spaces with a spike / error signal of 200 &micro;s between. Maybe because of a defective receiver or a weak signal in conjunction with another light emitting source nearby.
-- If you see timings like `+ 500,- 550 + 450,- 550 + 450,- 500 + 500,-1550`, then marks are generally shorter than spaces and therefore `MARK_EXCESS_MICROS` (specified in your ino file) should be **negative** to compensate for this at decoding.
-- If you see `Protocol=UNKNOWN Hash=0x0 1 bits received` it may be that the space after the initial mark is longer than [`RECORD_GAP_MICROS`](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRremote.h#L124).
- This was observed for some LG air conditioner protocols. Try again with a line e.g. `#define RECORD_GAP_MICROS 12000` before the line `#include <IRremote.hpp>` in your .ino file.
-- To see more info supporting you to find the reason for your UNKNOWN protocol, you must enable the line `//#define DEBUG` in IRremoteInt.h.
-
-### How to deal with protocols not supported by IRremote
-If you do not know which protocol your IR transmitter uses, you have several choices.
-- Just use the hash value to decide which command was received. See the [SimpleReceiverForHashCodes example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiverForHashCodes/SimpleReceiverForHashCodes.ino).
-- Use the [IRreceiveDemo example](examples/ReceiveDemo) or [IRreceiveDump example](examples/ReceiveDump) to dump out the IR timing.
- You can then reproduce/send this timing with the [SendRawDemo example](examples/SendRawDemo).
-- The [IRMP AllProtocol example](https://github.com/IRMP-org/IRMP#allprotocol-example) prints the protocol and data for one of the **[40 supported protocols](https://github.com/IRMP-org/IRMP?tab=readme-ov-file#list-of-protocols)**.
- The same library can be used to send this codes.
-- If you have a bigger Arduino board at hand (> 100 kByte program memory) you can try the
- [IRremoteDecode example](https://github.com/bengtmartensson/Arduino-DecodeIR/blob/master/examples/IRremoteDecode/IRremoteDecode.ino) of the Arduino library [DecodeIR](https://github.com/bengtmartensson/Arduino-DecodeIR).
-- Use [IrScrutinizer](http://www.harctoolbox.org/IrScrutinizer.html).
- It can automatically generate a send sketch for your protocol by exporting as "Arduino Raw". It supports IRremote,
- the old [IRLib](https://github.com/cyborg5/IRLib) and [Infrared4Arduino](https://github.com/bengtmartensson/Infrared4Arduino).
-
-<br/>
-
# Sending IR codes
-If you have a device at hand which can generate the IR codes you want to work with (aka IR remote),
-**it is recommended** to receive the codes with the [ReceiveDemo example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino), which will tell you on the serial output how to send them.
+If you have a device at hand which can generate the IR codes you want to work with (aka IR remote), **it is recommended** to receive the codes with the [ReceiveDemo example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino), which will tell you on the serial output how to send them.
```
Protocol=LG Address=0x2 Command=0x3434 Raw-Data=0x23434E 28 bits MSB first
@@ -561,41 +463,28 @@ Send with: IrSender.sendLG(0x2, 0x3434, <numberOfRepeats>);
You will discover that **the address is a constant** and the commands sometimes are sensibly grouped.<br/>
If you are uncertain about the numbers of repeats to use for sending, **3** is a good starting point. If this works, you can check lower values afterwards.
-If you have enabled `DECODE_DISTANCE_WIDTH`, the code printed by `printIRSendUsage()` **differs between 8 and 32 bit platforms**,
-so it is best to run the receiving program on the same platform as the sending program.
+If you have enabled `DECODE_DISTANCE_WIDTH`, the code printed by `printIRSendUsage()` **differs between 8 and 32 bit platforms**, so it is best to run the receiving program on the same platform as the sending program.
**All sending functions support the sending of repeats** if sensible.
Repeat frames are sent at a fixed period determined by the protocol. e.g. 110 ms from start to start for NEC.<br/>
Keep in mind, that **there is no delay after the last sent mark**.
If you handle the sending of repeat frames by your own, you must insert sensible delays before the repeat frames to enable correct decoding.
-Sending **old MSB codes without conversion** can be done by using `sendNECMSB()`, `sendSonyMSB()`, `sendSamsungMSB()`, `sendJVCMSB()`
-or by [converting them manually to LSB](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#how-to-convert-old-msb-first-32-bit-ir-data-codes-to-new-lsb-first-32-bit-ir-data-codes).
+Sending old MSB codes without conversion can be done by using `sendNECMSB()`, `sendSonyMSB()`, `sendSamsungMSB()`, `sendJVCMSB()`.
## Sending IRDB IR codes
The codes found in the [Flipper-IRDB database](https://github.com/Lucaslhm/Flipper-IRDB) are quite straightforward to convert, because the also use the address / command scheme.<br/>
-Protocol matching is NECext -> Onkyo, Samsung32 -> Samsung, SIRC20 -> Sony with 20 bits etc.
+Protocol matching is NECext -> NECext (or Onkyo), Samsung32 -> Samsung, SIRC20 -> Sony with 20 bits etc.
The codes found in the [irdb database](https://github.com/probonopd/irdb/tree/master/codes) specify a **device**, a **subdevice** and a **function**.
-Most of the times, *device* and *subdevice* can be taken as upper and lower byte of the **address parameter** and *function*
-is the **command parameter** for the **new structured functions** with address, command and repeat-count parameters
-like e.g. `IrSender.sendNEC((device << 8) | subdevice, 0x19, 2)`.<br/>
-An **exact mapping** can be found in the [IRP definition files for IR protocols](https://github.com/probonopd/MakeHex/tree/master/protocols).
-"D" and "S" denotes device and subdevice and "F" denotes the function.
+Most of the times, *device* and *subdevice* can be taken as upper and lower byte of the **address parameter** and *function* is the **command parameter** for the **new structured functions** with address, command and repeat-count parameters like e.g. `IrSender.sendNEC((device << 8) | subdevice, 0x19, 2)`.<br/>
+An **exact mapping** can be found in the [IRP definition files for IR protocols](https://github.com/probonopd/MakeHex/tree/master/protocols). "D" and "S" denotes device and subdevice and "F" denotes the function.
## Send pin
-Any pin can be chosen as send pin as long as `IR_SEND_PIN` is **not** defined.
-This is because the PWM signal is generated by default with software bit banging, since `SEND_PWM_BY_TIMER` is not active.<br/>
+Any pin can be chosen as send pin, because the PWM signal is generated by default with software bit banging, since `SEND_PWM_BY_TIMER` is not active.<br/>
On **ESP32** ledc channel 0 is used for generating the IR PWM.<br/>
-If `IR_SEND_PIN` is specified (as C macro), it reduces program size and improves send timing for AVR.
-If you want to use a variable to specify send pin e.g. with `setSendPin(uint8_t aSendPinNumber)`, you must disable this `IR_SEND_PIN` macro e.g. with `#undef IR_SEND_PIN`.
-Then you can change send pin at any time before sending an IR frame.
-See also [Compile options / macros for this library](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#compile-options--macros-for-this-library).
-
-## Polarity of send pin
-By default the polarity is HIGH for active and LOW for inactive or pause.
-This corresponds to the connection schema: Pin -> Resistor-> IR-LED -> Ground.<br/>
-If you want to use the connection schema: VCC -> IR-LED -> Resistor -> Pin, you must specify `USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN`.
+If `IR_SEND_PIN` is specified (as c macro), it reduces program size and improves send timing for AVR. If you want to use a variable to specify send pin e.g. with `setSendPin(uint8_t aSendPinNumber)`, you must disable this `IR_SEND_PIN` macro.
+Then you can change send pin at any time before sending an IR frame. See also [Compile options / macros for this library](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#compile-options--macros-for-this-library).
### List of public IR code databases
http://www.harctoolbox.org/IR-resources.html
@@ -614,17 +503,9 @@ http://www.harctoolbox.org/IR-resources.html
# Tiny NEC receiver and sender
-For applications only requiring NEC, NEC variants or FAST -see below- protocol, there is a special receiver / sender included,
+For applications only requiring NEC, NEC variants or FAST -see below- protocol, there is a special receiver / sender included,<br/>
which has very **small code size of 500 bytes and does NOT require any timer**.
-## Principle of operation
-Instead of sampling the input every 50 &micro;s as IRremote does, TinyReceiver receiver uses a **pin change interrupt** for on-the-fly decoding which limits the choice of protocols.<br/>
-On each level change, the level and the time since the last change are used to incrementally decode the protocol.<br/>
-With this operating principle, we **cannot wait for a timeout** and then decode the protocol as IRremote does.<br/>
-Instead, we need to know which is the last bit (level change) of a protocol to do the final decoding
-and the call of the optional **user provided callback function** `handleReceivedTinyIRData()`.<br/>
-This means, **we need to know the number of bits in a protocol** and therefore the protocol (family).
-
Check out the [TinyReceiver](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#tinyreceiver--tinysender) and [IRDispatcherDemo](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#irdispatcherdemo) examples.<br/>
Take care to include `TinyIRReceiver.hpp` or `TinyIRSender.hpp` instead of `IRremote.hpp`.
@@ -705,17 +586,17 @@ On some boards where a software timer is available, the software timer is used.<
Be aware that the hardware timer used for receiving should not be used for `analogWrite()`.<br/>
Especially **motor** control often uses the `analogWrite()` function and will therefore stop the receiving if used on the pins indicated [here](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#timer-and-pin-usage).<br/>
On the Uno and other AVR boards the receiver timer ist the same as the tone timer. Thus receiving will stop after a `tone()` command.
-See [ReceiveDemo example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino#L284-L298) how to deal with it, i.e. how to use `IrReceiver.restartTimer()`.
+See [ReceiveDemo example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/b962db8f4e47408df01474a57f313f5a6bbe39a1/examples/ReceiveDemo/ReceiveDemo.ino#L257) how to deal with it, i.e. how to use `IrReceiver.restartTimer()`.
## Receiving sets overflow flag.
The flag `IRDATA_FLAGS_WAS_OVERFLOW` is set, if `RAW_BUFFER_LENGTH` is too small for all the marks and spaces of the protocol.
This can happen on long protocol frames like the ones from air conditioner.
-It also can happen, if `RECORD_GAP_MICROS` is smaller than the real gap between a frame and the repetition frame, thus interpreting both as one consecutive frame.
+It also can happen, if `RECORD_GAP_MICROS` is smaller than the real gap between a frame and thr repetition frame, thus interpreting both as one consecutive frame.
Best is to dump the timing then, to see which reason holds.
## Problems with Neopixels, FastLed etc.
IRremote will not work right when you use **Neopixels** (aka WS2811/WS2812/WS2812B) or other libraries blocking interrupts for a longer time (> 50 &micro;s).<br/>
-Whether you use the Adafruit Neopixel library, or FastLED, interrupts get disabled on many lower end CPUs like the basic Arduinos for longer than 50 &micro;s.
+Whether you use the Adafruit Neopixel lib, or FastLED, interrupts get disabled on many lower end CPUs like the basic Arduinos for longer than 50 &micro;s.
In turn, this stops the IR interrupt handler from running when it needs to. See also this [video](https://www.youtube.com/watch?v=62-nEJtm070).
One **workaround** is to wait for the IR receiver to be idle before you send the Neopixel data with `if (IrReceiver.isIdle()) { strip.show();}`.<br/>
@@ -727,7 +608,7 @@ There are some other solutions to this on more powerful processors,
**Another library is only working/compiling** if you deactivate the line `IrReceiver.begin(IR_RECEIVE_PIN, ENABLE_LED_FEEDBACK);`.<br/>
This is often due to **timer resource conflicts** with the other library. Please see [below](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#timer-and-pin-usage).
-## Multiple IR receiver and sender instances
+## Multiple IR receiver and sender
**This library supports only one IR receiver and one IR sender object (IRrecv and IRsend) per CPU.**<br/>
However since sending is a serial task, you can use `setSendPin()` to switch the pin to send, thus emulating multiple sender.<br/>
The receiver uses a special **timer** triggered function, which reads the digital IR signal value from one pin every 50 &micro;s.<br/>
@@ -747,9 +628,8 @@ On my Arduino Nanos, I always use a 100 &ohm; series resistor and one IR LED :gr
## Minimal CPU clock frequency
For receiving, the **minimal CPU clock frequency is 4 MHz**, since the 50 &micro;s timer ISR (Interrupt Service Routine) takes around 12 &micro;s on a 16 MHz ATmega.<br/>
-The TinyReceiver, which requires no polling, runs with 1 MHz.<br/>
-For sending, the **default software generated PWM has problems on AVR running with 8 MHz**. The PWM frequency is around 30 instead of 38 kHz and RC6 is not reliable.
-You can switch to timer PWM generation by `#define SEND_PWM_BY_TIMER`.
+The TinyReceiver, which reqires no polling, runs with 1 MHz.<br/>
+For sending, the **default software generated PWM has problems on AVR running with 8 MHz**. The PWM frequency is around 30 instead of 38 kHz and RC6 is not reliable. You can switch to timer PWM generation by `#define SEND_PWM_BY_TIMER`.
## Bang & Olufsen protocol
The Bang & Olufsen protocol decoder is not enabled by default, i.e if no protocol is enabled explicitly by #define `DECODE_<XYZ>`. It must always be enabled explicitly by `#define DECODE_BEO`.
@@ -757,18 +637,71 @@ This is because it has an **IR transmit frequency of 455 kHz** and therefore req
And because **generating a 455 kHz PWM signal is currently only implemented for `SEND_PWM_BY_TIMER`**, sending only works if `SEND_PWM_BY_TIMER` or `USE_NO_SEND_PWM` is defined.<br/>
For more info, see [ir_BangOlufsen.hpp](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/ir_BangOlufsen.hpp#L44).
+# Handling unknown Protocols
+## Disclaimer
+**This library was designed to fit inside MCUs with relatively low levels of resources and was intended to work as a library together with other applications which also require some resources of the MCU to operate.**
+
+For **air conditioners** [see this fork](https://github.com/crankyoldgit/IRremoteESP8266), which supports an impressive set of protocols and a lot of air conditioners.
+
+For **long signals** see the blog entry: ["Recording long Infrared Remote control signals with Arduino"](https://www.analysir.com/blog/2014/03/19/air-conditioners-problems-recording-long-infrared-remote-control-signals-arduino).
+
+
+## Protocol=PULSE_DISTANCE
+If you get something like this:
+```
+PULSE_DISTANCE: HeaderMarkMicros=8900 HeaderSpaceMicros=4450 MarkMicros=550 OneSpaceMicros=1700 ZeroSpaceMicros=600 NumberOfBits=56 0x43D8613C 0x3BC3BC
+```
+then you have a code consisting of **56 bits**, which is probably from an air conditioner remote.<br/>
+You can send it with `sendPulseDistanceWidth()`.
+```c++
+uint32_t tRawData[] = { 0xB02002, 0xA010 };
+IrSender.sendPulseDistance(38, 3450, 1700, 450, 1250, 450, 400, &tRawData[0], 48, false, 0, 0);
+```
+You can send it with calling `sendPulseDistanceWidthData()` twice, once for the first 32 bit and next for the remaining 24 bits.<br/>
+The `PULSE_DISTANCE` / `PULSE_WIDTH` decoder just decodes a timing stream to a bitstream stored as hex values.
+These decoders can not put any semantics like address, command or checksum on this bitstream.
+But the bitstream is way more readable, than a timing stream. This bitstream is read **LSB first by default**.
+If LSB does not suit for further research, you can change it [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/ir_DistanceProtocol.hpp#L78).
+
+**If RAM is not more than 2k, the decoder only accepts mark or space durations up to 2500 microseconds to save RAM space, otherwise it accepts durations up to 10 ms.**
+
+## Protocol=UNKNOWN
+If you see something like `Protocol=UNKNOWN Hash=0x13BD886C 35 bits received` as output of e.g. the ReceiveDemo example, you either have a problem with decoding a protocol, or an unsupported protocol.
+
+- If you have an **odd number of bits** received, your receiver circuit probably has problems. Maybe because the IR signal is too weak.
+- If you see timings like `+ 600,- 600 + 550,- 150 + 200,- 100 + 750,- 550` then one 450 &micro;s space was split into two 150 and 100 &micro;s spaces with a spike / error signal of 200 &micro;s between. Maybe because of a defective receiver or a weak signal in conjunction with another light emitting source nearby.
+- If you see timings like `+ 500,- 550 + 450,- 550 + 450,- 500 + 500,-1550`, then marks are generally shorter than spaces and therefore `MARK_EXCESS_MICROS` (specified in your ino file) should be **negative** to compensate for this at decoding.
+- If you see `Protocol=UNKNOWN Hash=0x0 1 bits received` it may be that the space after the initial mark is longer than [`RECORD_GAP_MICROS`](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRremote.h#L124).
+ This was observed for some LG air conditioner protocols. Try again with a line e.g. `#define RECORD_GAP_MICROS 12000` before the line `#include <IRremote.hpp>` in your .ino file.
+- To see more info supporting you to find the reason for your UNKNOWN protocol, you must enable the line `//#define DEBUG` in IRremoteInt.h.
+
+## How to deal with protocols not supported by IRremote
+If you do not know which protocol your IR transmitter uses, you have several choices.
+- Just use the hash value to decide which command was received. See the [SimpleReceiverForHashCodes example](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiverForHashCodes/SimpleReceiverForHashCodes.ino).
+- Use the [IRreceiveDump example](examples/ReceiveDump) to dump out the IR timing.
+ You can then reproduce/send this timing with the [SendRawDemo example](examples/SendRawDemo).
+ For **long codes** with more than 48 bits like from air conditioners, you can **change the length of the input buffer** in [IRremote.h](src/IRremoteInt.h#L36).
+- The [IRMP AllProtocol example](https://github.com/IRMP-org/IRMP#allprotocol-example) prints the protocol and data for one of the **40 supported protocols**.
+ The same library can be used to send this codes.
+- If you have a bigger Arduino board at hand (> 100 kByte program memory) you can try the
+ [IRremoteDecode example](https://github.com/bengtmartensson/Arduino-DecodeIR/blob/master/examples/IRremoteDecode/IRremoteDecode.ino) of the Arduino library [DecodeIR](https://github.com/bengtmartensson/Arduino-DecodeIR).
+- Use [IrScrutinizer](http://www.harctoolbox.org/IrScrutinizer.html).
+ It can automatically generate a send sketch for your protocol by exporting as "Arduino Raw". It supports IRremote,
+ the old [IRLib](https://github.com/cyborg5/IRLib) and [Infrared4Arduino](https://github.com/bengtmartensson/Infrared4Arduino).
+
+<br/>
+
# Examples for this library
The examples are available at File > Examples > Examples from Custom Libraries / IRremote.<br/>
-**In order to fit the examples to the 8K flash of ATtiny85 and ATtiny88, the [Arduino library ATtinySerialOut](https://github.com/ArminJo/ATtinySerialOut) is required for this CPU's.**<br/>
+ In order to fit the examples to the 8K flash of ATtiny85 and ATtiny88, the [Arduino library ATtinySerialOut](https://github.com/ArminJo/ATtinySerialOut) is required for this CPU's.<br/>
See also [DroneBot Workshop SimpleReceiver](https://dronebotworkshop.com/ir-remotes/#SimpleReceiver_Example_Code) and [SimpleSender](https://dronebotworkshop.com/ir-remotes/#SimpleSender_Example_Code).
#### SimpleReceiver + SimpleSender
-The **[SimpleReceiver](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino)**
-and **[SimpleSender](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleSender/SimpleSender.ino)** examples are a good starting point.
+The **[SimpleReceiver](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino)** and **[SimpleSender](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleSender/SimpleSender.ino)** examples are a good starting point.
A simple example can be tested online with [WOKWI](https://wokwi.com/projects/338611596994544210).
#### SimpleReceiverForHashCodes
-The **[SimpleReceiverForHashCodes](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino)** uses only the hash decoder.
+The **[SimpleReceiverForHashCodes](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleReceiver/SimpleReceiver.ino)** uses only the hash decoder.
It converts all IR frames longer than 6 to a 32 bit hash code, thus enabling receiving of unknown protocols.<br/>
See: http://www.righto.com/2010/01/using-arbitrary-remotes-with-arduino.html
@@ -789,27 +722,21 @@ If the protocol is not NEC and code size matters, look at this [example](https:/
#### ReceiveDemo + AllProtocolsOnLCD
[ReceiveDemo](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino) receives all protocols and **generates a beep with the Arduino tone() function** on each packet received.<br/>
Long press of one IR button (receiving of multiple repeats for one command) is detected.<br/>
-[AllProtocolsOnLCD](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/AllProtocolsOnLCD/AllProtocolsOnLCD.ino) additionally **displays the short result on a 1602 LCD**.
-The LCD can be connected parallel or serial (I2C).<br/>
+[AllProtocolsOnLCD](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/AllProtocolsOnLCD/AllProtocolsOnLCD.ino) additionally **displays the short result on a 1602 LCD**. The LCD can be connected parallel or serial (I2C).<br/>
By connecting debug pin to ground, you can force printing of the raw values for each frame. The pin number of the debug pin is printed during setup, because it depends on board and LCD connection type.<br/>
This example also serves as an **example how to use IRremote and tone() together**.
#### ReceiveDump
-Receives all protocols and dumps the received signal in different flavors including **Pronto format**.<br/>
-Since the printing takes much time, repeat signals may be skipped or interpreted as UNKNOWN.
+Receives all protocols and dumps the received signal in different flavors including Pronto format. Since the printing takes much time, repeat signals may be skipped or interpreted as UNKNOWN.
#### SendDemo
Sends all available protocols at least once.
-#### MultipleSendPins
-Demonstrates sending IR codes toggling between 2 **different send pins**.
-
#### SendAndReceive
Demonstrates **receiving while sending**.
#### ReceiveAndSend
-Record and **play back last received IR signal** at button press. IR frames of known protocols are sent by the appropriate protocol encoder.
-`UNKNOWN` protocol frames are stored as raw data and sent with `sendRaw()`.
+Record and **play back last received IR signal** at button press. IR frames of known protocols are sent by the approriate protocol encoder. `UNKNOWN` protocol frames are stored as raw data and sent with `sendRaw()`.
#### ReceiveAndSendDistanceWidth
Try to decode each IR frame with the *universal* **DistanceWidth decoder**, store the data and send it on button press with `sendPulseDistanceWidthFromArray()`.<br/>
@@ -860,14 +787,6 @@ Here you see the delay of the receiver output (blue) from the IR diode input (ye
- [ReceiverTimingAnalysis](https://wokwi.com/projects/299033930562011656)
- [Receiver with LCD output and switch statement](https://wokwi.com/projects/298934082074575369)
-# IR control of a robot car
-This [example](https://github.com/ArminJo/PWMMotorControl?tab=readme-ov-file#basicircontrol) of the **Arduino PWMMotorControl library** controls the basic functions of a robot car using the IRremote library.<br/>
-It controls 2 PWM motor channels, 2 motors at each channel.<br/>
-[Here](https://www.instructables.com/Arduino-4WD-Car-Assembly-and-Code-With-Optional-In/) you can find the instructable for car assembly and code.<br/>
-
-IR_RobotCar with TL1838 IR receiver plugged into expansion board.<br/>
-![IR_RobotCar](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/pictures/IR_RobotCar.jpg)
-
<br/>
# Issues and discussions
@@ -886,7 +805,6 @@ Modify them by enabling / disabling them, or change the values if applicable.
|-|-:|-|
| `RAW_BUFFER_LENGTH` | 200 | Buffer size of raw input uint16_t buffer. Must be even! If it is too small, overflow flag will be set. 100 is sufficient for *regular* protocols of up to 48 bits, but for most air conditioner protocols a value of up to 750 is required. Use the ReceiveDump example to find smallest value for your requirements. A value of 200 requires 200 bytes RAM. |
| `EXCLUDE_UNIVERSAL_PROTOCOLS` | disabled | Excludes the universal decoder for pulse distance width protocols and decodeHash (special decoder for all protocols) from `decode()`. Saves up to 1000 bytes program memory. |
-| `EXCLUDE_EXOTIC_PROTOCOLS` | disabled | Excludes BANG_OLUFSEN, BOSEWAVE, WHYNTER, FAST and LEGO_PF from `decode()` and from sending with `IrSender.write()`. Saves up to 650 bytes program memory. |
| `DECODE_<Protocol name>` | all | Selection of individual protocol(s) to be decoded. You can specify multiple protocols. See [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRremote.hpp#L98-L121) |
| `DECODE_STRICT_CHECKS` | disabled | Check for additional required characteristics of protocol timing like length of mark for a constant mark protocol, where space length determines the bit value. Requires up to 194 additional bytes of program memory. |
| `IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK` | disabled | Saves up to 60 bytes of program memory and 2 bytes RAM. |
@@ -895,17 +813,15 @@ Modify them by enabling / disabling them, or change the values if applicable.
| `DISTANCE_WIDTH_DECODER_DURATION_ARRAY_SIZE` | 50 if RAM <= 2k, else 200 | A value of 200 allows to decode mark or space durations up to 10 ms. |
| `IR_INPUT_IS_ACTIVE_HIGH` | disabled | Enable it if you use a RF receiver, which has an active HIGH output signal. |
| `IR_SEND_PIN` | disabled | If specified, it reduces program size and improves send timing for AVR. If you want to use a variable to specify send pin e.g. with `setSendPin(uint8_t aSendPinNumber)`, you must not use / disable this macro in your source. |
-| `SEND_PWM_BY_TIMER` | disabled | Disables carrier PWM generation in software and use hardware PWM (by timer). Has the **advantage of more exact PWM generation**, especially the duty cycle (which is not very relevant for most IR receiver circuits), and the **disadvantage of using a hardware timer**, which in turn is not available for other libraries and to fix the send pin (but not the receive pin) at the [dedicated timer output pin(s)](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#timer-and-pin-usage). Is enabled for ESP32 and RP2040 in all examples, since they support PWM generation for each pin without using a shared resource (timer). |
+| `SEND_PWM_BY_TIMER` | disabled | Disables carrier PWM generation in software and use hardware PWM (by timer). Has the advantage of more exact PWM generation, especially the duty cycle (which is not very relevant for most IR receiver circuits), and the disadvantage of using a hardware timer, which in turn is not available for other libraries and to fix the send pin (but not the receive pin) at the [dedicated timer output pin(s)](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#timer-and-pin-usage). Is enabled for ESP32 and RP2040 in all examples, since they support PWM gereration for each pin without using a shared resource (timer). |
| `IR_SEND_DUTY_CYCLE_PERCENT` | 30 | Duty cycle of IR send signal. |
-| `USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN` | disabled | Reverses the polarity at the send pin. Can be used to connect IR LED between VCC and the send pin. It is like open drain but with electrical active high in its logical inactive state. |
-| `USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN` | disabled | Uses or simulates open drain output mode at send pin. **Attention, active state of open drain is LOW**, so connect the send LED between positive supply and send pin! |
| `USE_NO_SEND_PWM` | disabled | Uses no carrier PWM, just simulate an **active low** receiver signal. Used for transferring signal by cable instead of IR. Overrides `SEND_PWM_BY_TIMER` definition. |
-| `USE_ACTIVE_HIGH_OUTPUT_FOR_NO_SEND_PWM` | disabled | Only if `USE_NO_SEND_PWM` is enabled. Simulate an **active high** receiver signal instead of an active low signal. |
+| `USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN` | disabled | Uses or simulates open drain output mode at send pin. **Attention, active state of open drain is LOW**, so connect the send LED between positive supply and send pin! |
+| `USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN` | disabled | Only if `USE_NO_SEND_PWM` is enabled. Simulate an **active high** receiver signal instead of an active low signal. |
| `DISABLE_CODE_FOR_RECEIVER` | disabled | Disables static receiver code like receive timer ISR handler and static IRReceiver and irparams data. Saves 450 bytes program memory and 269 bytes RAM if receiving functions are not required. |
+| `EXCLUDE_EXOTIC_PROTOCOLS` | disabled | Excludes BANG_OLUFSEN, BOSEWAVE, WHYNTER, FAST and LEGO_PF from `decode()` and from sending with `IrSender.write()`. Saves up to 650 bytes program memory. |
| `FEEDBACK_LED_IS_ACTIVE_LOW` | disabled | Required on some boards (like my BluePill and my ESP8266 board), where the feedback LED is active low. |
| `NO_LED_FEEDBACK_CODE` | disabled | Disables the LED feedback code for send and receive. Saves around 100 bytes program memory for receiving, around 500 bytes for sending and halving the receiver ISR (Interrupt Service Routine) processing time. |
-| `NO_LED_RECEIVE_FEEDBACK_CODE` | disabled | Disables the LED feedback code for receive. Saves around 100 bytes program memory for receiving and halving the receiver ISR (Interrupt Service Routine) processing time. |
-| `NO_LED_SEND_FEEDBACK_CODE` | disabled | Disables the LED feedback code for send. Saves around 500 bytes for sending. |
| `MICROS_PER_TICK` | 50 | Resolution of the raw input buffer data. Corresponds to 2 pulses of each 26.3 &micro;s at 38 kHz. |
| `TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT` | 25 | Relative tolerance for matchTicks(), matchMark() and matchSpace() functions used for protocol decoding. |
| `DEBUG` | disabled | Enables lots of lovely debug output. |
@@ -914,17 +830,15 @@ Modify them by enabling / disabling them, or change the values if applicable.
These next macros for **TinyIRReceiver** must be defined in your program before the line `#include <TinyIRReceiver.hpp>` to take effect.
| Name | Default value | Description |
|-|-:|-|
-| `IR_RECEIVE_PIN` | 2 | The pin number for TinyIRReceiver IR input, which gets compiled in. Not used in IRremote. |
+| `IR_RECEIVE_PIN` | 2 | The pin number for TinyIRReceiver IR input, which gets compiled in. |
| `IR_FEEDBACK_LED_PIN` | `LED_BUILTIN` | The pin number for TinyIRReceiver feedback LED, which gets compiled in. |
-| `NO_LED_FEEDBACK_CODE` | disabled | Disables the feedback LED code for send and receive. Saves 14 bytes program memory. |
-| `NO_LED_RECEIVE_FEEDBACK_CODE` | disabled | Disables the LED feedback code for receive. |
-| `NO_LED_SEND_FEEDBACK_CODE` | disabled | Disables the LED feedback code for send. |
-| `DISABLE_PARITY_CHECKS` | disabled | Disables the address and command parity checks. Saves 48 bytes program memory. |
+| `NO_LED_FEEDBACK_CODE` | disabled | Disables the feedback LED function. Saves 14 bytes program memory. |
+| `DISABLE_PARITY_CHECKS` | disabled | Disables the addres and command parity checks. Saves 48 bytes program memory. |
| `USE_EXTENDED_NEC_PROTOCOL` | disabled | Like NEC, but take the 16 bit address as one 16 bit value and not as 8 bit normal and 8 bit inverted value. |
| `USE_ONKYO_PROTOCOL` | disabled | Like NEC, but take the 16 bit address and command each as one 16 bit value and not as 8 bit normal and 8 bit inverted value. |
| `USE_FAST_PROTOCOL` | disabled | Use FAST protocol (no address and 16 bit data, interpreted as 8 bit command and 8 bit inverted command) instead of NEC. |
| `ENABLE_NEC2_REPEATS` | disabled | Instead of sending / receiving the NEC special repeat code, send / receive the original frame for repeat. |
-| `USE_CALLBACK_FOR_TINY_RECEIVER` | disabled | Call the user provided function `void handleReceivedTinyIRData()` each time a frame or repeat is received. |
+| `USE_CALLBACK_FOR_TINY_RECEIVER` | disabled | Call the fixed function `void handleReceivedTinyIRData()` each time a frame or repeat is received. |
The next macro for **IRCommandDispatcher** must be defined in your program before the line `#include <IRCommandDispatcher.hpp>` to take effect.
| `USE_TINY_IR_RECEIVER` | disabled | Use [TinyReceiver](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#tinyreceiver--tinysender) for receiving IR codes. |
@@ -949,11 +863,10 @@ If you are using [Sloeber](https://eclipse.baeyens.it) as your IDE, you can easi
# Supported Boards
**Issues and discussions with the content "Is it possible to use this library with the ATTinyXYZ? / board XYZ" without any reasonable explanations will be immediately closed without further notice.**<br/>
-For **ESP8266/ESP32**, [the IRremoteESP8266 library](https://github.com/crankyoldgit/IRremoteESP8266) supports an [impressive set of protocols and a lot of air conditioners](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/SupportedProtocols.md)<br/>
-**ATtiny CPU's are tested with the [Arduino library ATtinySerialOut](https://github.com/ArminJo/ATtinySerialOut) library**.<br/>
+For **ESP8266/ESP32**, [this library](https://github.com/crankyoldgit/IRremoteESP8266) supports an [impressive set of protocols and a lot of air conditioners](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/SupportedProtocols.md)<br/>
<br/>
Digispark boards are only tested with [ATTinyCore](https://github.com/SpenceKonde/ATTinyCore) using `New Style` pin mapping for the Digispark Pro board.<br/>
-**ATtiny boards** are tested with **[ATTinyCore](https://github.com/SpenceKonde/ATTinyCore#supported-devices) or [megaTinyCore](https://github.com/SpenceKonde/megaTinyCore) only**.
+ATtiny boards are only tested with [ATTinyCore](https://github.com/SpenceKonde/ATTinyCore#supported-devices) or [megaTinyCore](https://github.com/SpenceKonde/megaTinyCore).
- Arduino Uno / Mega / Leonardo / Duemilanove / Diecimila / LilyPad / Mini / Fio / Nano etc.
- Arduino Uno R4, but not yet tested, because of lack of a R4 board. **Sending does not work** on the `arduino:renesas_uno:unor4wifi`.
@@ -965,7 +878,7 @@ Digispark boards are only tested with [ATTinyCore](https://github.com/SpenceKond
- ATmega4809 (Nano every)
- ATtiny3217 (Tiny Core 32 Dev Board)
- ATtiny84, 85, 167 (Digispark + Digispark Pro)
-- SAMD (Zero, MKR*, **but not DUE, the latter is SAM architecture**)
+- SAMD21 (Zero, MKR*, **but not SAMD51 and not DUE, the latter is SAM architecture**)
- ESP8266
- ESP32 (ESP32-C3 since board package 2.0.2 from Espressif)
- Sparkfun Pro Micro
@@ -983,7 +896,7 @@ If you can provide **examples of using a periodic timer for interrupts** for the
# Timer and pin usage
The **receiver sample interval of 50 &micro;s is generated by a timer**. On many boards this must be a hardware timer. On some boards where a software timer is available, the software timer is used.<br/>
On **ESP8266** `timer1` is used for receive interrupts, which makes it incompatible to the Servo and other libraries.<br/>
-On **ESP32** `hw_timer_t` is used for receive interrupts.
+On **ESP32** `hw_timer_t` is used for receive interrupts and `ledc` channel 0 is used for generating the IR PWM.
Every pin can be used for receiving.<br/>
If software PWM is selected, which is default, every pin can also be used for sending. Sending with software PWM does not require a timer!
@@ -1068,7 +981,7 @@ For non AVR boards/platforms you must look for the appropriate section guarded b
### Stop and start timer
Another approach can be to share the timer **sequentially** if their functionality is used only for a short period of time like for the **Arduino tone() command**.
-An example can be seen [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/ReceiveDemo/ReceiveDemo.ino#L284-L298), where the IR timer is restarted after the tone has stopped.
+An example can be seen [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/21b5747a58e9d47c9e3f1beb056d58c875a92b47/examples/ReceiveDemo/ReceiveDemo.ino#L159-L169), where the IR timer is restarted after the tone has stopped.
```c++
IrReceiver.stopTimer(); // Stop timer consistently before calling tone() or other functions using the timer resource.
@@ -1082,7 +995,7 @@ This works on AVR boards like Uno because each call to` tone()` completely initi
If you define `SEND_PWM_BY_TIMER`, the send PWM signal is forced to be generated by a hardware timer on most platforms.<br/>
By default, the same timer as for the receiver is used.<br/>
Since each hardware timer has its dedicated output pin(s), you must change timer or timer sub-specifications to change PWM output pin. See [private/IRTimer.hpp](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/private/IRTimer.hpp)<br/>
-**Exceptions** are currently [ESP32, ARDUINO_ARCH_RP2040, PARTICLE and ARDUINO_ARCH_MBED](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/examples/SimpleSender/PinDefinitionsAndMore.h#L334),where **PWM generation does not require a timer**.
+**Exeptions** are currently [ESP32, ARDUINO_ARCH_RP2040, PARTICLE and ARDUINO_ARCH_MBED](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/39bdf8d7bf5b90dc221f8ae9fb3efed9f0a8a1db/examples/SimpleSender/PinDefinitionsAndMore.h#L273), where **PWM generation does not require a timer**.
## Why do we use 30% duty cycle for sending
We [do it](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRSend.hpp#L1192) according to the statement in the [Vishay datasheet](https://www.vishay.com/docs/80069/circuit.pdf):
@@ -1097,9 +1010,7 @@ Due to automatic gain control and other bias effects, high intensity of the 38 k
The IR signal is sampled at a **50 &micro;s interval**. For a constant 525 &micro;s pulse or pause we therefore get 10 or 11 samples, each with 50% probability.<br/>
And believe me, if you send a 525 &micro;s signal, your receiver will output something between around 400 and 700 &micro;s!<br/>
Therefore **we decode by default with a +/- 25% margin** using the formulas [here](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/src/IRremoteInt.h#L376-L399).<br/>
-E.g. for the NEC protocol with its 560 &micro;s unit length, we have TICKS_LOW = 8.358 and TICKS_HIGH = 15.0.
-This means, we accept any value between 8 ticks / 400 &micro;s and 15 ticks / 750 &micro;s (inclusive) as a mark or as a zero space.
-For a one space we have TICKS_LOW = 25.07 and TICKS_HIGH = 45.0.<br/>
+E.g. for the NEC protocol with its 560 &micro;s unit length, we have TICKS_LOW = 8.358 and TICKS_HIGH = 15.0. This means, we accept any value between 8 ticks / 400 &micro;s and 15 ticks / 750 &micro;s (inclusive) as a mark or as a zero space. For a one space we have TICKS_LOW = 25.07 and TICKS_HIGH = 45.0.<br/>
And since the receivers generated marks are longer or shorter than the spaces,
we have introduced the [`MARK_EXCESS_MICROS`](https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#compile-options--macros-for-this-library) macro
to compensate for this receiver (and signal strength as well as ambient light dependent :disappointed: ) specific deviation.<br/>
@@ -1119,7 +1030,7 @@ Created with sigrok PulseView with IR_NEC decoder by DjordjeMandic.<br/>
# Quick comparison of 5 Arduino IR receiving libraries
**This is a short comparison and may not be complete or correct.**
-I created this comparison matrix for [myself](https://github.com/ArminJo) in order to choose a small IR library for my project and to have a quick overview, when to choose which library.<br/>
+I created this comparison matrix for [myself](https://github.com/ArminJo) in order to choose a small IR lib for my project and to have a quick overview, when to choose which library.<br/>
It is dated from **24.06.2022** and updated 10/2023. If you have complains about the data or request for extensions, please send a PM or open a discussion.
[Here](https://github.com/crankyoldgit/IRremoteESP8266) you find an **ESP8266/ESP32** version of IRremote with an **[impressive list of supported protocols](https://github.com/crankyoldgit/IRremoteESP8266/blob/master/SupportedProtocols.md)**.
@@ -1148,7 +1059,6 @@ It is dated from **24.06.2022** and updated 10/2023. If you have complains about
# [History](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/changelog.md)
# Useful links
-- [Online NEC to Pronto converting tool](https://www.yamaha.com/ypab/irhex_converter.asp)
- [List of public IR code databases](http://www.harctoolbox.org/IR-resources.html)
- [LIRC database](http://lirc-remotes.sourceforge.net/remotes-table.html)
- [IRMP list of IR protocols](https://www.mikrocontroller.net/articles/IRMP_-_english#IR_Protocols)
@@ -1170,4 +1080,4 @@ From the version 2.8.0, the license is the MIT license.
# Copyright
Initially coded 2009 Ken Shirriff http://www.righto.com<br/>
Copyright (c) 2016-2017 Rafi Khan https://rafikhan.io<br/>
-Copyright (c) 2020-2025 [Armin Joachimsmeyer](https://github.com/ArminJo)
+Copyright (c) 2020-2024 [Armin Joachimsmeyer](https://github.com/ArminJo)
diff --git a/lib/IRremote/changelog.md b/lib/IRremote/changelog.md
index 7a6d5411..5234a975 100644
--- a/lib/IRremote/changelog.md
+++ b/lib/IRremote/changelog.md
@@ -1,30 +1,11 @@
# Changelog
The latest version may not be released!
See also the commit log at github: https://github.com/Arduino-IRremote/Arduino-IRremote/commits/master
-# 4.4.4
-
-
-# 4.4.3
-- Added USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN to make the software aware of send LED connected between VCC and send pin.
-- Fixed backward compatibility bug for printIRResultShort(3 params).
-- Minor improvements.
-
-# 4.4.2
-- Support for SAMD51 timer3 if timer 5 is not available (Adafruit ItsyBitsy M4).
-- attachInterrupt() on SAMD has a different semantic :-(. See: https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/.
-- Fixed overflow handling.
-- Improved repeat detection for DistanceWidthProtocol.
-- Print of IR frame duration in printIRResultShort();
-- PulseDistanceWidthProtocolConstants now in PROGMEM, this saves 190 bytes RAM for unit test.
-- Support for PROGMEM PulseDistanceWidthProtocol data.
-- Support duplicated 8 bit address for sendSamsungLG().
-
# 4.4.1
-- Support for ESP core 3.x by akellai.
+- Support for ESP 3.0 by akellai.
- restartTimer() now uses variable sMicrosAtLastStopTimer to keep track of uncounted ticks between stopTimer() and restartTimer().
- Removed functions addTicksToInternalTickCounter() and addMicrosToInternalTickCounter(), which were added in 4.1.0.
- Version 2.2.0 of TinyIR with new TinyReceiverDecode() function to be used as drop in for IrReceiver.decode().
-- Support of RC6A.
# 4.4.0
- Using 8 bit raw timing buffer for all timings except frame gap (former rawbuf[0]).
@@ -74,14 +55,14 @@ See also the commit log at github: https://github.com/Arduino-IRremote/Arduino-I
- Usage of ATTinyCore pin numbering scheme e.g. PIN_PB2.
- Added ARDUINO_ARCH_NRF52 to support Seeed XIAO nRF52840 Sense.
- First untested support of Uno R4.
-- Extracted version macros to IRVersion.h.
+- Extraced version macros to IRVersion.h.
## 4.1.2
- Workaround for ESP32 RTOS delay() timing bug influencing the mark() function.
## 4.1.1
- SAMD51 use timer3 if timer5 not available.
-- Disabled #define LOCAL_DEBUG in IRReceive.hpp, which was accidentally enabled at 4.1.0.
+- Disabled #define LOCAL_DEBUG in IRReceive.hpp, which was accidently enabled at 4.1.0.
## 4.1.0
- Fixed bug in printing durations > 64535 in printIRResultRawFormatted().
@@ -108,7 +89,7 @@ See also the commit log at github: https://github.com/Arduino-IRremote/Arduino-I
- Introduced common structure PulseDistanceWidthProtocolConstants.
- Where possible, changed all send and decode functions to use PulseDistanceWidthProtocolConstants.
- Improved MSB/LSB handling
-- New convenience functions bitreverse32Bit() and bitreverseOneByte().
+- New convenience fuctions bitreverse32Bit() and bitreverseOneByte().
- Improved Magiquest protocol.
- Fix for #1028 - Prevent long delay caused by overflow when frame duration < repeat period - Thanks to Stephen Humphries!
- Support for ATtiny816 - Thanks to elockman.
@@ -152,7 +133,7 @@ See also the commit log at github: https://github.com/Arduino-IRremote/Arduino-I
- Improved pin mapping for TinyReceiver.
## 3.7.1
-- SendRaw now supports buffer length > 255.
+- SendRaw now supports bufferlenght > 255.
- Improved DistanceProtocol decoder output.
- Fixed ESP32 send bug for 2.x ESP32 cores.
@@ -320,7 +301,7 @@ See also the commit log at github: https://github.com/Arduino-IRremote/Arduino-I
- Corrected keywords.txt.
- BoseWave protocol added PR #690.
- Formatting comply to the new stylesheet.
-- Renamed "boarddefs.h".
+- Renamed "boarddefs.h" [ISSUE #375](https://github.com/Arduino-IRremote/Arduino-IRremote/issues/375).
- Renamed `SEND_PIN` to `IR_SEND_PIN`.
- Renamed state macros.
- Enabled `DUTY_CYCLE` for send signal.
@@ -387,7 +368,7 @@ Changes from #268 by adamlhumphreys
- Fixed #110 Mess
- Created Gitter Room
- Added Gitter Badge
-- Standardized Code Base
+- Standardised Code Base
- Clean Debug Output
- Optimized Send Loops
- Modularized Design
@@ -415,4 +396,4 @@ Changes from #268 by adamlhumphreys
- Broke Teensy 3 / 3.1 Support
### Not Working
-- Teensy 3 / 3.1 Support is in Development
\ No newline at end of file
+- Teensy 3 / 3.1 Support is in Development
diff --git a/lib/IRremote/examples/AllProtocolsOnLCD/ADCUtils.h b/lib/IRremote/examples/AllProtocolsOnLCD/ADCUtils.h
index 33c2bbfc..c4062178 100644
--- a/lib/IRremote/examples/AllProtocolsOnLCD/ADCUtils.h
+++ b/lib/IRremote/examples/AllProtocolsOnLCD/ADCUtils.h
@@ -29,9 +29,6 @@
#if defined(__AVR__) && defined(ADCSRA) && defined(ADATE) && (!defined(__AVR_ATmega4809__))
#define ADC_UTILS_ARE_AVAILABLE
-// External Reference Current is 150 uA for 5 V and 100 uA for 3.5 V
-#define READING_FOR_AREF 1024L // Datasheet 24.2: The minimum value represents GND and the maximum value represents the voltage on the AREF pin minus 1 LSB
-
// PRESCALE4 => 13 * 4 = 52 microseconds per ADC conversion at 1 MHz Clock => 19,2 kHz
#define ADC_PRESCALE2 1 // 26 microseconds per ADC conversion at 1 MHz
#define ADC_PRESCALE4 2 // 52 microseconds per ADC conversion at 1 MHz
diff --git a/lib/IRremote/examples/AllProtocolsOnLCD/ADCUtils.hpp b/lib/IRremote/examples/AllProtocolsOnLCD/ADCUtils.hpp
index 989a7e85..73030b47 100644
--- a/lib/IRremote/examples/AllProtocolsOnLCD/ADCUtils.hpp
+++ b/lib/IRremote/examples/AllProtocolsOnLCD/ADCUtils.hpp
@@ -27,15 +27,11 @@
#include "ADCUtils.h"
#if defined(ADC_UTILS_ARE_AVAILABLE) // set in ADCUtils.h, if supported architecture was detected
-#define ADC_UTILS_ARE_INCLUDED
-#if !defined(STR)
+#if !defined(STR_HELPER)
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#endif
-#if !defined(BITS_PER_BYTE)
-#define BITS_PER_BYTE 8
-#endif
/*
* By replacing this value with the voltage you measured a the AREF pin after a conversion
@@ -62,16 +58,11 @@ union WordUnionForADCUtils {
* Enable this to see information on each call.
* Since there should be no library which uses Serial, it should only be enabled for development purposes.
*/
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
#endif
-#if defined(INFO)
-#define LOCAL_INFO
-#else
-//#define LOCAL_INFO // This enables debug output only for this file
-#endif
/*
* Persistent storage for VCC value
@@ -412,7 +403,7 @@ uint16_t readUntil4ConsecutiveValuesAreEqual(uint8_t aADCChannelNumber, uint8_t
/*
* Get min and max of the last 4 values
*/
- tMin = READING_FOR_AREF;
+ tMin = 1024;
tMax = 0;
for (uint_fast8_t i = 0; i < 4; ++i) {
if (tValues[i] < tMin) {
@@ -481,7 +472,7 @@ uint16_t readUntil4ConsecutiveValuesAreEqual(uint8_t aADCChannelNumber, uint8_t
float getVCCVoltageSimple(void) {
// use AVCC with (optional) external capacitor at AREF pin as reference
float tVCC = readADCChannelMultiSamplesWithReference(ADC_1_1_VOLT_CHANNEL_MUX, DEFAULT, 4);
- return ((READING_FOR_AREF * 1.1 * 4) / tVCC);
+ return ((1023 * 1.1 * 4) / tVCC);
}
/*
@@ -492,19 +483,19 @@ float getVCCVoltageSimple(void) {
uint16_t getVCCVoltageMillivoltSimple(void) {
// use AVCC with external capacitor at AREF pin as reference
uint16_t tVCC = readADCChannelMultiSamplesWithReference(ADC_1_1_VOLT_CHANNEL_MUX, DEFAULT, 4);
- return ((READING_FOR_AREF * ADC_INTERNAL_REFERENCE_MILLIVOLT * 4) / tVCC);
+ return ((1023L * ADC_INTERNAL_REFERENCE_MILLIVOLT * 4) / tVCC);
}
/*
* Gets the hypothetical 14 bit reading of VCC using 1.1 volt reference
- * Similar to getVCCVoltageMillivolt() * 1024 / 1100
+ * Similar to getVCCVoltageMillivolt() * 1023 / 1100
*/
uint16_t getVCCVoltageReadingFor1_1VoltReference(void) {
uint16_t tVCC = waitAndReadADCChannelWithReference(ADC_1_1_VOLT_CHANNEL_MUX, DEFAULT);
/*
* Do not switch back ADMUX to enable checkAndWaitForReferenceAndChannelToSwitch() to work correctly for the next measurement
*/
- return ((READING_FOR_AREF * READING_FOR_AREF) / tVCC);
+ return ((1023L * 1023L) / tVCC);
}
/*
@@ -528,7 +519,7 @@ uint16_t getVCCVoltageMillivolt(void) {
/*
* Do not switch back ADMUX to enable checkAndWaitForReferenceAndChannelToSwitch() to work correctly for the next measurement
*/
- return ((READING_FOR_AREF * ADC_INTERNAL_REFERENCE_MILLIVOLT) / tVCC);
+ return ((1023L * ADC_INTERNAL_REFERENCE_MILLIVOLT) / tVCC);
}
/*
@@ -556,7 +547,7 @@ void readAndPrintVCCVoltageMillivolt(Print *aSerial) {
void readVCCVoltageSimple(void) {
// use AVCC with (optional) external capacitor at AREF pin as reference
float tVCC = readADCChannelMultiSamplesWithReference(ADC_1_1_VOLT_CHANNEL_MUX, DEFAULT, 4);
- sVCCVoltage = (READING_FOR_AREF * (((float) ADC_INTERNAL_REFERENCE_MILLIVOLT) / 1000) * 4) / tVCC;
+ sVCCVoltage = (1023 * (((float) ADC_INTERNAL_REFERENCE_MILLIVOLT) / 1000) * 4) / tVCC;
}
/*
@@ -567,7 +558,7 @@ void readVCCVoltageSimple(void) {
void readVCCVoltageMillivoltSimple(void) {
// use AVCC with external capacitor at AREF pin as reference
uint16_t tVCCVoltageMillivoltRaw = readADCChannelMultiSamplesWithReference(ADC_1_1_VOLT_CHANNEL_MUX, DEFAULT, 4);
- sVCCVoltageMillivolt = (READING_FOR_AREF * ADC_INTERNAL_REFERENCE_MILLIVOLT * 4) / tVCCVoltageMillivoltRaw;
+ sVCCVoltageMillivolt = (1023L * ADC_INTERNAL_REFERENCE_MILLIVOLT * 4) / tVCCVoltageMillivoltRaw;
}
/*
@@ -588,7 +579,7 @@ void readVCCVoltageMillivolt(void) {
/*
* Do not switch back ADMUX to enable checkAndWaitForReferenceAndChannelToSwitch() to work correctly for the next measurement
*/
- sVCCVoltageMillivolt = (READING_FOR_AREF * ADC_INTERNAL_REFERENCE_MILLIVOLT) / tVCCVoltageMillivoltRaw;
+ sVCCVoltageMillivolt = (1023L * ADC_INTERNAL_REFERENCE_MILLIVOLT) / tVCCVoltageMillivoltRaw;
}
/*
@@ -597,7 +588,7 @@ void readVCCVoltageMillivolt(void) {
*/
uint16_t getVoltageMillivolt(uint16_t aVCCVoltageMillivolt, uint8_t aADCChannelForVoltageMeasurement) {
uint16_t tInputVoltageRaw = waitAndReadADCChannelWithReference(aADCChannelForVoltageMeasurement, DEFAULT);
- return (aVCCVoltageMillivolt * (uint32_t) tInputVoltageRaw) / READING_FOR_AREF;
+ return (aVCCVoltageMillivolt * (uint32_t) tInputVoltageRaw) / 1023;
}
/*
@@ -606,18 +597,16 @@ uint16_t getVoltageMillivolt(uint16_t aVCCVoltageMillivolt, uint8_t aADCChannelF
*/
uint16_t getVoltageMillivolt(uint8_t aADCChannelForVoltageMeasurement) {
uint16_t tInputVoltageRaw = waitAndReadADCChannelWithReference(aADCChannelForVoltageMeasurement, DEFAULT);
- return (getVCCVoltageMillivolt() * (uint32_t) tInputVoltageRaw) / READING_FOR_AREF;
+ return (getVCCVoltageMillivolt() * (uint32_t) tInputVoltageRaw) / 1023;
}
uint16_t getVoltageMillivoltWith_1_1VoltReference(uint8_t aADCChannelForVoltageMeasurement) {
uint16_t tInputVoltageRaw = waitAndReadADCChannelWithReference(aADCChannelForVoltageMeasurement, INTERNAL);
- return (ADC_INTERNAL_REFERENCE_MILLIVOLT * (uint32_t) tInputVoltageRaw) / READING_FOR_AREF;
+ return (ADC_INTERNAL_REFERENCE_MILLIVOLT * (uint32_t) tInputVoltageRaw) / 1023;
}
/*
* 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();
@@ -645,13 +634,13 @@ bool isVCCUSBPowered(Print *aSerial) {
}
/*
- * It checks every 10 seconds for 6 times, and then returns true if the undervoltage condition ( <3.4V ) still applies.
* @ return true only once, when VCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP (6) times voltage too low -> shutdown
*/
bool isVCCUndervoltageMultipleTimes() {
/*
* Check VCC every VCC_CHECK_PERIOD_MILLIS (10) seconds
*/
+
if (millis() - sLastVCCCheckMillis >= VCC_CHECK_PERIOD_MILLIS) {
sLastVCCCheckMillis = millis();
@@ -661,32 +650,30 @@ bool isVCCUndervoltageMultipleTimes() {
readVCCVoltageMillivolt();
# endif
- /*
- * Do not check again if shutdown signaling (sVCCTooLowCounter >= 6) has happened
- */
- if (sVCCTooLowCounter < VCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP) { // VCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP = 6
+ if (sVCCTooLowCounter < VCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP) {
+ /*
+ * Do not check again if shutdown has happened
+ */
if (sVCCVoltageMillivolt > VCC_UNDERVOLTAGE_THRESHOLD_MILLIVOLT) {
sVCCTooLowCounter = 0; // reset counter
} else {
/*
- * Voltage too low, wait VCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP (6) times and then signal shut down.
+ * Voltage too low, wait VCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP (6) times and then shut down.
*/
if (sVCCVoltageMillivolt < VCC_EMERGENCY_UNDERVOLTAGE_THRESHOLD_MILLIVOLT) {
// emergency shutdown
sVCCTooLowCounter = VCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP;
-# if defined(LOCAL_INFO)
+# if defined(INFO)
Serial.println(
F(
"Voltage < " STR(VCC_EMERGENCY_UNDERVOLTAGE_THRESHOLD_MILLIVOLT) " mV detected -> emergency shutdown"));
# endif
} else {
sVCCTooLowCounter++;
-# if defined(LOCAL_INFO)
- Serial.print(sVCCVoltageMillivolt);
- Serial.print(F(" mV < " STR(VCC_UNDERVOLTAGE_THRESHOLD_MILLIVOLT) " mV detected: "));
-
+# if defined(INFO)
+ Serial.print(F("Voltage < " STR(VCC_UNDERVOLTAGE_THRESHOLD_MILLIVOLT) " mV detected: "));
Serial.print(VCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP - sVCCTooLowCounter);
- Serial.println(F(" attempts left"));
+ Serial.println(F(" tries left"));
# endif
}
if (sVCCTooLowCounter == VCC_UNDERVOLTAGE_CHECKS_BEFORE_STOP) {
@@ -828,7 +815,4 @@ float getVCCVoltage() {
#if defined(LOCAL_DEBUG)
#undef LOCAL_DEBUG
#endif
-#if defined(LOCAL_INFO)
-#undef LOCAL_INFO
-#endif
#endif // _ADC_UTILS_HPP
diff --git a/lib/IRremote/examples/AllProtocolsOnLCD/AllProtocolsOnLCD.ino b/lib/IRremote/examples/AllProtocolsOnLCD/AllProtocolsOnLCD.ino
index e381293d..c70463de 100644
--- a/lib/IRremote/examples/AllProtocolsOnLCD/AllProtocolsOnLCD.ino
+++ b/lib/IRremote/examples/AllProtocolsOnLCD/AllProtocolsOnLCD.ino
@@ -9,7 +9,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2022-2025 Armin Joachimsmeyer
+ * Copyright (c) 2022-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -36,7 +36,7 @@
#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
#if !defined(RAW_BUFFER_LENGTH)
-// For air condition remotes it may require up to 750. Default is 200.
+// For air condition remotes it requires 750. Default is 200.
# if (defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF)
#define RAW_BUFFER_LENGTH 360
# else
@@ -61,9 +61,8 @@
//#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 650 bytes program memory if all other protocols are active
// MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding,
-// to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 135.
-// 20 is taken as default if not otherwise specified / defined.
-//#define MARK_EXCESS_MICROS 40 // Adapt it to your IR receiver module. 40 is recommended for the cheap VS1838 modules at high intensity.
+// to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 142.
+#define MARK_EXCESS_MICROS 20 // Adapt it to your IR receiver module. 20 is recommended for the cheap VS1838 modules.
//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols.
@@ -138,6 +137,8 @@ void setup() {
#endif
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)
diff --git a/lib/IRremote/examples/AllProtocolsOnLCD/LiquidCrystal.cpp b/lib/IRremote/examples/AllProtocolsOnLCD/LiquidCrystal.cpp
index 8a6e7fa2..5dcef083 100644
--- a/lib/IRremote/examples/AllProtocolsOnLCD/LiquidCrystal.cpp
+++ b/lib/IRremote/examples/AllProtocolsOnLCD/LiquidCrystal.cpp
@@ -5,20 +5,6 @@
#include <inttypes.h>
#include "Arduino.h"
-#if defined(__AVR__)
-/*
- * The datasheet says: a command need > 37us to settle.
- * Use a delay of 2 us instead of 100 us after each command,
- * because the overhead of this library seems to be using the other 35 us.
- * At least it works perfectly for all my LCD's connected to Uno, Nano etc.
- * and it saves a lot of time in realtime applications using LCD as display,
- * like https://github.com/ArminJo/Arduino-DTSU666H_PowerMeter
- */
-# if !defined(DO_NOT_USE_FAST_LCD_TIMING)
-#define USE_FAST_LCD_TIMING
-# endif
-#endif
-
// When the display powers up, it is configured as follows:
//
// 1. Display clear
@@ -35,7 +21,7 @@
// S = 0; No shift
//
// Note, however, that resetting the Arduino doesn't reset the LCD, so we
-// can't assume that it is in that state when a sketch starts (and the
+// can't assume that its in that state when a sketch starts (and the
// LiquidCrystal constructor is called).
LiquidCrystal::LiquidCrystal(uint8_t rs, uint8_t rw, uint8_t enable,
@@ -86,7 +72,7 @@ void LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t en
else
_displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS;
- begin(16, 1); // initializing for a 1601 LCD, but the user must call begin() with the right values at startup. Outcommenting increases program size
+ begin(16, 1);
}
void LiquidCrystal::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) {
@@ -276,14 +262,12 @@ void LiquidCrystal::noAutoscroll(void) {
// Allows us to fill the first 8 CGRAM locations
// with custom characters
-// This also sets cursor to 0.0
void LiquidCrystal::createChar(uint8_t location, uint8_t charmap[]) {
location &= 0x7; // we only have 8 locations 0-7
command(LCD_SETCGRAMADDR | (location << 3));
for (int i=0; i<8; i++) {
write(charmap[i]);
}
- command(LCD_SETDDRAMADDR); // set cursor to 0.0, this avoids overwriting CGRAM by next write() command.
}
/*********** mid level commands, for sending data/cmds */
@@ -294,7 +278,7 @@ inline void LiquidCrystal::command(uint8_t value) {
inline size_t LiquidCrystal::write(uint8_t value) {
send(value, HIGH);
- return 1; // assume success
+ return 1; // assume sucess
}
/************ low level data pushing commands **********/
@@ -322,11 +306,7 @@ void LiquidCrystal::pulseEnable(void) {
digitalWrite(_enable_pin, HIGH);
delayMicroseconds(1); // enable pulse must be >450ns
digitalWrite(_enable_pin, LOW);
-#if defined(USE_FAST_LCD_TIMING)
- delayMicroseconds(2); // commands need > 37us to settle
-#else
delayMicroseconds(100); // commands need > 37us to settle
-#endif
}
void LiquidCrystal::write4bits(uint8_t value) {
diff --git a/lib/IRremote/examples/AllProtocolsOnLCD/PinDefinitionsAndMore.h b/lib/IRremote/examples/AllProtocolsOnLCD/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/AllProtocolsOnLCD/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/AllProtocolsOnLCD/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/ControlRelay/ControlRelay.ino b/lib/IRremote/examples/ControlRelay/ControlRelay.ino
index 0ea2e73a..346b13b3 100644
--- a/lib/IRremote/examples/ControlRelay/ControlRelay.ino
+++ b/lib/IRremote/examples/ControlRelay/ControlRelay.ino
@@ -53,6 +53,8 @@ void setup() {
pinMode(RELAY_PIN, 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)
diff --git a/lib/IRremote/examples/ControlRelay/PinDefinitionsAndMore.h b/lib/IRremote/examples/ControlRelay/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/ControlRelay/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/ControlRelay/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/IRDispatcherDemo/IRCommandDispatcher.hpp b/lib/IRremote/examples/IRDispatcherDemo/IRCommandDispatcher.hpp
index a8006400..701103a1 100644
--- a/lib/IRremote/examples/IRDispatcherDemo/IRCommandDispatcher.hpp
+++ b/lib/IRremote/examples/IRDispatcherDemo/IRCommandDispatcher.hpp
@@ -59,7 +59,7 @@
#else
//#define LOCAL_INFO // This enables info output only for this file
#endif
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
// Propagate debug level
#define LOCAL_INFO
@@ -78,7 +78,7 @@ IRCommandDispatcher IRDispatcher;
#endif
#if defined(USE_TINY_IR_RECEIVER)
-#define USE_CALLBACK_FOR_TINY_RECEIVER // Call the user provided function "void handleReceivedTinyIRData()" each time a frame or repeat is received.
+#define USE_CALLBACK_FOR_TINY_RECEIVER // Call the fixed function "void handleReceivedTinyIRData()" each time a frame or repeat is received.
#include "TinyIRReceiver.hpp" // included in "IRremote" library
void IRCommandDispatcher::init() {
diff --git a/lib/IRremote/examples/IRDispatcherDemo/IRDispatcherDemo.ino b/lib/IRremote/examples/IRDispatcherDemo/IRDispatcherDemo.ino
index 6df3321a..fda2a2c5 100644
--- a/lib/IRremote/examples/IRDispatcherDemo/IRDispatcherDemo.ino
+++ b/lib/IRremote/examples/IRDispatcherDemo/IRDispatcherDemo.ino
@@ -109,6 +109,8 @@ 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)
diff --git a/lib/IRremote/examples/IRDispatcherDemo/PinDefinitionsAndMore.h b/lib/IRremote/examples/IRDispatcherDemo/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/IRDispatcherDemo/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/IRDispatcherDemo/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.cpp b/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.cpp
index 8121e115..8a315e9c 100644
--- a/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.cpp
+++ b/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.cpp
@@ -8,7 +8,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2021-2025 Armin Joachimsmeyer
+ * Copyright (c) 2021-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -36,7 +36,7 @@
* Otherwise you may get warnings like "type 'struct IRData' itself violates the C++ One Definition Rule"
*/
#if !defined(RAW_BUFFER_LENGTH)
-// For air condition remotes it may require up to 750. Default is 200.
+// For air condition remotes it requires 750. Default is 200.
# if (defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF)
#define RAW_BUFFER_LENGTH 360
# elif (defined(RAMEND) && RAMEND <= 0x8FF) || (defined(RAMSIZE) && RAMSIZE < 0x8FF)
@@ -53,8 +53,8 @@ bool IRExtensionClass::decode() {
return MyIrReceiver->decode();
}
-bool IRExtensionClass::printIRResultShort(Print *aSerial, bool aCheckForRecordGapsMicros) {
- return MyIrReceiver->printIRResultShort(aSerial, aCheckForRecordGapsMicros);
+bool IRExtensionClass::printIRResultShort(Print *aSerial, bool aPrintRepeatGap, bool aCheckForRecordGapsMicros) {
+ return MyIrReceiver->printIRResultShort(aSerial, aPrintRepeatGap, aCheckForRecordGapsMicros);
}
void IRExtensionClass::resume() {
diff --git a/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.h b/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.h
index 07c85880..2fa648a7 100644
--- a/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.h
+++ b/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionClass.h
@@ -8,7 +8,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2021-2025 Armin Joachimsmeyer
+ * Copyright (c) 2021-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -40,7 +40,7 @@ public:
IRrecv * MyIrReceiver;
IRExtensionClass(IRrecv * aIrReceiver);
bool decode();
- bool printIRResultShort(Print *aSerial, bool aCheckForRecordGapsMicros = true);
+ bool printIRResultShort(Print *aSerial, bool aPrintRepeatGap = true, bool aCheckForRecordGapsMicros = true);
void resume();
};
diff --git a/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionTest.ino b/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionTest.ino
index 50bea009..3ec197ad 100644
--- a/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionTest.ino
+++ b/lib/IRremote/examples/IRremoteExtensionTest/IRremoteExtensionTest.ino
@@ -33,7 +33,7 @@
#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
#if !defined(RAW_BUFFER_LENGTH)
-// For air condition remotes it may require up to 750. Default is 200.
+// For air condition remotes it requires 750. Default is 200.
# if (defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF)
#define RAW_BUFFER_LENGTH 360
# else
@@ -52,15 +52,12 @@ IRExtensionClass IRExtension(&IrReceiver);
void setup() {
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)
- // 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 !!!
+ 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_IRREMOTE));
diff --git a/lib/IRremote/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h b/lib/IRremote/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/IRremoteExtensionTest/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/IRremoteInfo/IRremoteInfo.ino b/lib/IRremote/examples/IRremoteInfo/IRremoteInfo.ino
index 25d0f09d..31d03766 100644
--- a/lib/IRremote/examples/IRremoteInfo/IRremoteInfo.ino
+++ b/lib/IRremote/examples/IRremoteInfo/IRremoteInfo.ino
@@ -34,17 +34,13 @@ void dumpFooter();
void setup() {
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)
- // 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 !!!
+ 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_IRREMOTE));
diff --git a/lib/IRremote/examples/MicroGirs/MicroGirs.ino b/lib/IRremote/examples/MicroGirs/MicroGirs.ino
index ca2a9b18..a5bcae2b 100644
--- a/lib/IRremote/examples/MicroGirs/MicroGirs.ino
+++ b/lib/IRremote/examples/MicroGirs/MicroGirs.ino
@@ -67,7 +67,7 @@
#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
#if !defined(RAW_BUFFER_LENGTH)
-// For air condition remotes it may require up to 750. Default is 200.
+// For air condition remotes it requires 750. Default is 200.
# if (defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF)
#define RAW_BUFFER_LENGTH 360
# else
@@ -292,6 +292,8 @@ static void receive(Stream &stream) {
*/
void setup() {
Serial.begin(BAUDRATE);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
Serial.println(F(PROGNAME " " VERSION));
// Just to know which program is running on my Arduino
diff --git a/lib/IRremote/examples/MicroGirs/PinDefinitionsAndMore.h b/lib/IRremote/examples/MicroGirs/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/MicroGirs/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/MicroGirs/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/MultipleSendPins/MultipleSendPins.ino b/lib/IRremote/examples/MultipleSendPins/MultipleSendPins.ino
deleted file mode 100644
index 33566bcb..00000000
--- a/lib/IRremote/examples/MultipleSendPins/MultipleSendPins.ino
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * MultipleSendPins.cpp
- *
- * Demonstrates sending IR codes toggling between 2 different send pins.
- * Based on SimpleSender.
- *
- * Copyright (C) 2025 Armin Joachimsmeyer
- *
- * This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
- *
- * MIT License
- */
-#include <Arduino.h>
-
-#if !defined(ARDUINO_ESP32C3_DEV) // This is due to a bug in RISC-V compiler, which requires unused function sections :-(.
-#define DISABLE_CODE_FOR_RECEIVER // Disables static receiver code like receive timer ISR handler and static IRReceiver and irparams data. Saves 450 bytes program memory and 269 bytes RAM if receiving functions are not required.
-#endif
-//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
-
-#include <IRremote.hpp> // include the library
-
-void setup() {
- pinMode(LED_BUILTIN, OUTPUT);
-
- Serial.begin(115200);
-
- // Just to know which program is running on my Arduino
- Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
- Serial.print(F("Send IR signals alternating at pin 3 and 4"));
-
- /*
- * The IR library setup. That's all!
- */
- IrSender.begin(3); // Start with pin3 as send pin and enable feedback LED at default feedback LED pin
- disableLEDFeedback(); // Disable feedback LED at default feedback LED pin
-}
-
-/*
- * Set up the data to be sent.
- * For most protocols, the data is build up with a constant 8 (or 16 byte) address
- * and a variable 8 bit command.
- * There are exceptions like Sony and Denon, which have 5 bit address.
- */
-uint8_t sCommand = 0x34;
-uint8_t sRepeats = 0;
-
-void loop() {
- /*
- * Print current send values
- */
- Serial.println();
- Serial.print(F("Send now: address=0x00, command=0x"));
- Serial.print(sCommand, HEX);
- Serial.print(F(", repeats="));
- Serial.print(sRepeats);
- Serial.println();
-
- Serial.println(F("Send standard NEC with 8 bit address"));
- Serial.flush();
-
- // Receiver output for the first loop must be: Protocol=NEC Address=0x102 Command=0x34 Raw-Data=0xCB340102 (32 bits)
- IrSender.sendNEC(0x00, sCommand, sRepeats);
-
- /*
- * If you want to send a raw HEX value directly like e.g. 0xCB340102 you must use sendNECRaw()
- */
-// Serial.println(F("Send 32 bit LSB 0xCB340102 with NECRaw()"));
-// IrSender.sendNECRaw(0xCB340102, sRepeats);
- /*
- * If you want to send an "old" MSB HEX value used by IRremote versions before 3.0 like e.g. 0x40802CD3 you must use sendNECMSB()
- */
-// Serial.println(F("Send old 32 bit MSB 0x40802CD3 with sendNECMSB()"));
-// IrSender.sendNECMSB(0x40802CD3, 32, sRepeats);
- /*
- * Increment send values
- */
- sCommand += 0x11;
- sRepeats++;
- // clip repeats at 4
- if (sRepeats > 4) {
- sRepeats = 4;
- }
-
- /*
- * Toggle between send pin 3 and 4
- */
- if (IrSender.sendPin == 3) {
- IrSender.setSendPin(4);
- } else {
- IrSender.setSendPin(3);
- }
- delay(1000); // delay must be greater than 5 ms (RECORD_GAP_MICROS), otherwise the receiver sees it as one long signal
-}
diff --git a/lib/IRremote/examples/ReceiveAndSend/PinDefinitionsAndMore.h b/lib/IRremote/examples/ReceiveAndSend/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/ReceiveAndSend/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/ReceiveAndSend/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/ReceiveAndSend/ReceiveAndSend.ino b/lib/IRremote/examples/ReceiveAndSend/ReceiveAndSend.ino
index 5a093599..ee4dc751 100644
--- a/lib/IRremote/examples/ReceiveAndSend/ReceiveAndSend.ino
+++ b/lib/IRremote/examples/ReceiveAndSend/ReceiveAndSend.ino
@@ -23,7 +23,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2009-2025 Ken Shirriff, Armin Joachimsmeyer
+ * Copyright (c) 2009-2024 Ken Shirriff, Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -58,7 +58,7 @@
//#define DECODE_KASEIKYO
//#define DECODE_PANASONIC // alias for DECODE_KASEIKYO
//#define DECODE_LG
-//#define DECODE_NEC // Includes Apple and Onkyo
+#define DECODE_NEC // Includes Apple and Onkyo
//#define DECODE_SAMSUNG
//#define DECODE_SONY
//#define DECODE_RC5
@@ -72,23 +72,22 @@
//
#if !defined(RAW_BUFFER_LENGTH)
-// For air condition remotes it may require up to 750. Default is 200.
+// For air condition remotes it requires 750. Default is 200.
# if !((defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF))
-#define RAW_BUFFER_LENGTH 700 // we require 2 buffer of this size for this example
+#define RAW_BUFFER_LENGTH 750
# endif
#endif
//#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program memory.
-#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 650 bytes program memory if all other protocols are active
+//#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 650 bytes program memory if all other protocols are active
//#define NO_LED_FEEDBACK_CODE // saves 92 bytes program memory
//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols
//#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
// MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding,
-// to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 135.
-// 20 is taken as default if not otherwise specified / defined.
-//#define MARK_EXCESS_MICROS 40 // Adapt it to your IR receiver module. 40 is recommended for the cheap VS1838 modules at high intensity.
+// to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 142.
+#define MARK_EXCESS_MICROS 20 // Adapt it to your IR receiver module. 20 is recommended for the cheap VS1838 modules.
//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
@@ -115,6 +114,8 @@ void setup() {
pinMode(SEND_BUTTON_PIN, INPUT_PULLUP);
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)
@@ -130,9 +131,8 @@ void setup() {
Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
IrSender.begin(); // Start with IR_SEND_PIN -which is defined in PinDefinitionsAndMore.h- as send pin and enable feedback LED at default feedback LED pin
- Serial.print(F("Ready to send IR signal (with repeats) at pin " STR(IR_SEND_PIN) " as long as button at pin "));
- Serial.print(SEND_BUTTON_PIN);
- Serial.println(F(" is pressed."));
+ Serial.print(F("Ready to send IR signals at pin " STR(IR_SEND_PIN) " on press of button at pin "));
+ Serial.println(SEND_BUTTON_PIN);
}
void loop() {
@@ -169,7 +169,6 @@ void loop() {
// Restart receiver
Serial.println(F("Button released -> start receiving"));
IrReceiver.start();
- delay(100); // Button debouncing
} else if (IrReceiver.decode()) {
/*
@@ -180,6 +179,7 @@ void loop() {
}
sSendButtonWasActive = tSendButtonIsActive;
+ delay(100);
}
// Stores the code for later playback in sStoredIRData
@@ -202,31 +202,21 @@ void storeCode() {
Serial.println(F("Ignore parity error"));
return;
}
- if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_WAS_OVERFLOW) {
- Serial.println(F("Overflow occurred, raw data did not fit into " STR(RAW_BUFFER_LENGTH) " byte raw buffer"));
- return;
- }
/*
* Copy decoded data
*/
sStoredIRData.receivedIRData = IrReceiver.decodedIRData;
- auto tProtocol = sStoredIRData.receivedIRData.protocol;
- if (tProtocol == UNKNOWN || tProtocol == PULSE_WIDTH || tProtocol == PULSE_DISTANCE) {
- // TODO: support PULSE_WIDTH and PULSE_DISTANCE with IrSender.write
+ if (sStoredIRData.receivedIRData.protocol == UNKNOWN) {
+ Serial.print(F("Received unknown code and store "));
+ Serial.print(IrReceiver.decodedIRData.rawDataPtr->rawlen - 1);
+ Serial.println(F(" timing entries as raw "));
+ IrReceiver.printIRResultRawFormatted(&Serial, true); // Output the results in RAW format
sStoredIRData.rawCodeLength = IrReceiver.decodedIRData.rawDataPtr->rawlen - 1;
/*
* Store the current raw data in a dedicated array for later usage
*/
IrReceiver.compensateAndStoreIRResultInArray(sStoredIRData.rawCode);
- /*
- * Print info
- */
- Serial.print(F("Received unknown or pulse width/distance code and store "));
- Serial.print(IrReceiver.decodedIRData.rawDataPtr->rawlen - 1);
- Serial.println(F(" timing entries as raw in buffer of size " STR(RAW_BUFFER_LENGTH)));
- IrReceiver.printIRResultRawFormatted(&Serial, true); // Output the results in RAW format
-
} else {
IrReceiver.printIRResultShort(&Serial);
IrReceiver.printIRSendUsage(&Serial);
@@ -236,8 +226,7 @@ void storeCode() {
}
void sendCode(storedIRDataStruct *aIRDataToSend) {
- auto tProtocol = aIRDataToSend->receivedIRData.protocol;
- if (tProtocol == UNKNOWN || tProtocol == PULSE_WIDTH || tProtocol == PULSE_DISTANCE /* i.e. raw */) {
+ if (aIRDataToSend->receivedIRData.protocol == UNKNOWN /* i.e. raw */) {
// Assume 38 KHz
IrSender.sendRaw(aIRDataToSend->rawCode, aIRDataToSend->rawCodeLength, 38);
@@ -245,11 +234,12 @@ void sendCode(storedIRDataStruct *aIRDataToSend) {
Serial.print(aIRDataToSend->rawCodeLength);
Serial.println(F(" marks or spaces"));
} else {
+
/*
* Use the write function, which does the switch for different protocols
*/
IrSender.write(&aIRDataToSend->receivedIRData);
- printIRResultShort(&Serial, &aIRDataToSend->receivedIRData);
+ printIRResultShort(&Serial, &aIRDataToSend->receivedIRData, false);
}
}
diff --git a/lib/IRremote/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h b/lib/IRremote/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/ReceiveAndSendDistanceWidth/ReceiveAndSendDistanceWidth.ino b/lib/IRremote/examples/ReceiveAndSendDistanceWidth/ReceiveAndSendDistanceWidth.ino
index 31391cb5..c0d9da01 100644
--- a/lib/IRremote/examples/ReceiveAndSendDistanceWidth/ReceiveAndSendDistanceWidth.ino
+++ b/lib/IRremote/examples/ReceiveAndSendDistanceWidth/ReceiveAndSendDistanceWidth.ino
@@ -23,7 +23,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2023-2025 Armin Joachimsmeyer
+ * Copyright (c) 2023 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -57,7 +57,7 @@
#define DECODE_DISTANCE_WIDTH // Universal decoder for pulse distance width protocols
//
#if !defined(RAW_BUFFER_LENGTH)
-// For air condition remotes it may require up to 750. Default is 200.
+// For air condition remotes it requires 750. Default is 200.
# if (defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF)
#define RAW_BUFFER_LENGTH 360
# elif (defined(RAMEND) && RAMEND <= 0x8FF) || (defined(RAMSIZE) && RAMSIZE < 0x8FF)
@@ -79,8 +79,8 @@
#define DELAY_BETWEEN_REPEATS_MILLIS 70
// Storage for the recorded code, pre-filled with NEC data
-IRRawDataType sDecodedRawDataArray[DECODED_RAW_DATA_ARRAY_SIZE] = { 0x7B34ED12 }; // Initialize with NEC address 0x12 and command 0x34
-DistanceWidthTimingInfoStruct sDistanceWidthTimingInfo = { 9000, 4500, 560, 1690, 560, 560 }; // Initialize with NEC timing
+IRRawDataType sDecodedRawDataArray[RAW_DATA_ARRAY_SIZE] = { 0x7B34ED12 }; // Initialize with NEC address 0x12 and command 0x34
+DistanceWidthTimingInfoStruct sDistanceWidthTimingInfo = { 9000, 4500, 560, 1690, 560, 560 }; // Initialize with NEC timing
uint8_t sNumberOfBits = 32;
bool sSendButtonWasActive;
@@ -89,6 +89,8 @@ void setup() {
pinMode(SEND_BUTTON_PIN, INPUT_PULLUP);
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)
diff --git a/lib/IRremote/examples/ReceiveAndSendHob2Hood/PinDefinitionsAndMore.h b/lib/IRremote/examples/ReceiveAndSendHob2Hood/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/ReceiveAndSendHob2Hood/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/ReceiveAndSendHob2Hood/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/ReceiveAndSendHob2Hood/ReceiveAndSendHob2Hood.ino b/lib/IRremote/examples/ReceiveAndSendHob2Hood/ReceiveAndSendHob2Hood.ino
index f9b3a2b0..159dad61 100644
--- a/lib/IRremote/examples/ReceiveAndSendHob2Hood/ReceiveAndSendHob2Hood.ino
+++ b/lib/IRremote/examples/ReceiveAndSendHob2Hood/ReceiveAndSendHob2Hood.ino
@@ -74,6 +74,8 @@ const uint16_t *const Hob2HoodSendCommands[NUMBER_OF_HOB_TO_HOOD_COMMANDS] = { F
void setup() {
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)
diff --git a/lib/IRremote/examples/ReceiveDemo/PinDefinitionsAndMore.h b/lib/IRremote/examples/ReceiveDemo/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/ReceiveDemo/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/ReceiveDemo/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/ReceiveDemo/ReceiveDemo.ino b/lib/IRremote/examples/ReceiveDemo/ReceiveDemo.ino
index 44fa78e6..358c3118 100644
--- a/lib/IRremote/examples/ReceiveDemo/ReceiveDemo.ino
+++ b/lib/IRremote/examples/ReceiveDemo/ReceiveDemo.ino
@@ -10,7 +10,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2020-2025 Armin Joachimsmeyer
+ * Copyright (c) 2020-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -65,28 +65,15 @@
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604. Code does not fit in program memory of ATtiny85 etc.
// !!! Enabling B&O disables detection of Sony, because the repeat gap for SONY is smaller than the B&O frame gap :-( !!!
//#define DECODE_BEO // Bang & Olufsen protocol always must be enabled explicitly. It has an IR transmit frequency of 455 kHz! It prevents decoding of SONY!
-#else
-// for 8k flash
-//#define DECODE_DENON // Includes Sharp
-#define DECODE_JVC
-#define DECODE_KASEIKYO
-#define DECODE_PANASONIC // alias for DECODE_KASEIKYO
-#define DECODE_LG
-#define DECODE_NEC // Includes Apple and Onkyo
-#define DECODE_SAMSUNG
-//#define DECODE_SONY
-//#define DECODE_RC5
-//#define DECODE_RC6
-#define DECODE_DISTANCE_WIDTH // Universal decoder for pulse distance width protocols
-#define DECODE_HASH // special decoder for all protocols
-
-#define EXCLUDE_EXOTIC_PROTOCOLS
+#endif
+#if defined(DECODE_BEO)
+#define RECORD_GAP_MICROS 16000 // always get the complete frame in the receive buffer, but this prevents decoding of SONY!
#endif
// etc. see IRremote.hpp
//
#if !defined(RAW_BUFFER_LENGTH)
-// For air condition remotes it may require up to 750. Default is 200.
+// For air condition remotes it requires 750. Default is 200.
# if !((defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF))
#define RAW_BUFFER_LENGTH 750
# endif
@@ -96,14 +83,11 @@
//#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program memory.
//#define EXCLUDE_EXOTIC_PROTOCOLS // saves around 650 bytes program memory if all other protocols are active
//#define IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK // saves 32 bytes program memory
+
// MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding,
-// to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 135.
-// 20 is taken as default if not otherwise specified / defined.
-//#define MARK_EXCESS_MICROS 40 // Adapt it to your IR receiver module. 40 is recommended for the cheap VS1838 modules at high intensity.
+// to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 142.
+//#define MARK_EXCESS_MICROS 20 // Adapt it to your IR receiver module. 40 is taken for the cheap VS1838 module her, since we have high intensity.
-#if defined(DECODE_BEO)
-#define RECORD_GAP_MICROS 16000 // always get the complete frame in the receive buffer, but this prevents decoding of SONY!
-#endif
//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols
//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
@@ -115,11 +99,6 @@
#else
#define DEBUG_BUTTON_PIN 6
#endif
-#if defined(ESP32)
-# if !digitalPinIsValid(DEBUG_BUTTON_PIN)
-#undef DEBUG_BUTTON_PIN // DEBUG_BUTTON_PIN number is not valid, so delete definition to disable further usage
-# endif
-#endif
void generateTone();
void handleOverflow();
@@ -127,18 +106,17 @@ bool detectLongPress(uint16_t aLongPressDurationMillis);
void setup() {
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604. Code does not fit in program memory of ATtiny85 etc.
-# if defined(DEBUG_BUTTON_PIN)
pinMode(DEBUG_BUTTON_PIN, INPUT_PULLUP);
-# endif
#endif
- Serial.begin(9600);
+ 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) || (defined(ESP32) && defined(ARDUINO_USB_MODE))
+ || 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!
#endif
-
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
@@ -157,32 +135,25 @@ void setup() {
Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
#endif
-#if defined(LED_BUILTIN) && !defined(NO_LED_FEEDBACK_CODE)
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- Serial.print(F("Active low "));
-# endif
- Serial.print(F("FeedbackLED at pin "));
- Serial.println(LED_BUILTIN); // Works also for ESP32: static const uint8_t LED_BUILTIN = 8; #define LED_BUILTIN LED_BUILTIN
-#endif
-
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604. Code does not fit in program memory of ATtiny85 etc.
Serial.println();
-# if defined(DEBUG_BUTTON_PIN)
- Serial.print(F("If you connect debug pin "));
-# if defined(APPLICATION_PIN_STRING)
- Serial.print(APPLICATION_PIN_STRING);
-# else
- Serial.print(DEBUG_BUTTON_PIN);
-# endif
- Serial.println(F(" to ground, raw data is always printed and tone is disabled"));
+ if (digitalRead(DEBUG_BUTTON_PIN) != LOW) {
+ Serial.print(F("If you connect debug pin "));
+# if defined(APPLICATION_PIN_STRING)
+ Serial.print(APPLICATION_PIN_STRING);
+# else
+ Serial.print(DEBUG_BUTTON_PIN);
# endif
+ Serial.print(F(" to ground, "));
+ }
+ Serial.println(F("raw data is always printed"));
// infos for receive
Serial.print(RECORD_GAP_MICROS);
Serial.println(F(" us is the (minimum) gap, after which the start of a new IR packet is assumed"));
Serial.print(MARK_EXCESS_MICROS);
Serial.println(F(" us are subtracted from all marks and added to all spaces for decoding"));
-#endif // FLASHEND >= 0x3FFF
+#endif
}
void loop() {
@@ -196,7 +167,8 @@ void loop() {
*/
if (IrReceiver.decode()) {
Serial.println();
-#if FLASHEND < 0x3FFF // For less than 16k flash, only print a minimal summary of received data
+#if FLASHEND < 0x3FFF //
+ // For less than 16k flash, only print a minimal summary of received data
IrReceiver.printIRResultMinimal(&Serial);
#else
@@ -212,10 +184,7 @@ void loop() {
*/
if ((IrReceiver.decodedIRData.protocol != SONY) && (IrReceiver.decodedIRData.protocol != PULSE_WIDTH)
&& (IrReceiver.decodedIRData.protocol != PULSE_DISTANCE) && (IrReceiver.decodedIRData.protocol != UNKNOWN)
-#if defined(DEBUG_BUTTON_PIN)
- && digitalRead(DEBUG_BUTTON_PIN) != LOW
-#endif
- ) {
+ && digitalRead(DEBUG_BUTTON_PIN) != LOW) {
/*
* For SONY the tone prevents the detection of a repeat after the 15 ms SONY gap.
* In debug mode and for unknown protocols, we need the time for extended output.
@@ -228,23 +197,14 @@ void loop() {
/*
* Print info
*/
- if (IrReceiver.decodedIRData.protocol == UNKNOWN
-#if defined(DEBUG_BUTTON_PIN)
- || digitalRead(DEBUG_BUTTON_PIN) == LOW)
-#endif
- {
+ if (IrReceiver.decodedIRData.protocol == UNKNOWN || digitalRead(DEBUG_BUTTON_PIN) == LOW) {
// We have debug enabled or an unknown protocol, print extended info
if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
Serial.println(F("Received noise or an unknown (or not yet enabled) protocol"));
}
IrReceiver.printIRResultRawFormatted(&Serial, true);
}
- if (IrReceiver.decodedIRData.protocol == UNKNOWN) {
- auto tDecodedRawData = IrReceiver.decodedIRData.decodedRawData; // uint32_t on 8 and 16 bit CPUs and uint64_t on 32 and 64 bit CPUs
- Serial.print(F("Raw data received are 0x"));
- Serial.println(tDecodedRawData);
-
- } else {
+ if (IrReceiver.decodedIRData.protocol != UNKNOWN) {
/*
* The info output for a successful receive
*/
@@ -264,16 +224,11 @@ void loop() {
/*
* Finally check the received data and perform actions according to the received address and commands
*/
-
- if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_REPEAT) {
- Serial.println(F("Repeat received. Here you can repeat the same action as before."));
- } else {
- if (IrReceiver.decodedIRData.address == 0) {
- if (IrReceiver.decodedIRData.command == 0x10) {
- // do something
- } else if (IrReceiver.decodedIRData.command == 0x11) {
- // do something else
- }
+ if (IrReceiver.decodedIRData.address == 0) {
+ if (IrReceiver.decodedIRData.command == 0x10) {
+ // do something
+ } else if (IrReceiver.decodedIRData.command == 0x11) {
+ // do something else
}
}
@@ -295,30 +250,28 @@ void loop() {
}
-#if FLASHEND >= 0x3FFF // No tone() available when using ATTinyCore
/*
* Stop receiver, generate a single beep and start receiver again
*/
void generateTone() {
-# if !defined(ESP8266) && !defined(NRF5) // tone on esp8266 works only once, then it disables IrReceiver.restartTimer() / timerConfigForReceive().
-# if defined(ESP32) // ESP32 uses another timer for tone(), maybe other platforms (not tested yet) too.
+#if !defined(ESP8266) && !defined(NRF5) // tone on esp8266 works only once, then it disables IrReceiver.restartTimer() / timerConfigForReceive().
+# if defined(ESP32) // ESP32 uses another timer for tone(), maybe other platforms (not tested yet) too.
tone(TONE_PIN, 2200, 8);
-# else
+# else
IrReceiver.stopTimer(); // Stop timer consistently before calling tone() or other functions using the timer resource.
tone(TONE_PIN, 2200, 8);
delay(8);
IrReceiver.restartTimer(); // Restart IR timer after timer resource is no longer blocked.
-# endif
# endif
+#endif
}
-#endif // FLASHEND >= 0x3FFF
void handleOverflow() {
Serial.println(F("Overflow detected"));
Serial.println(F("Try to increase the \"RAW_BUFFER_LENGTH\" value of " STR(RAW_BUFFER_LENGTH) " in " __FILE__));
// see also https://github.com/Arduino-IRremote/Arduino-IRremote#compile-options--macros-for-this-library
-#if !defined(ESP8266) && !defined(NRF5) && FLASHEND >= 0x3FFF // tone on esp8266 works once, then it disables IrReceiver.restartTimer() / timerConfigForReceive().
+#if !defined(ESP8266) && !defined(NRF5) // tone on esp8266 works once, then it disables IrReceiver.restartTimer() / timerConfigForReceive().
/*
* Stop timer, generate a double beep and start timer again
*/
diff --git a/lib/IRremote/examples/ReceiveDump/PinDefinitionsAndMore.h b/lib/IRremote/examples/ReceiveDump/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/ReceiveDump/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/ReceiveDump/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/ReceiveDump/ReceiveDump.ino b/lib/IRremote/examples/ReceiveDump/ReceiveDump.ino
index d1921efb..8f58e31c 100644
--- a/lib/IRremote/examples/ReceiveDump/ReceiveDump.ino
+++ b/lib/IRremote/examples/ReceiveDump/ReceiveDump.ino
@@ -10,7 +10,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2020-2025 Armin Joachimsmeyer
+ * Copyright (c) 2020-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -36,23 +36,22 @@
#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
#if !defined(RAW_BUFFER_LENGTH)
-// For air condition remotes it may require up to 750. Default is 200.
+// For air condition remotes it requires 750. Default is 200.
# if !((defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF))
-#define RAW_BUFFER_LENGTH 730 // this allows usage of 16 bit raw buffer, for RECORD_GAP_MICROS > 20000
+#define RAW_BUFFER_LENGTH 750
# endif
#endif
/*
* MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding,
- * to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 135.
- * 20 is taken as default if not otherwise specified / defined.
+ * to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 142.
*
* You can change this value accordingly to the receiver module you use.
* The required value can be derived from the timings printed here.
* Keep in mind that the timings may change with the distance
* between sender and receiver as well as with the ambient light intensity.
*/
-//#define MARK_EXCESS_MICROS 40 // Adapt it to your IR receiver module. 40 is recommended for the cheap VS1838 modules at high intensity.
+#define MARK_EXCESS_MICROS 20 // Adapt it to your IR receiver module. 20 is recommended for the cheap VS1838 modules.
//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols
//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
@@ -66,17 +65,13 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200); // Status message will be sent to PC at 9600 baud
+ 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)
- // 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 !!!
+ 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_IRREMOTE));
@@ -91,7 +86,6 @@ void setup() {
Serial.print(RECORD_GAP_MICROS);
Serial.println(F(" us is the (minimum) gap, after which the start of a new IR packet is assumed"));
Serial.print(MARK_EXCESS_MICROS);
- Serial.println(F(" us are subtracted from all marks and added to all spaces for decoding"));
Serial.println();
Serial.println(F("Because of the verbose output (>200 ms at 115200 baud), repeats are not dumped correctly!"));
Serial.println();
diff --git a/lib/IRremote/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h b/lib/IRremote/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/ReceiveOneAndSendMultiple/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/ReceiveOneAndSendMultiple/ReceiveOneAndSendMultiple.ino b/lib/IRremote/examples/ReceiveOneAndSendMultiple/ReceiveOneAndSendMultiple.ino
index fd2a8932..a4a584f0 100644
--- a/lib/IRremote/examples/ReceiveOneAndSendMultiple/ReceiveOneAndSendMultiple.ino
+++ b/lib/IRremote/examples/ReceiveOneAndSendMultiple/ReceiveOneAndSendMultiple.ino
@@ -13,7 +13,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2020-2025 Armin Joachimsmeyer
+ * Copyright (c) 2020-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -104,6 +104,8 @@ 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)
diff --git a/lib/IRremote/examples/ReceiverTimingAnalysis/ReceiverTimingAnalysis.ino b/lib/IRremote/examples/ReceiverTimingAnalysis/ReceiverTimingAnalysis.ino
index ab732bcd..c0efd284 100644
--- a/lib/IRremote/examples/ReceiverTimingAnalysis/ReceiverTimingAnalysis.ino
+++ b/lib/IRremote/examples/ReceiverTimingAnalysis/ReceiverTimingAnalysis.ino
@@ -48,16 +48,13 @@ 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.
+
#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)
- // 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 !!!
+ 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__));
@@ -73,11 +70,7 @@ 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();
diff --git a/lib/IRremote/examples/SendAndReceive/PinDefinitionsAndMore.h b/lib/IRremote/examples/SendAndReceive/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/SendAndReceive/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/SendAndReceive/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/SendAndReceive/SendAndReceive.ino b/lib/IRremote/examples/SendAndReceive/SendAndReceive.ino
index 9b80ab7e..9e99353d 100644
--- a/lib/IRremote/examples/SendAndReceive/SendAndReceive.ino
+++ b/lib/IRremote/examples/SendAndReceive/SendAndReceive.ino
@@ -53,6 +53,8 @@
void setup() {
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)
diff --git a/lib/IRremote/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h b/lib/IRremote/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/SendBoseWaveDemo/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/SendBoseWaveDemo/SendBoseWaveDemo.ino b/lib/IRremote/examples/SendBoseWaveDemo/SendBoseWaveDemo.ino
index 5046b96c..a7eafb3d 100644
--- a/lib/IRremote/examples/SendBoseWaveDemo/SendBoseWaveDemo.ino
+++ b/lib/IRremote/examples/SendBoseWaveDemo/SendBoseWaveDemo.ino
@@ -110,6 +110,8 @@ 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)
diff --git a/lib/IRremote/examples/SendDemo/PinDefinitionsAndMore.h b/lib/IRremote/examples/SendDemo/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/SendDemo/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/SendDemo/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/SendDemo/SendDemo.ino b/lib/IRremote/examples/SendDemo/SendDemo.ino
index 8aa9e0d6..c644f3e4 100644
--- a/lib/IRremote/examples/SendDemo/SendDemo.ino
+++ b/lib/IRremote/examples/SendDemo/SendDemo.ino
@@ -8,7 +8,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2020-2025 Armin Joachimsmeyer
+ * Copyright (c) 2020-2023 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -37,41 +37,28 @@
#if !defined(ARDUINO_ESP32C3_DEV) // This is due to a bug in RISC-V compiler, which requires unused function sections :-(.
#define DISABLE_CODE_FOR_RECEIVER // Disables static receiver code like receive timer ISR handler and static IRReceiver and irparams data. Saves 450 bytes program memory and 269 bytes RAM if receiving functions are not required.
#endif
-//#define IR_USE_AVR_TIMER1
//#define EXCLUDE_EXOTIC_PROTOCOLS // Saves around 240 bytes program memory if IrSender.write is used
-//#define USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN // Reverses the polarity at the send pin.
-//#define USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN // Use or simulate open drain output mode at send pin. Attention, active state of open drain is LOW, so connect the send LED between positive supply and send pin!
//#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
-//#define USE_ACTIVE_HIGH_OUTPUT_FOR_NO_SEND_PWM // Simulate an active high receiver signal instead of an active low signal.
-#if FLASHEND <= 0x1FFF // For 8k flash or less like ATtiny85
-#define NO_LED_FEEDBACK_CODE // Saves 344 bytes program memory
-#endif
+//#define USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN // Simulate an active high receiver signal instead of an active low signal.
+//#define USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN // Use or simulate open drain output mode at send pin. Attention, active state of open drain is LOW, so connect the send LED between positive supply and send pin!
+//#define NO_LED_FEEDBACK_CODE // Saves 566 bytes program memory
+
//#undef IR_SEND_PIN // enable this, if you need to set send pin programmatically using uint8_t tSendPin below
#include <IRremote.hpp>
#define DELAY_AFTER_SEND 2000
#define DELAY_AFTER_LOOP 5000
-#if __INT_WIDTH__ < 32
-IRRawDataType const tRawDataPGM[] PROGMEM = { 0xB02002, 0xA010 }; // LSB of tRawData[0] is sent first
-/*
- * Alternative definition of tRawDataPGM as byte array of same size with same content as { 0xB02002, 0xA010}
- * But be aware, that this requires a cast when using tRawDataPGM as parameter.
- * Like sendPulseDistanceWidthFromPGMArray_P(..., (IRRawDataType*) &tRawDataPGM[0], ...);
- */
-//uint8_t const tRawDataPGM[] PROGMEM = { 0x02, 0x20, 0xB0, 0x00, /*0xB02002*/
-//0x10, 0xA0, 0x0, 0x0, /*0xA010*/};
-#endif
-
void setup() {
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)
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_IRREMOTE));
@@ -106,15 +93,6 @@ void setup() {
Serial.print(IrSender.periodTimeMicros);
Serial.println(F(" us"));
#endif
-
-#if defined(LED_BUILTIN) && !defined(NO_LED_FEEDBACK_CODE)
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- Serial.print(F("Active low "));
-# endif
- Serial.print(F("FeedbackLED at pin "));
- Serial.println(LED_BUILTIN); // Works also for ESP32: static const uint8_t LED_BUILTIN = 8; #define LED_BUILTIN LED_BUILTIN
-#endif
-
}
/*
@@ -159,7 +137,7 @@ void loop() {
delay(DELAY_AFTER_SEND);
if (sRepeats == 0) {
-#if FLASHEND >= 0x3FFF && ((!defined(RAMEND) && !defined(RAMSIZE)) || (defined(RAMEND) && RAMEND > 0x6FF) || (defined(RAMSIZE) && RAMSIZE > 0x6FF)) // For 16k flash or more, like ATtiny1604. Code does not fit in program memory of ATtiny85 etc.
+#if FLASHEND >= 0x3FFF && ((defined(RAMEND) && RAMEND > 0x6FF) || (defined(RAMSIZE) && RAMSIZE > 0x6FF)) // For 16k flash or more, like ATtiny1604. Code does not fit in program memory of ATtiny85 etc.
/*
* Send constant values only once in this demo
*/
@@ -207,71 +185,71 @@ void loop() {
Serial.flush();
IrSender.sendNECMSB(0x40802CD3, 32, false);
delay(DELAY_AFTER_SEND);
+#endif
- Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance PGM using ProtocolConstants"));
+ Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance using ProtocolConstants"));
Serial.flush();
-# if __INT_WIDTH__ < 32
- IrSender.sendPulseDistanceWidthFromPGMArray_P(&KaseikyoProtocolConstants, (IRRawDataType*) &tRawDataPGM[0], 48, NO_REPEATS); // Panasonic is a Kaseikyo variant
-# else
- IrSender.sendPulseDistanceWidth_P(&KaseikyoProtocolConstants, 0xA010B02002, 48, NO_REPEATS); // Panasonic is a Kaseikyo variant
-# endif
+#if __INT_WIDTH__ < 32
+ IRRawDataType tRawData[] = { 0xB02002, 0xA010 }; // LSB of tRawData[0] is sent first
+ IrSender.sendPulseDistanceWidthFromArray(&KaseikyoProtocolConstants, &tRawData[0], 48, NO_REPEATS); // Panasonic is a Kaseikyo variant
+#else
+ IrSender.sendPulseDistanceWidth(&KaseikyoProtocolConstants, 0xA010B02002, 48, NO_REPEATS); // Panasonic is a Kaseikyo variant
+#endif
delay(DELAY_AFTER_SEND);
/*
* Send 2 Panasonic 48 bit codes as Pulse Distance data, once with LSB and once with MSB first
*/
- Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance PGM"));
+ Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance"));
Serial.println(F(" LSB first"));
Serial.flush();
-# if __INT_WIDTH__ < 32
- IrSender.sendPulseDistanceWidthFromPGMArray(38, 3450, 1700, 450, 1250, 450, 400, (IRRawDataType*) tRawDataPGM, 48,
+#if __INT_WIDTH__ < 32
+ IrSender.sendPulseDistanceWidthFromArray(38, 3450, 1700, 450, 1250, 450, 400, &tRawData[0], 48,
PROTOCOL_IS_LSB_FIRST, 0, NO_REPEATS);
-# else
- IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0xA010B02002, 48, PROTOCOL_IS_LSB_FIRST, 0,
- NO_REPEATS);
-# endif
+#else
+ IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0xA010B02002, 48, PROTOCOL_IS_LSB_FIRST,
+ 0, NO_REPEATS);
+#endif
delay(DELAY_AFTER_SEND);
// The same with MSB first. Use bit reversed raw data of LSB first part
Serial.println(F(" MSB first"));
- IRRawDataType tRawData[4];
-# if __INT_WIDTH__ < 32
+#if __INT_WIDTH__ < 32
tRawData[0] = 0x40040D00; // MSB of tRawData[0] is sent first
tRawData[1] = 0x805;
IrSender.sendPulseDistanceWidthFromArray(38, 3450, 1700, 450, 1250, 450, 400, &tRawData[0], 48,
PROTOCOL_IS_MSB_FIRST, 0, NO_REPEATS);
-# else
- IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0x40040D000805, 48, PROTOCOL_IS_MSB_FIRST, 0,
- NO_REPEATS);
-# endif
+#else
+ IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0x40040D000805, 48, PROTOCOL_IS_MSB_FIRST,
+ 0, NO_REPEATS);
+#endif
delay(DELAY_AFTER_SEND);
Serial.println(F("Send 72 bit PulseDistance 0x5A AFEDCBA9 87654321 LSB first"));
Serial.flush();
-# if __INT_WIDTH__ < 32
+# if __INT_WIDTH__ < 32
tRawData[0] = 0x87654321; // LSB of tRawData[0] is sent first
tRawData[1] = 0xAFEDCBA9;
tRawData[2] = 0x5A;
IrSender.sendPulseDistanceWidthFromArray(38, 8900, 4450, 550, 1700, 550, 600, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, 0,
NO_REPEATS);
-# else
- tRawData[0] = 0xAFEDCBA987654321;
- tRawData[1] = 0x5A; // LSB of tRawData[0] is sent first
- IrSender.sendPulseDistanceWidthFromArray(38, 8900, 4450, 550, 1700, 550, 600, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, 0,
- NO_REPEATS);
-# endif
+# else
+ IRRawDataType tRawData[] = { 0xAFEDCBA987654321, 0x5A }; // LSB of tRawData[0] is sent first
+ IrSender.sendPulseDistanceWidthFromArray(38, 8900, 4450, 550, 1700, 550, 600, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, 0, NO_REPEATS);
+# endif
delay(DELAY_AFTER_SEND);
Serial.println(F("Send 52 bit PulseDistanceWidth 0xDCBA9 87654321 LSB first"));
Serial.flush();
// Real PulseDistanceWidth (constant bit length) does not require a stop bit
-# if __INT_WIDTH__ < 32
+#if __INT_WIDTH__ < 32
IrSender.sendPulseDistanceWidthFromArray(38, 300, 600, 600, 300, 300, 600, &tRawData[0], 52,
PROTOCOL_IS_LSB_FIRST, 0, 0);
-# else
- IrSender.sendPulseDistanceWidth(38, 300, 600, 600, 300, 300, 600, 0xDCBA987654321, 52, PROTOCOL_IS_LSB_FIRST, 0, 0);
-# endif
+#else
+ IrSender.sendPulseDistanceWidth(38, 300, 600, 600, 300, 300, 600, 0xDCBA987654321, 52, PROTOCOL_IS_LSB_FIRST,
+ 0, 0);
+#endif
delay(DELAY_AFTER_SEND);
Serial.println(F("Send ASCII 7 bit PulseDistanceWidth LSB first"));
@@ -285,7 +263,6 @@ void loop() {
uint32_t tData = (uint32_t) sAddress << 7 | (sCommand & 0x7F);
IrSender.sendPulseDistanceWidth(38, 2400, 600, 1200, 600, 600, 600, tData, SIRCS_12_PROTOCOL, PROTOCOL_IS_LSB_FIRST, 0, 0);
delay(DELAY_AFTER_SEND);
-#endif // FLASHEND >= 0x3FFF ...
Serial.println(F("Send 32 bit PulseWidth 0x87654321 LSB first"));
Serial.flush();
@@ -374,12 +351,7 @@ void loop() {
IrSender.sendRC6(sAddress, sCommand, sRepeats, true);
delay(DELAY_AFTER_SEND);
- Serial.println(F("Send RC6A with 14 bit 0x2711 as extra"));
- Serial.flush();
- IrSender.sendRC6A(sAddress & 0xFF, sCommand, sRepeats, 0x2711, true);
- delay(DELAY_AFTER_SEND);
-
-#if FLASHEND >= 0x3FFF && ((!defined(RAMEND) && !defined(RAMSIZE)) || (defined(RAMEND) && RAMEND > 0x4FF) || (defined(RAMSIZE) && RAMSIZE > 0x4FF)) // For 16k flash or more, like ATtiny1604. Code does not fit in program memory of ATtiny85 etc.
+#if FLASHEND >= 0x3FFF && ((defined(RAMEND) && RAMEND > 0x4FF) || (defined(RAMSIZE) && RAMSIZE > 0x4FF)) // For 16k flash or more, like ATtiny1604. Code does not fit in program memory of ATtiny85 etc.
Serial.println(F("Send MagiQuest"));
Serial.flush();
@@ -411,7 +383,7 @@ void loop() {
IrSender.write(&IRSendData, sRepeats);
delay(DELAY_AFTER_SEND);
- IRSendData.command = s16BitCommand; // LG support more than 8 bit command
+ IRSendData.command = s16BitCommand; // LG support more than 8 bit command
IRSendData.protocol = SAMSUNG;
Serial.print(F("Send "));
diff --git a/lib/IRremote/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h b/lib/IRremote/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/SendLGAirConditionerDemo/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/SendLGAirConditionerDemo/SendLGAirConditionerDemo.ino b/lib/IRremote/examples/SendLGAirConditionerDemo/SendLGAirConditionerDemo.ino
index a92e45e2..90511f28 100644
--- a/lib/IRremote/examples/SendLGAirConditionerDemo/SendLGAirConditionerDemo.ino
+++ b/lib/IRremote/examples/SendLGAirConditionerDemo/SendLGAirConditionerDemo.ino
@@ -67,12 +67,13 @@ 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)
- 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!
+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_IRREMOTE));
Serial.println(F("Send IR signals at pin " STR(IR_SEND_PIN)));
diff --git a/lib/IRremote/examples/SendProntoDemo/PinDefinitionsAndMore.h b/lib/IRremote/examples/SendProntoDemo/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/SendProntoDemo/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/SendProntoDemo/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/SendProntoDemo/SendProntoDemo.ino b/lib/IRremote/examples/SendProntoDemo/SendProntoDemo.ino
index e935d00c..d4893f03 100644
--- a/lib/IRremote/examples/SendProntoDemo/SendProntoDemo.ino
+++ b/lib/IRremote/examples/SendProntoDemo/SendProntoDemo.ino
@@ -59,11 +59,8 @@ IRsend irsend;
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 print out. Do not wait for an attached Serial Monitor!
-#endif
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
diff --git a/lib/IRremote/examples/SendRawDemo/PinDefinitionsAndMore.h b/lib/IRremote/examples/SendRawDemo/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/SendRawDemo/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/SendRawDemo/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/SendRawDemo/SendRawDemo.ino b/lib/IRremote/examples/SendRawDemo/SendRawDemo.ino
index 5b03a643..8e184751 100644
--- a/lib/IRremote/examples/SendRawDemo/SendRawDemo.ino
+++ b/lib/IRremote/examples/SendRawDemo/SendRawDemo.ino
@@ -52,6 +52,8 @@ 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)
diff --git a/lib/IRremote/examples/SimpleReceiver/PinDefinitionsAndMore.h b/lib/IRremote/examples/SimpleReceiver/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/SimpleReceiver/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/SimpleReceiver/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/SimpleReceiver/SimpleReceiver.ino b/lib/IRremote/examples/SimpleReceiver/SimpleReceiver.ino
index 95eaee8c..36d79a6f 100644
--- a/lib/IRremote/examples/SimpleReceiver/SimpleReceiver.ino
+++ b/lib/IRremote/examples/SimpleReceiver/SimpleReceiver.ino
@@ -9,7 +9,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2020-2025 Armin Joachimsmeyer
+ * Copyright (c) 2020-2023 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -43,7 +43,7 @@
//#define DECODE_KASEIKYO
//#define DECODE_PANASONIC // alias for DECODE_KASEIKYO
//#define DECODE_LG
-//#define DECODE_NEC // Includes Apple and Onkyo. To enable all protocols , just comment/disable this line.
+#define DECODE_NEC // Includes Apple and Onkyo. To enable all protocols , just comment/disable this line.
//#define DECODE_SAMSUNG
//#define DECODE_SONY
//#define DECODE_RC5
@@ -62,7 +62,7 @@
//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
-//#define RAW_BUFFER_LENGTH 750 // For air condition remotes it may require up to 750. Default is 200.
+//#define RAW_BUFFER_LENGTH 750 // For air condition remotes it requires 750. Default is 200.
/*
* This include defines the actual pin number for pins like IR_RECEIVE_PIN, IR_SEND_PIN for many different boards and architectures
@@ -72,6 +72,8 @@
void setup() {
Serial.begin(115200);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
@@ -102,11 +104,9 @@ void loop() {
Serial.println(F("Received noise or an unknown (or not yet enabled) protocol"));
// We have an unknown protocol here, print extended info
IrReceiver.printIRResultRawFormatted(&Serial, true);
-
IrReceiver.resume(); // Do it here, to preserve raw data for printing with printIRResultRawFormatted()
} else {
IrReceiver.resume(); // Early enable receiving of the next IR frame
-
IrReceiver.printIRResultShort(&Serial);
IrReceiver.printIRSendUsage(&Serial);
}
@@ -115,16 +115,10 @@ void loop() {
/*
* Finally, check the received data and perform actions according to the received command
*/
- if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_REPEAT) {
- Serial.println(F("Repeat received. Here you can repeat the same action as before."));
- } else {
- if (IrReceiver.decodedIRData.command == 0x10) {
- Serial.println(F("Received command 0x10."));
- // do something
- } else if (IrReceiver.decodedIRData.command == 0x11) {
- Serial.println(F("Received command 0x11."));
- // do something else
- }
+ if (IrReceiver.decodedIRData.command == 0x10) {
+ // do something
+ } else if (IrReceiver.decodedIRData.command == 0x11) {
+ // do something else
}
}
}
diff --git a/lib/IRremote/examples/SimpleReceiverForHashCodes/PinDefinitionsAndMore.h b/lib/IRremote/examples/SimpleReceiverForHashCodes/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/SimpleReceiverForHashCodes/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/SimpleReceiverForHashCodes/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/SimpleReceiverForHashCodes/SimpleReceiverForHashCodes.ino b/lib/IRremote/examples/SimpleReceiverForHashCodes/SimpleReceiverForHashCodes.ino
index 91819446..1766e7c3 100644
--- a/lib/IRremote/examples/SimpleReceiverForHashCodes/SimpleReceiverForHashCodes.ino
+++ b/lib/IRremote/examples/SimpleReceiverForHashCodes/SimpleReceiverForHashCodes.ino
@@ -32,18 +32,12 @@
#include <Arduino.h>
-#include "PinDefinitionsAndMore.h" // Define macros for input and output pin etc.
-
/*
* Specify which protocol(s) should be used for decoding.
* This must be done before the #include <IRremote.hpp>
*/
#define DECODE_HASH // special decoder for all protocols
-#if !defined(RAW_BUFFER_LENGTH)
-# if !((defined(RAMEND) && RAMEND <= 0x4FF) || (defined(RAMSIZE) && RAMSIZE < 0x4FF))
#define RAW_BUFFER_LENGTH 1000 // Especially useful for unknown and probably long protocols
-# endif
-#endif
//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
/*
@@ -54,6 +48,8 @@
void setup() {
Serial.begin(115200);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
@@ -85,17 +81,10 @@ void loop() {
* Finally, check the received data and perform actions according to the received command
*/
auto tDecodedRawData = IrReceiver.decodedIRData.decodedRawData; // uint32_t on 8 and 16 bit CPUs and uint64_t on 32 and 64 bit CPUs
- if (IrReceiver.decodedIRData.flags & IRDATA_FLAGS_IS_REPEAT) {
- Serial.println(F("Repeat received. Here you can repeat the same action as before."));
- } else {
- Serial.print(F("Raw data received are 0x"));
- Serial.println(tDecodedRawData);
-
- if (IrReceiver.decodedIRData.command == 0x10) {
- // do something
- } else if (IrReceiver.decodedIRData.command == 0x11) {
- // do something else
- }
+ if (tDecodedRawData == 0x4F7BE2FB) {
+ // do something
+ } else if (tDecodedRawData == 0x97483BFB) {
+ // do something else
}
}
}
diff --git a/lib/IRremote/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h b/lib/IRremote/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/SimpleReceiverWithCallback/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/SimpleReceiverWithCallback/SimpleReceiverWithCallback.ino b/lib/IRremote/examples/SimpleReceiverWithCallback/SimpleReceiverWithCallback.ino
index 5489dbc8..a857203f 100644
--- a/lib/IRremote/examples/SimpleReceiverWithCallback/SimpleReceiverWithCallback.ino
+++ b/lib/IRremote/examples/SimpleReceiverWithCallback/SimpleReceiverWithCallback.ino
@@ -59,7 +59,7 @@
//#define DEBUG // Activate this for lots of lovely debug output from the decoders.
-//#define RAW_BUFFER_LENGTH 750 // For air condition remotes it may require up to 750. Default is 200.
+//#define RAW_BUFFER_LENGTH 750 // For air condition remotes it requires 750. Default is 200.
#include <Arduino.h>
@@ -77,6 +77,8 @@ void ReceiveCompleteCallbackHandler();
void setup() {
Serial.begin(115200);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
diff --git a/lib/IRremote/examples/SimpleSender/PinDefinitionsAndMore.h b/lib/IRremote/examples/SimpleSender/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/SimpleSender/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/SimpleSender/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/SimpleSender/SimpleSender.ino b/lib/IRremote/examples/SimpleSender/SimpleSender.ino
index c6d97d62..d73b3748 100644
--- a/lib/IRremote/examples/SimpleSender/SimpleSender.ino
+++ b/lib/IRremote/examples/SimpleSender/SimpleSender.ino
@@ -3,9 +3,8 @@
*
* Demonstrates sending IR codes in standard format with address and command
* An extended example for sending can be found as SendDemo.
- * Sending IR codes using several pins for sending is implements in the MultipleSendPins example.
*
- * Copyright (C) 2020-2025 Armin Joachimsmeyer
+ * Copyright (C) 2020-2022 Armin Joachimsmeyer
*
* This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
@@ -30,6 +29,8 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_IRREMOTE));
diff --git a/lib/IRremote/examples/TinyReceiver/PinDefinitionsAndMore.h b/lib/IRremote/examples/TinyReceiver/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/TinyReceiver/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/TinyReceiver/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/TinyReceiver/TinyReceiver.ino b/lib/IRremote/examples/TinyReceiver/TinyReceiver.ino
index b31b4657..d8c440d4 100644
--- a/lib/IRremote/examples/TinyReceiver/TinyReceiver.ino
+++ b/lib/IRremote/examples/TinyReceiver/TinyReceiver.ino
@@ -67,7 +67,7 @@
* Set compile options to modify the generated code.
*/
//#define DISABLE_PARITY_CHECKS // Disable parity checks. Saves 48 bytes of program memory.
-//#define USE_CALLBACK_FOR_TINY_RECEIVER // Call the user provided function "void handleReceivedTinyIRData()" each time a frame or repeat is received.
+//#define USE_CALLBACK_FOR_TINY_RECEIVER // Call the fixed function "void handleReceivedTinyIRData()" each time a frame or repeat is received.
#include "TinyIRReceiver.hpp" // include the code
@@ -81,17 +81,13 @@
void setup() {
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)
- // 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 !!!
+ 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
#if defined(ESP8266) || defined(ESP32)
Serial.println();
diff --git a/lib/IRremote/examples/TinySender/PinDefinitionsAndMore.h b/lib/IRremote/examples/TinySender/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/TinySender/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/TinySender/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/TinySender/TinySender.ino b/lib/IRremote/examples/TinySender/TinySender.ino
index 4af49883..7a1fb343 100644
--- a/lib/IRremote/examples/TinySender/TinySender.ino
+++ b/lib/IRremote/examples/TinySender/TinySender.ino
@@ -54,6 +54,8 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
+ while (!Serial)
+ ; // Wait for Serial to become available. Is optimized away for some cores.
// Just to know which program is running on my Arduino
Serial.println(F("START " __FILE__ " from " __DATE__ "\r\nUsing library version " VERSION_TINYIR));
diff --git a/lib/IRremote/examples/UnitTest/PinDefinitionsAndMore.h b/lib/IRremote/examples/UnitTest/PinDefinitionsAndMore.h
index 907e2a64..37d57d93 100644
--- a/lib/IRremote/examples/UnitTest/PinDefinitionsAndMore.h
+++ b/lib/IRremote/examples/UnitTest/PinDefinitionsAndMore.h
@@ -35,15 +35,14 @@
* ATtiny167 9|PA3 8|PA2 5|PA7 Digispark original core
* ATtiny84 |PB2 |PA4 |PA3 ATTinyCore
* ATtiny88 3|PD3 4|PD4 9|PB1 ATTinyCore
- * ATtiny3216 14|PA1 15|PA2 16|PA3 MegaTinyCore
+ * ATtiny3217 18|PA1 19|PA2 20|PA3 MegaTinyCore
* ATtiny1604 2 3|PA5 %
* ATtiny816 14|PA1 16|PA3 1|PA5 MegaTinyCore
* ATtiny1614 8|PA1 10|PA3 1|PA5 MegaTinyCore
- * MKR* 1 3 4
- * SAMD 2 3 4
+ * SAMD21 3 4 5
* ESP8266 14|D5 12|D6 %
* ESP32 15 4 27
- * ESP32-C3 2 3 4
+ * ESP32-C3 6 7 10
* BluePill PA6 PA7 PA3
* APOLLO3 11 12 5
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -51,7 +50,7 @@
//#define _IR_MEASURE_TIMING // For debugging purposes.
#if defined(__AVR__)
-#if (defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) && defined(PIN_PB0) // Digispark board. For use with ATTinyCore.
+#if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) // Digispark board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // TX is at pin 2 - Available as Arduino library "ATtinySerialOut". Saves 700 bytes program memory and 70 bytes RAM for ATtinyCore.
#define IR_RECEIVE_PIN PIN_PB0
#define IR_SEND_PIN PIN_PB4 // Pin 2 is serial output with ATtinySerialOut. Pin 1 is internal LED and Pin3 is USB+ with pullup on Digispark board.
@@ -61,30 +60,28 @@
# elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__) // Digispark pro board
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut"
// For ATtiny167 Pins PB6 and PA3 are usable as interrupt source.
-# if defined(ARDUINO_AVR_DIGISPARKPRO)
+# if defined(ARDUINO_AVR_DIGISPARKPRO)
// For use with Digispark original core
#define IR_RECEIVE_PIN 9 // PA3 - on Digispark board labeled as pin 9
//#define IR_RECEIVE_PIN 14 // PB6 / INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN 8 // PA2 - on Digispark board labeled as pin 8
#define TONE_PIN 5 // PA7 - on Digispark board labeled as pin 5
#define _IR_TIMING_TEST_PIN 10 // PA4
-# elif !defined(PIN_PA3)
-#error ATtiny87 or ATtiny167 is not supported for the selected core. Please extend PinDefinitionsAndMore.h.
-# else
+# else
// For use with ATTinyCore
#define IR_RECEIVE_PIN PIN_PA3 // On Digispark board labeled as pin 9 - INT0 is connected to USB+ on DigisparkPro boards
#define IR_SEND_PIN PIN_PA2 // On Digispark board labeled as pin 8
#define TONE_PIN PIN_PA7 // On Digispark board labeled as pin 5
-# endif
+# endif
-# elif defined(__AVR_ATtiny84__) && defined(PIN_PB2) // For use with ATTinyCore
+# elif defined(__AVR_ATtiny84__) // For use with ATTinyCore
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
#define IR_RECEIVE_PIN PIN_PB2 // INT0
#define IR_SEND_PIN PIN_PA4
#define TONE_PIN PIN_PA3
#define _IR_TIMING_TEST_PIN PIN_PA5
-# elif defined(__AVR_ATtiny88__) && defined(PIN_PD3) // MH-ET Tiny88 board. For use with ATTinyCore.
+# elif defined(__AVR_ATtiny88__) // MH-ET Tiny88 board. For use with ATTinyCore.
#include "ATtinySerialOut.hpp" // Available as Arduino library "ATtinySerialOut". Saves 128 bytes program memory.
// Pin 6 is TX, pin 7 is RX
#define IR_RECEIVE_PIN PIN_PD3 // 3 - INT1
@@ -92,32 +89,32 @@
#define TONE_PIN PIN_PB1 // 9
#define _IR_TIMING_TEST_PIN PIN_PB0 // 8
-# elif (defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__) // For use with megaTinyCore
// Tiny Core Dev board
// https://www.tindie.com/products/xkimi/tiny-core-16-dev-board-attiny1616/ - Out of Stock
// https://www.tindie.com/products/xkimi/tiny-core-32-dev-board-attiny3217/ - Out of Stock
-#define IR_RECEIVE_PIN PIN_PA1 // 14 use 18 instead of PIN_PA1 for TinyCore32
-#define IR_SEND_PIN PIN_PA2 // 15, 19 for TinyCore32
-#define TONE_PIN PIN_PA3 // 16, 20 for TinyCore32
-#define APPLICATION_PIN PIN_PC3 // 13, PIN_PA0 is RESET
+#define IR_RECEIVE_PIN PIN_PA1 // use 18 instead of PIN_PA1 for TinyCore32
+#define IR_SEND_PIN PIN_PA2 // 19
+#define TONE_PIN PIN_PA3 // 20
+#define APPLICATION_PIN PIN_PA0 // 0
#undef LED_BUILTIN // No LED available on the TinyCore 32 board, take the one on the programming board which is connected to the DAC output
#define LED_BUILTIN PIN_PA6 // use 2 instead of PIN_PA6 for TinyCore32
-# elif defined(__AVR_ATtiny816__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny816__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 14
-#define IR_SEND_PIN PIN_PA3 // 16
+#define IR_SEND_PIN PIN_PA1 // 16
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
#undef LED_BUILTIN // No LED available, take the one which is connected to the DAC output
#define LED_BUILTIN PIN_PB5 // 4
-# elif defined(__AVR_ATtiny1614__) && defined(PIN_PA1) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1614__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA1 // 8
#define IR_SEND_PIN PIN_PA3 // 10
#define TONE_PIN PIN_PA5 // 1
#define APPLICATION_PIN PIN_PA4 // 0
-# elif defined(__AVR_ATtiny1604__) && defined(PIN_PA6) // For use with megaTinyCore
+# elif defined(__AVR_ATtiny1604__) // For use with megaTinyCore
#define IR_RECEIVE_PIN PIN_PA6 // 2 - To be compatible with interrupt example, pin 2 is chosen here.
#define IR_SEND_PIN PIN_PA7 // 3
#define APPLICATION_PIN PIN_PB2 // 5
@@ -175,32 +172,22 @@
#define tone(...) void() // tone() inhibits receive timer
#define noTone(a) void()
-#define TONE_PIN 42 // Dummy for examples using it#
-
-#elif defined(ARDUINO_NOLOGO_ESP32C3_SUPER_MINI)
-#define FEEDBACK_LED_IS_ACTIVE_LOW // The LED on my board (D8) is active LOW
-#define IR_RECEIVE_PIN 2
-#define IR_SEND_PIN 3
-#define TONE_PIN 4
-#define APPLICATION_PIN 10
+#define TONE_PIN 42 // Dummy for examples using it
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
#define NO_LED_FEEDBACK_CODE // The WS2812 on pin 8 of AI-C3 board crashes if used as receive feedback LED, other I/O pins are working...
#define IR_RECEIVE_PIN 6
#define IR_SEND_PIN 7
-#define TONE_PIN 9
-#define APPLICATION_PIN 10
+#define TONE_PIN 10
+#define APPLICATION_PIN 18
#elif defined(ESP32)
#include <Arduino.h>
// tone() is included in ESP32 core since 2.0.2
-# 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 !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 12345678
+#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){
@@ -223,7 +210,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 27 // D27 25 & 26 are DAC0 and 1
#define APPLICATION_PIN 16 // RX2 pin
-#elif (defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1)) && defined(PA6) // BluePill
+#elif defined(ARDUINO_ARCH_STM32) || defined(ARDUINO_ARCH_STM32F1) // BluePill
// Timer 3 blocks PA6, PA7, PB0, PB1 for use by Servo or tone()
#define IR_RECEIVE_PIN PA6
#define IR_RECEIVE_PIN_STRING "PA6"
@@ -265,7 +252,7 @@ void noTone(uint8_t aPinNumber){
#undef LED_BUILTIN
#define LED_BUILTIN 6
-#elif defined(PARTICLE) && defined(A4) // !!!UNTESTED!!!
+#elif defined(PARTICLE) // !!!UNTESTED!!!
#define IR_RECEIVE_PIN A4
#define IR_SEND_PIN A5 // Particle supports multiple pins
@@ -291,11 +278,7 @@ void noTone(uint8_t aPinNumber){
#define _IR_TIMING_TEST_PIN 7
#elif defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_SAM)
-# if defined(USE_ARDUINO_MKR_PIN_LAYOUT)
-#define IR_RECEIVE_PIN 1 // Pin 2 on MKR is not interrupt capable, see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/
-# else
#define IR_RECEIVE_PIN 2
-# endif
#define IR_SEND_PIN 3
#define TONE_PIN 4
#define APPLICATION_PIN 5
@@ -328,7 +311,7 @@ void noTone(uint8_t aPinNumber){
#define TONE_PIN 42 // Dummy for examples using it
#else
-#warning Board and Core / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
+#warning Board / CPU is not detected using pre-processor symbols -> using default values, which may not fit. Please extend PinDefinitionsAndMore.h.
// Default valued for unidentified boards
#define IR_RECEIVE_PIN 2
#define IR_SEND_PIN 3
diff --git a/lib/IRremote/examples/UnitTest/UnitTest.ino b/lib/IRremote/examples/UnitTest/UnitTest.ino
index a6ca7fcf..cce8f42e 100644
--- a/lib/IRremote/examples/UnitTest/UnitTest.ino
+++ b/lib/IRremote/examples/UnitTest/UnitTest.ino
@@ -9,7 +9,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2020-2025 Armin Joachimsmeyer
+ * Copyright (c) 2020-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -46,20 +46,13 @@
//#define EXCLUDE_UNIVERSAL_PROTOCOLS // Saves up to 1000 bytes program memory.
//#define EXCLUDE_EXOTIC_PROTOCOLS // Saves around 240 bytes program memory if IrSender.write is used
-//#define USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN // Reverses the polarity at the send pin.
-//#define USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN // Use or simulate open drain output mode at send pin. Attention, active state of open drain is LOW, so connect the send LED between positive supply and send pin!
//#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
//#define USE_NO_SEND_PWM // Use no carrier PWM, just simulate an active low receiver signal. Overrides SEND_PWM_BY_TIMER definition
-//#define USE_ACTIVE_HIGH_OUTPUT_FOR_NO_SEND_PWM // Simulate an active high receiver signal instead of an active low signal.
-#if FLASHEND <= 0x7FFF // For 32k flash or less, like ATmega328
#define NO_LED_FEEDBACK_CODE // Saves 344 bytes program memory
-#endif
-//#define USE_MSB_DECODING_FOR_DISTANCE_DECODER
-
// MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding,
-// to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 135.
-// 20 is taken as default if not otherwise specified / defined.
-//#define MARK_EXCESS_MICROS 40 // Adapt it to your IR receiver module. 40 is recommended for the cheap VS1838 modules at high intensity.
+//#define USE_MSB_DECODING_FOR_DISTANCE_DECODER
+// to compensate for the signal forming of different IR receiver modules. See also IRremote.hpp line 142.
+//#define MARK_EXCESS_MICROS 20 // Adapt it to your IR receiver module. 40 is taken for the cheap VS1838 module her, since we have high intensity.
//#define RECORD_GAP_MICROS 12000 // Default is 8000. Activate it for some LG air conditioner protocols.
@@ -91,16 +84,14 @@
//#define ENABLE_BEO_WITHOUT_FRAME_GAP // !!!For successful unit testing we must see the warning at ir_BangOlufsen.hpp:100:2!!!
#if defined(DECODE_BEO)
#define RECORD_GAP_MICROS 16000 // Force to get the complete frame including the 3. space of 15 ms in the receive buffer
-#define SUPPRESS_BEO_RECORD_GAP_MICROS_WARNING // We know, what we do here :-)
#define BEO_KHZ 38 // We send and receive Bang&Olufsen with 38 kHz here (instead of 455 kHz).
#endif
#define DECODE_BOSEWAVE
+//#define DECODE_LEGO_PF
#define DECODE_MAGIQUEST
-#define DECODE_FAST
-
//#define DECODE_WHYNTER
-//#define DECODE_LEGO_PF
+#define DECODE_FAST
#endif
//#undef IR_SEND_PIN // enable this, if you need to set send pin programmatically using uint8_t tSendPin below
@@ -125,25 +116,16 @@
volatile bool sDataJustReceived = false;
void ReceiveCompleteCallbackHandler();
-#if __INT_WIDTH__ < 32
-//IRRawDataType const tRawDataPGM[] PROGMEM = { 0xB02002, 0xA010 }; // LSB of tRawData[0] is sent first
-uint8_t const tRawDataPGM[] PROGMEM = { 0x02, 0x20, 0xB0, 0x00, /*0xB02002*/
-0x10, 0xA0, 0x0, 0x0, /*0xA010*/}; // Define tRawDataPGM as byte array of same size with same content as { 0xB02002, 0xA010}
-#endif
-
void setup() {
pinMode(DEBUG_BUTTON_PIN, INPUT_PULLUP);
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)
- // 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 !!!
+ 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_IRREMOTE));
@@ -160,14 +142,6 @@ void setup() {
Serial.println(F("at pin " STR(IR_RECEIVE_PIN)));
#endif
-#if defined(LED_BUILTIN) && !defined(NO_LED_FEEDBACK_CODE)
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- Serial.print(F("Active low "));
-# endif
- Serial.print(F("FeedbackLED at pin "));
- Serial.println(LED_BUILTIN); // Works also for ESP32: static const uint8_t LED_BUILTIN = 8; #define LED_BUILTIN LED_BUILTIN
-#endif
-
Serial.println(F("Use ReceiveCompleteCallback"));
Serial.println(F("Receive buffer length is " STR(RAW_BUFFER_LENGTH)));
@@ -181,7 +155,7 @@ void setup() {
#else
// Here the macro IR_SEND_PIN is not defined or undefined above with #undef IR_SEND_PIN
uint8_t tSendPin = 3;
- IrSender.begin(tSendPin, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN);// Specify send pin and enable feedback LED at default feedback LED pin
+ IrSender.begin(tSendPin, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN); // Specify send pin and enable feedback LED at default feedback LED pin
// You can change send pin later with IrSender.setSendPin();
Serial.print(F("Send IR signals at pin "));
@@ -416,13 +390,10 @@ void loop() {
IrSender.sendNEC(sAddress & 0xFF, sCommand, 0);
checkReceive(sAddress & 0xFF, sCommand);
- /*
- * Complete NEC frames as repeats to force decoding as NEC2 are tested here
- */
for (int8_t i = 0; i < sRepeats; i++) {
if (digitalRead(DEBUG_BUTTON_PIN) != LOW) {
- // If debug is enabled, printing time (50 ms) is sufficient as delay
- delayMicroseconds(NEC_REPEAT_DISTANCE - 20000); // 20000 is just a guess
+ // if debug is enabled, printing time (50 ms) is too high anyway
+ delayMicroseconds(NEC_REPEAT_DISTANCE - 200); // 200 is just a guess
}
IrSender.sendNEC(sAddress & 0xFF, sCommand, 0);
checkReceive(sAddress & 0xFF, sCommand);
@@ -445,9 +416,7 @@ void loop() {
#if FLASHEND >= 0x3FFF // For 16k flash or more, like ATtiny1604. Code does not fit in program memory of ATtiny85 etc.
if (sAddress == 0xFFF1) {
-# if FLASHEND >= 0x7FFF && ((!defined(RAMEND) && !defined(RAMSIZE)) || (defined(RAMEND) && RAMEND > 0x6FF) || (defined(RAMSIZE) && RAMSIZE > 0x6FF)) // For 32k flash or more, like Uno. Code does not fit in program memory of ATtiny1604 etc.
- IRRawDataType tRawData[4];
-
+# if FLASHEND >= 0x7FFF && ((defined(RAMEND) && RAMEND <= 0x6FF) || (defined(RAMSIZE) && RAMSIZE < 0x6FF)) // For 32k flash or more, like Uno. Code does not fit in program memory of ATtiny1604 etc.
/*
* Send constant values only once in this demo
*/
@@ -497,79 +466,80 @@ void loop() {
IrSender.sendNECMSB(0x40802CD3, 32, false);
checkReceive(0x0102, 0x34);
delay(DELAY_AFTER_SEND);
+# endif
-# if defined(DECODE_PANASONIC) || defined(DECODE_KASEIKYO)
- Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance PGM using ProtocolConstants"));
+# if defined(DECODE_PANASONIC) || defined(DECODE_KASEIKYO)
+ Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance using ProtocolConstants"));
Serial.flush();
-# if __INT_WIDTH__ < 32
- IrSender.sendPulseDistanceWidthFromPGMArray_P(&KaseikyoProtocolConstants, (IRRawDataType*) &tRawDataPGM[0], 48, NO_REPEATS); // Panasonic is a Kaseikyo variant
+# if __INT_WIDTH__ < 32
+ IRRawDataType tRawData[4] = { 0xB02002, 0xA010, 0x0, 0x0 }; // LSB of tRawData[0] is sent first
+ IrSender.sendPulseDistanceWidthFromArray(&KaseikyoProtocolConstants, &tRawData[0], 48, NO_REPEATS); // Panasonic is a Kaseikyo variant
checkReceive(0x0B, 0x10);
-# else
- IrSender.sendPulseDistanceWidth_P(&KaseikyoProtocolConstants, 0xA010B02002, 48, NO_REPEATS); // Panasonic is a Kaseikyo variant
+# else
+ IrSender.sendPulseDistanceWidth(&KaseikyoProtocolConstants, 0xA010B02002, 48, NO_REPEATS); // Panasonic is a Kaseikyo variant
checkReceivedRawData(0xA010B02002);
-# endif
+# endif
delay(DELAY_AFTER_SEND);
/*
* Send 2 Panasonic 48 bit codes as Pulse Distance data, once with LSB and once with MSB first
*/
- Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance PGM"));
+ Serial.println(F("Send Panasonic 0xB, 0x10 as 48 bit PulseDistance"));
Serial.println(F("-LSB first"));
Serial.flush();
-# if __INT_WIDTH__ < 32
- IrSender.sendPulseDistanceWidthFromPGMArray(38, 3450, 1700, 450, 1250, 450, 400, (IRRawDataType*) tRawDataPGM, 48,
- PROTOCOL_IS_LSB_FIRST, 0, NO_REPEATS);
- checkReceive(0x0B, 0x10);
-# else
- IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0xA010B02002, 48, PROTOCOL_IS_LSB_FIRST, 0,
+# if __INT_WIDTH__ < 32
+ IrSender.sendPulseDistanceWidthFromArray(38, 3450, 1700, 450, 1250, 450, 400, &tRawData[0], 48, PROTOCOL_IS_LSB_FIRST, 0,
NO_REPEATS);
+ checkReceive(0x0B, 0x10);
+# else
+ IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0xA010B02002, 48, PROTOCOL_IS_LSB_FIRST,
+ 0, NO_REPEATS);
checkReceivedRawData(0xA010B02002);
-# endif
+# endif
delay(DELAY_AFTER_SEND);
// The same with MSB first. Use bit reversed raw data of LSB first part
Serial.println(F("-MSB first"));
-# if __INT_WIDTH__ < 32
+# if __INT_WIDTH__ < 32
tRawData[0] = 0x40040D00; // MSB of tRawData[0] is sent first
tRawData[1] = 0x805;
IrSender.sendPulseDistanceWidthFromArray(38, 3450, 1700, 450, 1250, 450, 400, &tRawData[0], 48, PROTOCOL_IS_MSB_FIRST, 0,
NO_REPEATS);
checkReceive(0x0B, 0x10);
-# else
- IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0x40040D000805, 48, PROTOCOL_IS_MSB_FIRST, 0,
- NO_REPEATS);
+# else
+ IrSender.sendPulseDistanceWidth(38, 3450, 1700, 450, 1250, 450, 400, 0x40040D000805, 48, PROTOCOL_IS_MSB_FIRST, 0, NO_REPEATS);
checkReceivedRawData(0x40040D000805);
-# endif
+# endif
delay(DELAY_AFTER_SEND);
-# endif // defined(DECODE_PANASONIC) || defined(DECODE_KASEIKYO)
+# endif // defined(DECODE_PANASONIC) || defined(DECODE_KASEIKYO)
-# if defined(DECODE_DISTANCE_WIDTH)
-# if defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
+# if defined(DECODE_DISTANCE_WIDTH)
+# if defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
Serial.println(F("Send 52 bit PulseDistance 0x43D8613C and 0x3BC3B MSB first"));
Serial.flush();
-# if __INT_WIDTH__ < 32
+# if __INT_WIDTH__ < 32
tRawData[0] = 0x43D8613C; // MSB of tRawData[0] is sent first
tRawData[1] = 0x3BC3B;
IrSender.sendPulseDistanceWidthFromArray(38, 8900, 4450, 550, 1700, 550, 600, &tRawData[0], 52, PROTOCOL_IS_MSB_FIRST, 0,
- NO_REPEATS);
+ NO_REPEATS);
checkReceivedArray(tRawData, 2);
-# else
+# else
IrSender.sendPulseDistanceWidth(38, 8900, 4450, 550, 1700, 550, 600, 0x43D8613CBC3B, 52, PROTOCOL_IS_MSB_FIRST, 0, NO_REPEATS);
checkReceivedRawData(0x43D8613CBC3B);
-# endif
+# endif
delay(DELAY_AFTER_SEND);
Serial.println(F("Send 52 bit PulseDistanceWidth 0x43D8613C and 0x3BC3B MSB first"));
Serial.flush();
// Real PulseDistanceWidth (constant bit length) does not require a stop bit
-# if __INT_WIDTH__ < 32
+# if __INT_WIDTH__ < 32
IrSender.sendPulseDistanceWidthFromArray(38, 300, 600, 600, 300, 300, 600, &tRawData[0], 52, PROTOCOL_IS_MSB_FIRST, 0, 0);
checkReceivedArray(tRawData, 2);
-# else
+# else
IrSender.sendPulseDistanceWidth(38, 300, 600, 600, 300, 300, 600, 0x123456789ABC, 52, PROTOCOL_IS_MSB_FIRST, 0, 0);
checkReceivedRawData(0x123456789ABC);
-# endif
+# endif
delay(DELAY_AFTER_SEND);
Serial.println(F("Send 32 bit PulseWidth 0x43D8613C MSB first"));
Serial.flush();
@@ -578,52 +548,50 @@ void loop() {
checkReceivedRawData(0x43D8613C);
delay(DELAY_AFTER_SEND);
-# else // defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
+# else // defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
Serial.println(F("Send 72 bit PulseDistance 0x5A AFEDCBA9 87654321 LSB first"));
Serial.flush();
-# if __INT_WIDTH__ < 32
+# if __INT_WIDTH__ < 32
tRawData[0] = 0x87654321; // LSB of tRawData[0] is sent first
tRawData[1] = 0xAFEDCBA9;
tRawData[2] = 0x5A;
IrSender.sendPulseDistanceWidthFromArray(38, 8900, 4450, 550, 1700, 550, 600, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, 0,
NO_REPEATS);
checkReceivedArray(tRawData, 3);
-# else
- tRawData[0] = 0xAFEDCBA987654321;
- tRawData[1] = 0x5A; // LSB of tRawData[0] is sent first
- IrSender.sendPulseDistanceWidthFromArray(38, 8900, 4450, 550, 1700, 550, 600, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, 0,
- NO_REPEATS);
+# else
+ IRRawDataType tRawData[] = { 0xAFEDCBA987654321, 0x5A }; // LSB of tRawData[0] is sent first
+ IrSender.sendPulseDistanceWidthFromArray(38, 8900, 4450, 550, 1700, 550, 600, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, 0, NO_REPEATS);
checkReceivedArray(tRawData, 2);
-# endif
+# endif
delay(DELAY_AFTER_SEND);
Serial.println(F("Send 52 bit PulseDistanceWidth 0xDCBA9 87654321 LSB first"));
Serial.flush();
// Real PulseDistanceWidth (constant bit length) does theoretically not require a stop bit, but we know the stop bit from serial transmission
-# if __INT_WIDTH__ < 32
+# if __INT_WIDTH__ < 32
tRawData[1] = 0xDCBA9;
IrSender.sendPulseDistanceWidthFromArray(38, 300, 600, 300, 600, 600, 300, &tRawData[0], 52, PROTOCOL_IS_LSB_FIRST, 0, 0);
checkReceivedArray(tRawData, 2);
-# else
+# else
IrSender.sendPulseDistanceWidth(38, 300, 600, 300, 600, 600, 300, 0xDCBA987654321, 52, PROTOCOL_IS_LSB_FIRST, 0, 0);
checkReceivedRawData(0xDCBA987654321);
-# endif
+# endif
delay(DELAY_AFTER_SEND);
Serial.println(F("Send 52 bit PulseDistanceWidth 0xDCBA9 87654321 LSB first with inverse timing and data"));
Serial.flush();
-# if __INT_WIDTH__ < 32
+# if __INT_WIDTH__ < 32
tRawData[2] = ~tRawData[0];
tRawData[3] = ~tRawData[1];
IrSender.sendPulseDistanceWidthFromArray(38, 300, 600, 600, 300, 300, 600, &tRawData[2], 52, PROTOCOL_IS_LSB_FIRST, 0, 0);
checkReceivedArray(tRawData, 2);
-# else
+# else
IrSender.sendPulseDistanceWidth(38, 300, 600, 600, 300, 300, 600, ~0xDCBA987654321, 52, PROTOCOL_IS_LSB_FIRST, 0, 0);
checkReceivedRawData(0xDCBA987654321);
-# endif
+# endif
delay(DELAY_AFTER_SEND);
- Serial.println(F("Send 7 bit ASCII character with PulseDistanceWidth LSB first"));
+ Serial.println(F("Send ASCII 7 bit PulseDistanceWidth LSB first"));
Serial.flush();
// Real PulseDistanceWidth (constant bit length) does theoretically not require a stop bit, but we know the stop bit from serial transmission
IrSender.sendPulseDistanceWidth(38, 6000, 500, 500, 1500, 1500, 500, sCommand, 7, PROTOCOL_IS_LSB_FIRST, 0, 0);
@@ -643,18 +611,16 @@ void loop() {
checkReceivedRawData(0x87654321);
delay(DELAY_AFTER_SEND);
-# endif // defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
-# endif // defined(DECODE_DISTANCE_WIDTH)
-# endif // if FLASHEND >= 0x7FFF ...
+# endif // defined(USE_MSB_DECODING_FOR_DISTANCE_DECODER)
+# endif // defined(DECODE_DISTANCE_WIDTH)
# if defined(DECODE_MAGIQUEST)
Serial.println(F("Send MagiQuest 0x6BCDFF00, 0x176 as 55 bit PulseDistanceWidth MSB first"));
Serial.flush();
# if __INT_WIDTH__ < 32
- IRRawDataType tRawData1[2];
- tRawData1[0] = 0x01AF37FC; // We have 1 header (start) bit and 7 start bits and 31 address bits for MagiQuest, so 0x6BCDFF00 is shifted 2 left
- tRawData1[1] = 0x017619; // We send only 23 bits here! 0x19 is the checksum
- IrSender.sendPulseDistanceWidthFromArray(38, 287, 864, 576, 576, 287, 864, &tRawData1[0], 55,
+ tRawData[0] = 0x01AF37FC; // We have 1 header (start) bit and 7 start bits and 31 address bits for MagiQuest, so 0x6BCDFF00 is shifted 2 left
+ tRawData[1] = 0x017619; // We send only 23 bits here! 0x19 is the checksum
+ IrSender.sendPulseDistanceWidthFromArray(38, 287, 864, 576, 576, 287, 864, &tRawData[0], 55,
PROTOCOL_IS_MSB_FIRST | SUPPRESS_STOP_BIT, 0, 0);
# else
// 0xD79BFE00 is 0x6BCDFF00 is shifted 1 left
@@ -779,18 +745,11 @@ void loop() {
#if defined(DECODE_RC6)
Serial.println(F("Send RC6"));
+ // RC6 check does not work stable without the flush
Serial.flush();
- sLastSendToggleValue = sAddress & 0x01; // to modify toggling at each loop
-
IrSender.sendRC6(sAddress & 0xFF, sCommand, 0, true);
checkReceive(sAddress & 0xFF, sCommand);
delay(DELAY_AFTER_SEND);
-
- Serial.println(F("Send RC6A with 14 bit 0x2711 as extra"));
- Serial.flush();
- IrSender.sendRC6A(sAddress & 0xFF, sCommand, 0, 0x2711, true);
- checkReceive(sAddress & 0xFF, sCommand);
- delay(DELAY_AFTER_SEND);
#endif
#if defined(DECODE_BEO)
@@ -901,9 +860,9 @@ void loop() {
* Force buffer overflow
*/
Serial.println(F("Force buffer overflow by sending 450 marks and spaces"));
- for (unsigned int i = 0; i < 225; ++i) { // 225 because we send 2 entries per loop
- // 210 + 540 = 750 should be received as 5/10 or 4/11 if compensation by MARK_EXCESS_MICROS is optimal.
+ for (unsigned int i = 0; i < 225; ++i) {
// 400 + 400 should be received as 8/8 and sometimes as 9/7 or 7/9 if compensation by MARK_EXCESS_MICROS is optimal.
+ // 210 + 540 = 750 should be received as 5/10 or 4/11 if compensation by MARK_EXCESS_MICROS is optimal.
IrSender.mark(210); // 8 pulses at 38 kHz
IrSender.space(540); // to fill up to 750 us
}
@@ -922,14 +881,6 @@ void loop() {
if (sRepeats > 4) {
sRepeats = 4;
}
-
- /*
- * Test stop and start of 50 us receiver timer
- */
- Serial.println(F("Stop receiver"));
- IrReceiver.stop();
delay(DELAY_AFTER_LOOP); // additional delay at the end of each loop
- Serial.println(F("Start receiver"));
- IrReceiver.start(); // For ESP32 timerEnableReceiveInterrupt() is sufficient here, since timer is not reconfigured by another task
}
diff --git a/lib/IRremote/examples/UnitTest/UnitTest.log b/lib/IRremote/examples/UnitTest/UnitTest.log
index 4063d890..e96beb25 100644
--- a/lib/IRremote/examples/UnitTest/UnitTest.log
+++ b/lib/IRremote/examples/UnitTest/UnitTest.log
@@ -12,129 +12,129 @@ Send signal mark duration for 38kHz is 8 us, pulse narrowing correction is 3000
address=0xFFF1 command=0x76
Send NEC with 8 bit address
-Protocol=NEC Address=0xF1 Command=0x76 Raw-Data=0x89760EF1 32 bits LSB first Duration=67850 us
+Protocol=NEC Address=0xF1 Command=0x76 Raw-Data=0x89760EF1 32 bits LSB first
Send with: IrSender.sendNEC(0xF1, 0x76, <numberOfRepeats>);
-rawData[68]:
+rawData[68]:
-1049200
- +8950,-4350
- + 650,-1600 + 650,- 500 + 600,- 500 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,-1600
- + 650,- 500 + 600,-1600 + 650,-1600 + 650,-1600
- + 600,- 500 + 650,- 500 + 600,- 500 + 650,- 500
- + 600,- 500 + 650,-1600 + 650,-1600 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,- 500
- + 600,-1650 + 600,- 500 + 650,- 500 + 600,-1600
- + 650,- 500 + 650,- 500 + 600,- 500 + 650,-1600
- + 650
-Duration=67850 us
+ +8900,-445
+ + 600,-1600 + 600,- 550 + 600,- 500 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,-1650
+ + 600,- 550 + 600,-1600 + 600,-1650 + 600,-1650
+ + 600,- 500 + 600,- 550 + 600,- 500 + 600,- 550
+ + 600,- 500 + 600,-1650 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600,-1650 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1650
+ + 600
+Sum: 67800
Send NEC with 16 bit address
-Protocol=NEC Address=0xFFF1 Command=0x76 Raw-Data=0x8976FFF1 32 bits LSB first Duration=73350 us
+Protocol=NEC Address=0xFFF1 Command=0x76 Raw-Data=0x8976FFF1 32 bits LSB first
Send with: IrSender.sendNEC(0xFFF1, 0x76, <numberOfRepeats>);
-rawData[68]:
- -1060600
- +8950,-4400
- + 600,-1600 + 650,- 500 + 650,- 450 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,-1600
- + 650,-1600 + 600,-1600 + 650,-1600 + 650,-1600
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,-1600
- + 600,- 500 + 650,-1600 + 650,-1600 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,- 500
- + 600,-1600 + 650,- 500 + 600,- 500 + 650,-1600
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,-1600
- + 650
-Duration=73350 us
+rawData[68]:
+ -1058500
+ +8950,-4450
+ + 550,-1650 + 600,- 500 + 600,- 550 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1650
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,-1600
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1650
+ + 600,- 500 + 600,-1650 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1600
+ + 600
+Sum: 73350
Send NEC2 with 16 bit address
-Protocol=NEC Address=0xFFF1 Command=0x76 Raw-Data=0x8976FFF1 32 bits LSB first Duration=73400 us
+Protocol=NEC Address=0xFFF1 Command=0x76 Raw-Data=0x8976FFF1 32 bits LSB first
Send with: IrSender.sendNEC(0xFFF1, 0x76, <numberOfRepeats>);
-rawData[68]:
- -1061100
+rawData[68]:
+ -1059050
+8950,-4400
- + 650,-1600 + 650,- 500 + 600,- 500 + 650,- 500
- + 650,-1600 + 600,-1600 + 650,-1600 + 650,-1600
- + 650,-1600 + 600,-1650 + 600,-1600 + 650,-1600
- + 650,-1600 + 650,-1600 + 600,-1600 + 650,-1600
- + 600,- 500 + 650,-1600 + 650,-1600 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 600,- 500
- + 650,-1600 + 650,- 500 + 600,- 500 + 650,-1600
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,-1600
- + 650
-Duration=73400 us
+ + 600,-1600 + 600,- 550 + 600,- 550 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1600
+ + 600,-1650 + 600,-1650 + 600,-1600 + 650,-1600
+ + 600,-1650 + 600,-1650 + 600,-1600 + 650,-1600
+ + 600,- 550 + 600,-1600 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,- 550 + 600,- 550 + 600,-1600
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1600
+ + 600
+Sum: 73300
Send Panasonic 0xB, 0x10 as 48 bit PulseDistance using ProtocolConstants
-Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first Duration=54150 us
+Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first
Send with: IrSender.sendPanasonic(0xB, 0x10, <numberOfRepeats>);
-rawData[100]:
- -1064750
- +3500,-1650
- + 500,- 350 + 500,-1250 + 450,- 400 + 500,- 350
- + 500,- 400 + 450,- 400 + 500,- 350 + 500,- 400
- + 450,- 400 + 500,- 350 + 500,- 400 + 450,- 400
- + 500,- 350 + 500,-1250 + 500,- 350 + 500,- 400
- + 450,- 400 + 500,- 350 + 500,- 400 + 450,- 400
- + 500,-1200 + 500,-1250 + 450,- 400 + 500,-1250
- + 450,- 400 + 500,- 350 + 500,- 400 + 450,- 400
- + 500,- 400 + 450,- 400 + 500,- 350 + 500,- 400
- + 500,- 400 + 450,- 400 + 500,- 350 + 500,- 350
- + 500,-1250 + 500,- 350 + 500,- 400 + 500,- 350
- + 500,- 400 + 450,- 400 + 500,- 350 + 500,- 400
- + 500,- 350 + 500,-1250 + 450,- 400 + 500,-1250
+rawData[100]:
+ -1062700
+ +3450,-1700
+ + 450,- 450 + 450,-1250 + 450,- 400 + 500,- 400
+ + 450,- 400 + 450,- 450 + 450,- 400 + 450,- 450
+ + 450,- 400 + 450,- 400 + 450,- 450 + 450,- 400
+ + 450,- 400 + 500,-1250 + 450,- 400 + 500,- 400
+ + 450,- 400 + 450,- 450 + 450,- 400 + 450,- 400
+ + 500,-1250 + 450,-1250 + 450,- 450 + 450,-1250
+ + 450,- 400 + 450,- 450 + 450,- 400 + 450,- 400
+ + 500,- 400 + 450,- 400 + 450,- 400 + 500,- 400
+ + 450,- 400 + 500,- 400 + 450,- 400 + 450,- 400
+ + 500,-1250 + 450,- 400 + 450,- 400 + 450,- 450
+ + 450,- 400 + 450,- 400 + 450,- 450 + 450,- 400
+ + 450,- 400 + 500,-1250 + 450,- 400 + 500,-1250
+ 450
-Duration=54150 us
+Sum: 54150
Send Panasonic 0xB, 0x10 as 48 bit PulseDistance
-LSB first
-Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first Duration=53200 us
+Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first
Send with: IrSender.sendPanasonic(0xB, 0x10, <numberOfRepeats>);
-rawData[100]:
- -1081400
+rawData[100]:
+ -1079300
+3450,-1650
- + 550,- 300 + 500,-1200 + 500,- 350 + 500,- 350
+ + 500,- 350 + 500,-1200 + 500,- 350 + 500,- 350
+ + 500,- 350 + 500,- 350 + 500,- 350 + 500,- 350
+ 500,- 350 + 500,- 350 + 500,- 350 + 500,- 350
- + 500,- 350 + 500,- 350 + 550,- 300 + 500,- 350
+ 500,- 350 + 500,-1200 + 500,- 350 + 500,- 350
+ 500,- 350 + 500,- 350 + 500,- 350 + 500,- 350
+ 500,-1200 + 500,-1200 + 500,- 350 + 500,-1200
+ 500,- 350 + 500,- 350 + 500,- 350 + 500,- 350
- + 500,- 350 + 500,- 350 + 500,- 350 + 550,- 350
- + 500,- 350 + 500,- 350 + 500,- 350 + 500,- 300
- + 550,-1150 + 500,- 400 + 450,- 350 + 500,- 350
+ + 500,- 350 + 500,- 350 + 500,- 400 + 450,- 400
+ + 450,- 400 + 450,- 400 + 450,- 350 + 500,- 350
+ + 500,-1200 + 500,- 350 + 500,- 350 + 500,- 350
+ 500,- 350 + 500,- 350 + 500,- 350 + 500,- 350
- + 550,- 300 + 500,-1200 + 500,- 350 + 500,-1200
+ + 500,- 400 + 450,-1200 + 500,- 350 + 500,-1200
+ 500
-Duration=53200 us
+Sum: 53200
-MSB first
-Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first Duration=53200 us
+Protocol=Panasonic Address=0xB Command=0x10 Raw-Data=0xA01000B0 48 bits LSB first
Send with: IrSender.sendPanasonic(0xB, 0x10, <numberOfRepeats>);
-rawData[100]:
- -1076300
+rawData[100]:
+ -1074200
+3450,-1650
- + 500,- 350 + 550,-1150 + 500,- 400 + 500,- 300
- + 550,- 300 + 550,- 300 + 500,- 350 + 550,- 300
+ + 500,- 350 + 500,-1200 + 500,- 350 + 500,- 350
+ + 500,- 350 + 500,- 350 + 500,- 350 + 500,- 350
+ 500,- 350 + 500,- 350 + 500,- 350 + 500,- 350
+ 500,- 350 + 500,-1200 + 500,- 350 + 500,- 350
+ 500,- 350 + 500,- 350 + 500,- 350 + 500,- 350
+ 500,-1200 + 500,-1200 + 500,- 350 + 500,-1200
+ 500,- 350 + 500,- 350 + 500,- 350 + 500,- 350
- + 500,- 350 + 500,- 350 + 550,- 300 + 500,- 400
- + 500,- 350 + 500,- 350 + 500,- 350 + 500,- 300
+ + 500,- 350 + 500,- 350 + 500,- 350 + 500,- 400
+ + 450,- 400 + 450,- 400 + 450,- 400 + 450,- 350
+ 500,-1200 + 500,- 350 + 500,- 350 + 500,- 350
+ 500,- 350 + 500,- 350 + 500,- 350 + 500,- 350
- + 500,- 350 + 500,-1200 + 500,- 350 + 500,-1200
+ + 500,- 400 + 450,-1200 + 500,- 350 + 500,-1200
+ 500
-Duration=53200 us
+Sum: 53200
Send 72 bit PulseDistance 0x5A AFEDCBA9 87654321 LSB first
-Protocol=PulseDistance Raw-Data=0x5A 72 bits LSB first Duration=138400 us
-Send on a 8 bit platform with:
+Protocol=PulseDistance Raw-Data=0x5A 72 bits LSB first
+Send on a 8 bit platform with:
uint32_t tRawData[]={0x87654321, 0xAFEDCBA9, 0x5A};
- IrSender.sendPulseDistanceWidthFromArray(38, 8900, 4400, 600, 1650, 600, 550, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
-rawData[148]:
- -1081200
- +8900,-4400
- + 600,-1600 + 600,- 550 + 600,- 550 + 600,- 550
+ IrSender.sendPulseDistanceWidthFromArray(38, 8850, 4400, 600, 1650, 600, 550, &tRawData[0], 72, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
+rawData[148]:
+ -1079150
+ +8850,-4400
+ + 550,-1650 + 600,- 550 + 600,- 550 + 600,- 550
+ 600,- 550 + 600,-1650 + 600,- 550 + 600,- 550
+ 600,-1650 + 600,-1650 + 600,- 550 + 600,- 550
+ 600,- 550 + 600,- 550 + 600,-1650 + 600,- 550
@@ -142,105 +142,105 @@ rawData[148]:
+ 600,- 550 + 600,-1650 + 600,-1650 + 600,- 550
+ 600,-1650 + 600,-1650 + 600,-1650 + 600,- 550
+ 600,- 550 + 600,- 550 + 600,- 550 + 600,-1650
- + 650,-1600 + 600,- 550 + 600,- 550 + 600,-1650
+ + 600,-1650 + 600,- 550 + 600,- 550 + 600,-1650
+ 600,- 550 + 600,-1650 + 600,- 550 + 600,-1650
+ 600,-1650 + 600,-1650 + 600,- 550 + 600,-1650
+ 600,- 550 + 600,- 550 + 600,-1650 + 600,-1650
- + 550,-1700 + 600,- 550 + 600,-1650 + 600,-1650
+ + 600,-1650 + 600,- 550 + 600,-1650 + 600,-1650
+ 600,- 550 + 600,-1650 + 600,-1650 + 600,-1650
- + 550,-1650 + 600,-1650 + 600,-1650 + 600,-1650
+ + 600,-1650 + 550,-1650 + 600,-1650 + 600,-1650
+ 600,- 550 + 600,-1650 + 600,- 550 + 600,-1700
+ 550,- 550 + 600,-1650 + 600,- 550 + 600,-1650
+ 600,-1650 + 600,- 550 + 600,-1650 + 600,- 550
+ 600
-Duration=138400 us
+Sum: 138350
Send 52 bit PulseDistanceWidth 0xDCBA9 87654321 LSB first
-Protocol=PulseDistance Raw-Data=0xDCBA9 52 bits LSB first Duration=48250 us
-Send on a 8 bit platform with:
+Protocol=PulseDistance Raw-Data=0xDCBA9 52 bits LSB first
+Send on a 8 bit platform with:
uint32_t tRawData[]={0x87654321, 0xDCBA9};
- IrSender.sendPulseDistanceWidthFromArray(38, 350, 550, 350, 550, 650, 250, &tRawData[0], 52, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
-rawData[108]:
- -1118250
- + 350,- 550
- + 400,- 500 + 700,- 200 + 650,- 250 + 700,- 200
- + 650,- 250 + 400,- 550 + 650,- 250 + 650,- 250
- + 350,- 550 + 350,- 550 + 650,- 250 + 650,- 250
- + 650,- 250 + 650,- 200 + 400,- 550 + 650,- 200
- + 400,- 550 + 650,- 200 + 400,- 550 + 650,- 200
- + 700,- 200 + 400,- 550 + 350,- 550 + 650,- 250
+ IrSender.sendPulseDistanceWidthFromArray(38, 300, 600, 350, 550, 650, 250, &tRawData[0], 52, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
+rawData[108]:
+ -1116150
+ + 300,- 600
+ + 350,- 550 + 650,- 250 + 650,- 250 + 650,- 250
+ + 650,- 250 + 350,- 550 + 650,- 250 + 650,- 250
+ + 350,- 600 + 300,- 600 + 650,- 250 + 650,- 250
+ + 650,- 250 + 650,- 250 + 350,- 550 + 650,- 250
+ + 350,- 600 + 600,- 250 + 350,- 600 + 600,- 250
+ + 650,- 250 + 350,- 600 + 350,- 550 + 600,- 300
+ 350,- 550 + 350,- 550 + 350,- 550 + 650,- 250
- + 650,- 250 + 650,- 250 + 650,- 250 + 350,- 550
- + 400,- 550 + 650,- 250 + 650,- 200 + 400,- 500
- + 700,- 200 + 400,- 550 + 650,- 250 + 350,- 550
- + 350,- 550 + 350,- 550 + 650,- 250 + 400,- 500
- + 700,- 250 + 650,- 250 + 350,- 550 + 350,- 550
- + 350,- 550 + 650,- 250 + 350,- 550 + 350,- 550
- + 400
-Duration=48250 us
+ + 650,- 250 + 650,- 250 + 650,- 250 + 350,- 600
+ + 350,- 550 + 650,- 250 + 650,- 250 + 350,- 550
+ + 650,- 250 + 350,- 600 + 600,- 300 + 350,- 550
+ + 350,- 550 + 350,- 550 + 650,- 250 + 350,- 550
+ + 650,- 250 + 650,- 250 + 350,- 550 + 350,- 600
+ + 350,- 550 + 600,- 300 + 350,- 550 + 350,- 550
+ + 350
+Sum: 48300
Send 52 bit PulseDistanceWidth 0xDCBA9 87654321 LSB first with inverse timing and data
-Protocol=PulseDistance Raw-Data=0xDCBA9 52 bits LSB first Duration=48500 us
-Send on a 8 bit platform with:
+Protocol=PulseDistance Raw-Data=0xDCBA9 52 bits LSB first
+Send on a 8 bit platform with:
uint32_t tRawData[]={0x87654321, 0xDCBA9};
- IrSender.sendPulseDistanceWidthFromArray(38, 350, 550, 350, 550, 650, 250, &tRawData[0], 52, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
-rawData[108]:
- -1097950
+ IrSender.sendPulseDistanceWidthFromArray(38, 350, 550, 350, 550, 600, 300, &tRawData[0], 52, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
+rawData[108]:
+ -1095900
+ 350,- 550
- + 400,- 500 + 650,- 250 + 650,- 250 + 650,- 250
- + 650,- 250 + 400,- 500 + 700,- 200 + 700,- 250
- + 350,- 550 + 350,- 550 + 650,- 250 + 650,- 250
- + 650,- 250 + 650,- 250 + 350,- 550 + 650,- 250
- + 350,- 550 + 650,- 250 + 350,- 550 + 650,- 250
- + 650,- 250 + 400,- 550 + 350,- 500 + 650,- 250
- + 400,- 500 + 400,- 500 + 400,- 550 + 650,- 250
- + 650,- 200 + 700,- 200 + 650,- 250 + 400,- 550
- + 400,- 500 + 650,- 250 + 650,- 250 + 400,- 550
- + 600,- 250 + 400,- 500 + 650,- 250 + 400,- 550
+ + 350,- 550 + 650,- 250 + 650,- 250 + 650,- 250
+ + 650,- 250 + 350,- 600 + 600,- 300 + 600,- 300
+ + 350,- 550 + 350,- 550 + 600,- 300 + 600,- 300
+ + 600,- 300 + 600,- 300 + 300,- 600 + 600,- 300
+ + 350,- 550 + 600,- 300 + 350,- 550 + 600,- 300
+ + 600,- 300 + 350,- 550 + 350,- 550 + 650,- 250
+ + 350,- 550 + 350,- 600 + 300,- 600 + 600,- 300
+ + 600,- 300 + 600,- 250 + 650,- 300 + 300,- 600
+ + 350,- 550 + 650,- 250 + 650,- 250 + 350,- 600
+ + 600,- 300 + 350,- 550 + 600,- 300 + 350,- 550
+ 350,- 550 + 350,- 550 + 650,- 250 + 350,- 550
+ 650,- 250 + 650,- 250 + 350,- 550 + 350,- 550
- + 350,- 550 + 650,- 250 + 350,- 550 + 400,- 500
- + 650
-Duration=48500 us
-
-Send 7 bit ASCII character with PulseDistanceWidth LSB first
-Protocol=PulseDistance Raw-Data=0x76 7 bits LSB first Duration=20950 us
-Send on a 8 bit platform with: IrSender.sendPulseDistanceWidth(38, 6000, 450, 550, 1450, 1550, 450, 0x76, 7, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
-rawData[18]:
- -1095750
- +6000,- 450
- +1550,- 450 + 550,-1400 + 550,-1450 +1550,- 450
+ + 350,- 600 + 600,- 250 + 400,- 550 + 300,- 600
+ + 600
+Sum: 48500
+
+Send ASCII 7 bit PulseDistanceWidth LSB first
+Protocol=PulseDistance Raw-Data=0x76 7 bits LSB first
+Send on a 8 bit platform with: IrSender.sendPulseDistanceWidth(38, 5950, 500, 550, 1450, 1550, 500, 0x76, 7, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
+rawData[18]:
+ -1092450
+ +5950,- 500
+ +1500,- 500 + 500,-1450 + 550,-1450 +1550,- 450
+ 550,-1450 + 550,-1450 + 550,-1450 + 550
-Duration=20950 us
+Sum: 20950
Send Sony12 as PulseWidth LSB first
-Protocol=Sony Address=0x11 Command=0x76 Raw-Data=0x8F6 12 bits LSB first Duration=21050 us
+Protocol=Sony Address=0x11 Command=0x76 Raw-Data=0x8F6 12 bits LSB first
Send with: IrSender.sendSony(0x11, 0x76, 2, 12);
-rawData[26]:
- -1038650
- +2500,- 500
- + 700,- 500 +1250,- 550 +1250,- 550 + 650,- 550
+rawData[26]:
+ -1036550
+ +2450,- 600
+ + 600,- 550 +1250,- 550 +1250,- 550 + 650,- 550
+1250,- 550 +1250,- 550 +1250,- 550 +1250,- 550
+ 650,- 550 + 650,- 550 + 650,- 550 +1250
-Duration=21050 us
+Sum: 21050
Send 32 bit PulseWidth 0x87654321 LSB first
-Protocol=PulseWidth Raw-Data=0x87654321 32 bits LSB first Duration=24650 us
-Send on a 8 bit platform with: IrSender.sendPulseDistanceWidth(38, 1100, 450, 650, 250, 350, 250, 0x87654321, 32, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
-rawData[66]:
- -1038250
- +1100,- 450
- + 600,- 300 + 350,- 250 + 350,- 250 + 400,- 200
- + 400,- 250 + 600,- 300 + 350,- 250 + 350,- 250
- + 650,- 250 + 650,- 250 + 400,- 250 + 350,- 250
- + 350,- 250 + 400,- 200 + 650,- 250 + 400,- 250
- + 650,- 250 + 350,- 250 + 650,- 250 + 350,- 250
- + 350,- 250 + 650,- 250 + 700,- 200 + 400,- 250
- + 650,- 200 + 700,- 200 + 700,- 200 + 400,- 250
- + 350,- 250 + 350,- 250 + 400,- 200 + 700
-Duration=24650 us
-
-Send MagiQuest 0x6BCDFF00, 0x176 as 55 bit PulseDistanceWidth MSB first Duration=63850 us
+Protocol=PulseWidth Raw-Data=0x87654321 32 bits LSB first
+Send on a 8 bit platform with: IrSender.sendPulseDistanceWidth(38, 1050, 500, 650, 250, 350, 250, 0x87654321, 32, PROTOCOL_IS_LSB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>);
+rawData[66]:
+ -1036150
+ +1050,- 500
+ + 600,- 300 + 350,- 250 + 350,- 250 + 350,- 250
+ + 350,- 300 + 600,- 300 + 350,- 250 + 350,- 250
+ + 650,- 250 + 650,- 250 + 350,- 300 + 350,- 250
+ + 350,- 250 + 350,- 300 + 600,- 300 + 300,- 300
+ + 600,- 300 + 350,- 250 + 600,- 300 + 350,- 250
+ + 350,- 250 + 650,- 250 + 650,- 250 + 350,- 250
+ + 650,- 250 + 650,- 250 + 650,- 250 + 350,- 300
+ + 350,- 250 + 350,- 250 + 350,- 250 + 650
+Sum: 24600
+
+Send MagiQuest 0x6BCDFF00, 0x176 as 55 bit PulseDistanceWidth MSB first
Protocol=MagiQuest Address=0xFF00 Command=0x176 Raw-Data=0x6BCDFF00 56 bits MSB first
Send with: IrSender.sendMagiQuest(0x6BCDFF00, 0x176, <numberOfRepeats>);
rawData[112]:
@@ -259,152 +259,129 @@ rawData[112]:
+ 300,- 850 + 600,- 550 + 600,- 550 + 350,- 800
+ 300,- 850 + 350,- 800 + 350,- 800 + 600,- 550
+ 600,- 550 + 350,- 800 + 350,- 800 + 600
-Duration=63850 us
+Sum: 63850
Send Onkyo (NEC with 16 bit command)
-Protocol=Onkyo Address=0xFFF1 Command=0x7776 Raw-Data=0x7776FFF1 32 bits LSB first Duration=76750 us
+Protocol=Onkyo Address=0xFFF1 Command=0x7776 Raw-Data=0x7776FFF1 32 bits LSB first
Send with: IrSender.sendOnkyo(0xFFF1, 0x7776, <numberOfRepeats>);
-rawData[68]:
- -1115300
+rawData[68]:
+ -1084150
+8950,-4400
- + 650,-1600 + 650,- 500 + 600,- 500 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,-1600
- + 650,-1600 + 600,-1650 + 600,-1600 + 650,-1600
- + 650,-1600 + 650,-1600 + 600,-1650 + 600,-1600
- + 650,- 500 + 600,-1600 + 650,-1600 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 600,- 550
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,- 500
+ + 600,-1650 + 600,- 550 + 600,- 500 + 600,- 550
+ + 600,-1600 + 650,-1600 + 600,-1650 + 600,-1650
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,-1650
+ + 600,-1650 + 600,-1600 + 600,-1650 + 600,-1650
+ + 600,- 500 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,- 550
+ 600
-Duration=76750 us
+Sum: 76750
Send Apple
-Protocol=Apple Address=0xF1 Command=0x76 Raw-Data=0xF17687EE 32 bits LSB first Duration=72250 us
+Protocol=Apple Address=0xF1 Command=0x76 Raw-Data=0xF17687EE 32 bits LSB first
Send with: IrSender.sendApple(0xF1, 0x76, <numberOfRepeats>);
-rawData[68]:
- -1060250
- +8950,-4400
- + 600,- 500 + 650,-1600 + 650,-1600 + 650,-1600
- + 650,- 500 + 600,-1600 + 650,-1600 + 650,-1600
- + 600,-1650 + 600,-1600 + 650,-1600 + 600,- 500
- + 650,- 500 + 600,- 500 + 650,- 500 + 650,-1600
- + 600,- 500 + 650,-1600 + 650,-1600 + 600,- 500
- + 650,-1600 + 650,-1600 + 650,-1600 + 600,- 500
- + 650,-1600 + 650,- 500 + 600,- 500 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,-1600
+rawData[68]:
+ -1058150
+ +8900,-4450
+ + 600,- 500 + 600,-1650 + 600,-1650 + 600,-1600
+ + 600,- 550 + 600,-1650 + 600,-1600 + 600,-1650
+ + 600,-1650 + 600,-1650 + 600,-1600 + 600,- 550
+ + 600,- 500 + 600,- 550 + 600,- 550 + 600,-1600
+ + 600,- 550 + 600,-1600 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600,-1650 + 600,- 550 + 600,- 500 + 600,- 550
+ + 600,-1650 + 600,-1600 + 600,-1650 + 600,-1650
+ 600
-Duration=72250 us
+Sum: 72200
Send Panasonic
-Protocol=Panasonic Address=0xFF1 Command=0x76 Raw-Data=0x9976FF10 48 bits LSB first Duration=64450 us
+Protocol=Panasonic Address=0xFF1 Command=0x76 Raw-Data=0x9976FF10 48 bits LSB first
Send with: IrSender.sendPanasonic(0xFF1, 0x76, <numberOfRepeats>);
-rawData[100]:
- -1059900
- +3500,-1650
- + 500,- 400 + 500,-1200 + 500,- 400 + 450,- 400
- + 500,- 350 + 500,- 400 + 500,- 350 + 500,- 350
- + 500,- 400 + 500,- 350 + 500,- 400 + 450,- 400
- + 500,- 350 + 500,-1250 + 450,- 400 + 500,- 350
- + 500,- 400 + 500,- 350 + 500,- 350 + 500,- 400
- + 500,-1200 + 500,- 400 + 450,- 400 + 500,- 350
- + 500,-1250 + 450,-1250 + 500,-1250 + 500,-1200
- + 500,-1200 + 500,-1250 + 500,-1200 + 500,-1250
- + 500,- 400 + 450,-1250 + 500,-1250 + 450,- 400
- + 500,-1250 + 450,-1250 + 500,-1250 + 450,- 400
- + 500,-1200 + 500,- 400 + 450,- 400 + 500,-1250
- + 450,-1250 + 500,- 350 + 500,- 400 + 450,-1250
- + 500
-Duration=64450 us
+rawData[100]:
+ -1057800
+ +3450,-1700
+ + 450,- 400 + 500,-1250 + 450,- 400 + 450,- 450
+ + 450,- 400 + 450,- 400 + 500,- 400 + 450,- 400
+ + 450,- 450 + 450,- 400 + 450,- 400 + 450,- 450
+ + 450,- 400 + 450,-1300 + 450,- 400 + 450,- 400
+ + 500,- 400 + 450,- 400 + 450,- 400 + 500,- 400
+ + 450,-1250 + 450,- 450 + 450,- 400 + 450,- 400
+ + 450,-1300 + 450,-1250 + 450,-1300 + 450,-1250
+ + 500,-1250 + 450,-1250 + 500,-1250 + 450,-1300
+ + 450,- 400 + 450,-1250 + 450,-1300 + 450,- 400
+ + 450,-1250 + 450,-1300 + 450,-1250 + 500,- 400
+ + 450,-1250 + 450,- 450 + 450,- 400 + 450,-1250
+ + 450,-1300 + 450,- 400 + 450,- 400 + 500,-1250
+ + 450
+Sum: 64400
Send Kaseikyo with 0x4711 as Vendor ID
-Protocol=Kaseikyo Address=0xFF1 Command=0x76 Extra=0x4711 Raw-Data=0x9A76FF13 48 bits LSB first Duration=69550 us
+Protocol=Kaseikyo Address=0xFF1 Command=0x76 Extra=0x4711 Raw-Data=0x9A76FF13 48 bits LSB first
Send with: IrSender.sendKaseikyo(0xFF1, 0x76, <numberOfRepeats>, 0x4711);
-rawData[100]:
- -1080100
+rawData[100]:
+ -1078000
+3450,-1700
- + 500,-1200 + 500,- 400 + 450,- 400 + 500,- 350
- + 500,-1250 + 450,- 400 + 500,- 350 + 500,- 400
- + 450,-1250 + 500,-1250 + 450,-1250 + 500,- 400
- + 450,- 400 + 500,- 350 + 500,-1250 + 500,- 350
- + 500,-1250 + 450,-1250 + 500,- 400 + 450,- 400
- + 500,-1200 + 500,- 400 + 450,- 400 + 500,- 350
- + 500,-1250 + 450,-1250 + 500,-1250 + 450,-1250
- + 500,-1250 + 450,-1250 + 500,-1250 + 450,-1300
- + 450,- 400 + 500,-1200 + 500,-1250 + 450,- 400
- + 500,-1250 + 450,-1250 + 500,-1250 + 450,- 400
- + 500,- 350 + 500,-1250 + 500,- 350 + 500,-1250
- + 450,-1250 + 500,- 400 + 450,- 400 + 500,-1200
+ + 450,-1250 + 450,- 450 + 450,- 400 + 450,- 450
+ + 450,-1250 + 450,- 400 + 500,- 400 + 450,- 400
+ + 450,-1300 + 450,-1250 + 450,-1300 + 450,- 400
+ + 450,- 400 + 450,- 450 + 450,-1250 + 450,- 450
+ + 450,-1250 + 450,-1300 + 450,- 400 + 450,- 400
+ + 500,-1250 + 450,- 400 + 450,- 450 + 450,- 400
+ + 450,-1250 + 450,-1300 + 450,-1250 + 450,-1300
+ + 450,-1250 + 450,-1300 + 450,-1250 + 450,-1300
+ + 450,- 400 + 450,-1300 + 450,-1250 + 450,- 450
+ + 450,-1250 + 450,-1250 + 500,-1250 + 450,- 400
+ + 450,- 400 + 500,-1250 + 450,- 400 + 450,-1300
+ + 450,-1250 + 450,- 450 + 450,- 400 + 450,-1250
+ 500
-Duration=69550 us
+Sum: 69550
Send Kaseikyo_Denon variant
-Protocol=Kaseikyo_Denon Address=0xFF1 Command=0x76 Raw-Data=0x9976FF10 48 bits LSB first Duration=67900 us
+Protocol=Kaseikyo_Denon Address=0xFF1 Command=0x76 Raw-Data=0x9976FF10 48 bits LSB first
Send with: IrSender.sendKaseikyo_Denon(0xFF1, 0x76, <numberOfRepeats>);
-rawData[100]:
- -1080850
- +3500,-1650
- + 500,- 400 + 500,- 350 + 500,-1250 + 450,- 400
- + 500,-1250 + 450,- 400 + 500,-1200 + 500,- 400
- + 500,- 350 + 500,-1200 + 500,- 400 + 450,- 400
- + 500,-1200 + 500,-1250 + 450,- 400 + 500,- 350
- + 500,- 400 + 450,- 400 + 500,- 350 + 500,- 400
- + 500,-1200 + 500,- 400 + 450,- 400 + 500,- 350
- + 500,-1250 + 500,-1200 + 500,-1250 + 500,-1250
- + 450,-1250 + 500,-1250 + 500,-1200 + 500,-1250
- + 500,- 350 + 500,-1250 + 500,-1250 + 450,- 400
- + 500,-1200 + 500,-1250 + 500,-1200 + 500,- 350
- + 500,-1250 + 500,- 350 + 500,- 350 + 500,-1250
- + 500,-1250 + 450,- 400 + 500,- 350 + 500,-1250
+rawData[100]:
+ -1078750
+ +3450,-1700
+ + 500,- 400 + 450,- 400 + 450,-1300 + 450,- 400
+ + 450,-1250 + 500,- 400 + 450,-1250 + 500,- 400
+ + 450,- 400 + 450,-1250 + 450,- 450 + 450,- 400
+ + 450,-1300 + 450,-1250 + 450,- 400 + 500,- 400
+ + 450,- 400 + 450,- 400 + 500,- 400 + 450,- 400
+ + 450,-1300 + 450,- 400 + 450,- 400 + 450,- 450
+ + 450,-1250 + 450,-1300 + 450,-1250 + 450,-1300
+ + 450,-1250 + 450,-1300 + 450,-1250 + 450,-1300
+ + 450,- 400 + 450,-1300 + 450,-1250 + 450,- 400
+ + 500,-1250 + 450,-1250 + 500,-1250 + 450,- 400
+ + 500,-1250 + 450,- 400 + 450,- 400 + 450,-1300
+ + 450,-1250 + 450,- 400 + 500,- 400 + 450,-1250
+ 500
-Duration=67900 us
+Sum: 67850
Send Denon
-Protocol=Denon Address=0x11 Command=0x76 Raw-Data=0xED1 15 bits LSB first Duration=23150 us
+Protocol=Denon Address=0x11 Command=0x76 Raw-Data=0xED1 15 bits LSB first
Send with: IrSender.sendDenon(0x11, 0x76, <numberOfRepeats>);
-rawData[32]:
- -1078600
+rawData[32]:
+ -1076500
+ 300,-1750 + 300,- 750 + 300,- 750 + 300,- 750
- + 300,-1750 + 350,- 700 + 350,-1700 + 350,-1750
- + 300,- 750 + 300,-1750 + 350,-1700 + 350,-1750
- + 300,- 750 + 300,- 750 + 300,- 700 + 350
-Duration=23150 us
+ + 300,-1750 + 300,- 750 + 300,-1800 + 250,-1800
+ + 300,- 750 + 300,-1750 + 300,-1800 + 300,-1750
+ + 300,- 750 + 300,- 750 + 300,- 750 + 300
+Sum: 23150
Send Denon/Sharp variant
-Protocol=Denon Address=0x11 Command=0x76 Raw-Data=0x2ED1 15 bits LSB first Duration=24200 us
-Send with: IrSender.sendDenon(0x11, 0x76, <numberOfRepeats>);
-rawData[32]:
- -1020800
- + 300,-1750 + 350,- 700 + 350,- 700 + 300,- 750
- + 300,-1750 + 350,- 700 + 350,-1700 + 350,-1750
- + 350,- 700 + 300,-1750 + 350,-1750 + 300,-1750
- + 350,- 700 + 350,-1700 + 350,- 700 + 350
-Duration=24200 us
-
-Send Sony/SIRCS with 7 command and 5 address bits
-Protocol=Sony Address=0x11 Command=0x76 Raw-Data=0x8F6 12 bits LSB first Duration=21050 us
-Send with: IrSender.sendSony(0x11, 0x76, 2, 12);
-rawData[26]:
- -1023000
- +2450,- 550
- + 700,- 500 +1300,- 500 +1250,- 550 + 650,- 550
- +1250,- 550 +1250,- 550 +1250,- 550 +1250,- 550
- + 700,- 500 + 600,- 600 + 650,- 550 +1250
-Duration=21050 us
-
-Send Sony/SIRCS with 7 command and 8 address bits
-Protocol=Sony Address=0xF1 Command=0x76 Raw-Data=0x78F6 15 bits LSB first Duration=26450 us
-Send with: IrSender.sendSony(0xF1, 0x76, 2, 15);
-rawData[32]:
- -1038750
- +2450,- 550
- + 700,- 500 +1250,- 550 +1250,- 550 + 650,- 550
- +1250,- 550 +1250,- 550 +1250,- 550 +1250,- 550
- + 650,- 550 + 650,- 550 + 650,- 550 +1250,- 550
- +1250,- 550 +1250,- 550 +1250
-Duration=26450 us
+Protocol=Sharp Address=0x11 Command=0x76 Raw-Data=0x4ED1 15 bits LSB first
+Send with: IrSender.sendSharp(0x11, 0x76, <numberOfRepeats>);
+rawData[32]:
+ -1018700
+ + 300,-1800 + 300,- 750 + 300,- 700 + 300,- 750
+ + 300,-1800 + 250,- 750 + 300,-1800 + 250,-1800
+ + 300,- 750 + 300,-1750 + 300,-1800 + 300,-1750
+ + 300,- 750 + 300,- 750 + 300,-1750 + 300
+Sum: 24150
Send Sony/SIRCS with 7 command and 5 address bits
-Protocol=Sony Address=0x11 Command=0x76 Raw-Data=0x8F6 12 bits LSB first Duration=21050 us
+Protocol=Sony Address=0x11 Command=0x76 Raw-Data=0x8F6 12 bits LSB first
Send with: IrSender.sendSony(0x11, 0x76, 2, 12);
rawData[26]:
-1020900
@@ -412,10 +389,10 @@ rawData[26]:
+ 650,- 550 +1250,- 550 +1250,- 550 + 650,- 550
+1250,- 550 +1250,- 550 +1250,- 550 +1250,- 550
+ 650,- 550 + 650,- 550 + 650,- 550 +1250
-Duration=21050 us
+Sum: 21050
Send Sony/SIRCS with 7 command and 8 address bits
-Protocol=Sony Address=0xF1 Command=0x76 Raw-Data=0x78F6 15 bits LSB first Duration=26450 us
+Protocol=Sony Address=0xF1 Command=0x76 Raw-Data=0x78F6 15 bits LSB first
Send with: IrSender.sendSony(0xF1, 0x76, 2, 15);
rawData[32]:
-1036650
@@ -424,10 +401,10 @@ rawData[32]:
+1250,- 550 +1250,- 550 +1250,- 550 +1250,- 550
+ 650,- 550 + 650,- 550 + 650,- 550 +1250,- 550
+1250,- 550 +1250,- 550 +1250
-Duration=26450 us
+Sum: 26450
Send Sony/SIRCS with 7 command and 13 address bits
-Protocol=Sony Address=0x1FF1 Command=0x76 Raw-Data=0xFF8F6 20 bits LSB first Duration=35400 us
+Protocol=Sony Address=0x1FF1 Command=0x76 Raw-Data=0xFF8F6 20 bits LSB first
Send with: IrSender.sendSony(0x1FF1, 0x76, 2, 20);
rawData[42]:
-1040400
@@ -437,95 +414,97 @@ rawData[42]:
+ 650,- 550 + 600,- 600 + 650,- 550 +1250,- 550
+1250,- 550 +1250,- 550 +1250,- 550 +1250,- 550
+1250,- 550 +1250,- 550 +1250,- 550 +1250
-Duration=35400 us
+Sum: 35400
+
+Send Samsung 8 bit command and 8 bit address
+Protocol=Samsung Address=0xF1 Command=0x76 Raw-Data=0x8976F1F1 32 bits LSB first
+Send with: IrSender.sendSamsung(0xF1, 0x76, <numberOfRepeats>);
+rawData[68]:
+ -1045200
+ +4500,-4400
+ + 600,-1650 + 600,- 500 + 600,- 550 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1600
+ + 600,-1650 + 600,- 550 + 600,- 500 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,-1650
+ + 600,- 500 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1600 + 650,- 500
+ + 600,-1650 + 600,- 500 + 600,- 550 + 600,-1600
+ + 650,- 500 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600
+Sum: 65550
Send Samsung 16 bit command and address
-Protocol=Samsung Address=0xFFF1 Command=0x9876 Raw-Data=0x9876FFF1 32 bits LSB first Duration=69000 us
+Protocol=Samsung Address=0xFFF1 Command=0x9876 Raw-Data=0x9876FFF1 32 bits LSB first
Send with: IrSender.sendSamsung(0xFFF1, 0x9876, <numberOfRepeats>);
-rawData[68]:
- -1057350
- +4550,-4350
- + 650,-1600 + 650,- 500 + 600,- 500 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,-1600
- + 600,-1650 + 600,-1600 + 650,-1600 + 650,-1600
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,-1600
- + 600,- 500 + 650,-1600 + 650,-1600 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 600,- 500
- + 650,- 500 + 650,- 450 + 650,- 500 + 650,-1600
- + 650,-1600 + 600,- 500 + 650,- 500 + 650,-1600
- + 650
-Duration=69000 us
+rawData[68]:
+ -1060350
+ +4500,-4450
+ + 600,-1600 + 600,- 550 + 600,- 500 + 600,- 550
+ + 600,-1650 + 600,-1650 + 550,-1650 + 600,-1650
+ + 600,-1650 + 600,-1600 + 650,-1600 + 600,-1650
+ + 600,-1650 + 600,-1600 + 600,-1650 + 600,-1650
+ + 600,- 550 + 600,-1600 + 600,-1650 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,- 500
+ + 650,- 500 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,-1650 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600
+Sum: 68950
Send Samsung48 16 bit command
-Protocol=Samsung48 Address=0xFFF1 Command=0x9876 Raw-Data=0x6798 48 bits LSB first Duration=95900 us
+Protocol=Samsung48 Address=0xFFF1 Command=0x9876 Raw-Data=0x6798 48 bits LSB first
Send with: IrSender.sendSamsung48(0xFFF1, 0x9876, <numberOfRepeats>);
-rawData[100]:
- -1039600
- +4550,-4400
- + 600,-1600 + 650,- 500 + 650,- 450 + 650,- 500
- + 600,-1650 + 600,-1600 + 650,-1600 + 650,-1600
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,-1600
- + 650,-1600 + 600,-1600 + 650,-1600 + 650,-1600
- + 650,- 500 + 600,-1600 + 650,-1600 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,- 500
- + 600,-1600 + 650,- 500 + 650,- 500 + 600,-1600
- + 600,- 550 + 600,- 500 + 650,- 500 + 600,-1650
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,-1600
- + 650,-1600 + 650,- 500 + 600,- 500 + 650,-1600
- + 650,-1600 + 600,-1650 + 600,-1600 + 650,- 500
- + 600,- 500 + 650,-1600 + 650,-1600 + 650,- 450
- + 650
-Duration=95900 us
+rawData[100]:
+ -1060250
+ +4500,-4450
+ + 600,-1600 + 600,- 550 + 600,- 500 + 600,- 550
+ + 600,-1650 + 600,-1600 + 600,-1650 + 600,-1650
+ + 600,-1650 + 600,-1600 + 600,-1650 + 600,-1650
+ + 600,-1650 + 600,-1600 + 600,-1650 + 600,-1650
+ + 600,- 500 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1600 + 600,- 550
+ + 600,-1650 + 600,- 500 + 600,- 550 + 600,-1650
+ + 600,- 500 + 600,- 550 + 600,- 500 + 600,-1700
+ + 550,- 550 + 600,- 500 + 600,- 550 + 600,-1650
+ + 600,-1600 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,-1650 + 600,-1650 + 600,-1600 + 600,- 550
+ + 600,- 500 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600
+Sum: 95800
Send RC5
-Protocol=RC5 Address=0x11 Command=0x36 Raw-Data=0x1476 13 bits MSB first Duration=23200 us
+Protocol=RC5 Address=0x11 Command=0x36 Raw-Data=0x1476 13 bits MSB first
Send with: IrSender.sendRC5(0x11, 0x36, <numberOfRepeats>);
-rawData[20]:
- -1078850
- + 950,- 850
- +1850,-1700 +1800,- 850 + 950,- 850 + 950,-1700
- + 950,- 850 + 950,- 800 +1850,-1700 + 950,- 850
- +1850
-Duration=23200 us
+rawData[20]:
+ -1076800
+ + 900,- 900
+ +1800,-1750 +1800,- 850 + 950,- 850 + 900,-1750
+ + 900,- 850 + 950,- 850 +1800,-1750 + 900,- 900
+ +1800
+Sum: 23150
Send RC5X with 7.th MSB of command set
-Protocol=RC5 Address=0x11 Command=0x76 Toggle=1 Raw-Data=0xC76 13 bits MSB first Duration=23150 us
+Protocol=RC5 Address=0x11 Command=0x76 Toggle=1 Raw-Data=0xC76 13 bits MSB first
Send with: IrSender.sendRC5(0x11, 0x76, <numberOfRepeats>);
-rawData[20]:
- -1037700
- +1850,-1700
- + 950,- 850 +1800,- 850 + 950,- 800 + 950,-1750
- + 950,- 800 + 950,- 850 +1800,-1750 + 950,- 800
- +1850
-Duration=23150 us
+rawData[20]:
+ -1035650
+ +1800,-1700
+ + 950,- 850 +1800,- 850 + 950,- 850 + 900,-1750
+ + 950,- 850 + 900,- 850 +1800,-1750 + 950,- 850
+ +1800
+Sum: 23100
Send RC6
-Protocol=RC6 Address=0xF1 Command=0x76 Raw-Data=0xF176 20 bits MSB first Duration=23300 us
+Protocol=RC6 Address=0xF1 Command=0x76 Raw-Data=0xF176 20 bits MSB first
Send with: IrSender.sendRC6(0xF1, 0x76, <numberOfRepeats>);
-rawData[36]:
- -1035050
- +2700,- 800
+rawData[36]:
+ -1033000
+ +2650,- 850
+ 500,- 850 + 500,- 400 + 500,- 400 + 500,- 850
- +1400,- 350 + 500,- 400 + 500,- 400 + 500,- 850
+ +1350,- 450 + 450,- 400 + 500,- 400 + 500,- 850
+ 500,- 400 + 500,- 400 + 950,- 850 + 950,- 400
+ 500,- 400 + 500,- 850 + 950,- 400 + 500,- 850
+ 500
-Duration=23300 us
-
-Send RC6A with 14 bit 0x2711 as extra
-Protocol=RC6A Address=0xF1 Command=0x76 Extra=0x2711 Toggle=1 Raw-Data=0xA711F176 35 bits MSB first Duration=36800 us
-Send with: IrSender.sendRC6A(0xF1, 0x76, <numberOfRepeats>, 0x2711);
-rawData[58]:
- -1045150
- +2700,- 800
- + 500,- 400 + 500,- 450 + 450,- 900 +1350,-1300
- + 950,- 850 + 500,- 400 + 900,- 400 + 500,- 450
- + 450,- 850 + 500,- 400 + 500,- 400 + 950,- 850
- + 500,- 400 + 500,- 400 +1000,- 400 + 450,- 400
- + 500,- 450 + 500,- 400 + 450,- 850 + 500,- 400
- + 500,- 400 +1000,- 800 +1000,- 400 + 450,- 450
- + 450,- 850 + 950,- 400 + 500,- 850 + 500
-Duration=36800 us
+Sum: 23300
Send Bang&Olufsen
- ENABLE_BEO_WITHOUT_FRAME_GAP is enabled
@@ -538,11 +517,11 @@ rawData[36]:
+ 250,-5950 + 200,-6000 + 200,-9050 + 250,-2900
+ 250,-9000 + 250,-6000 + 250,-5950 + 250,-2850
+ 250
-Duration=105700 us
+Sum: 105700
Protocol=Bang&Olufsen Address=0x0 Command=0x0 Raw-Data=0x0 0 bits MSB first
- Remove trailing 6 entries, which is equivalent to define RECORD_GAP_MICROS < 15000, to enable successful B&O decode
-Protocol=Bang&Olufsen Address=0xF1 Command=0x76 Raw-Data=0xF176 16 bits MSB first Duration=115000 us
+Protocol=Bang&Olufsen Address=0xF1 Command=0x76 Raw-Data=0xF176 16 bits MSB first
Send with: IrSender.sendBang&Olufsen(0xF1, 0x76, <numberOfRepeats>);
rawData[38]:
-15250
@@ -552,120 +531,95 @@ rawData[38]:
+ 250,-2900 + 250,-9000 + 250,-6000 + 250,-5950
+ 250,-2850 + 250,-9100 + 200,-5950 + 250,-2900
+ 200,-12150 + 250
-Duration=115000 us
+Sum: 115000
Send MagiQuest
-Protocol=MagiQuest Address=0xFFF1 Command=0x76 Raw-Data=0x6BCDFFF1 56 bits MSB first Duration=63900 us
+Protocol=MagiQuest Address=0xFFF1 Command=0x76 Raw-Data=0x6BCDFFF1 56 bits MSB first
Send with: IrSender.sendMagiQuest(0x6BCDFFF1, 0x76, <numberOfRepeats>);
-rawData[112]:
- -1089250
+rawData[112]:
+ -1088700
+ 350,- 800 + 350,- 800 + 350,- 800 + 350,- 800
+ 350,- 800 + 350,- 800 + 350,- 800 + 350,- 850
- + 600,- 550 + 600,- 550 + 350,- 800 + 600,- 550
- + 350,- 750 + 650,- 500 + 650,- 500 + 650,- 500
- + 650,- 500 + 300,- 850 + 350,- 800 + 650,- 500
- + 650,- 500 + 350,- 800 + 650,- 500 + 650,- 500
- + 650,- 500 + 650,- 500 + 650,- 500 + 650,- 500
- + 650,- 500 + 650,- 500 + 650,- 500 + 650,- 500
- + 650,- 500 + 650,- 500 + 650,- 500 + 350,- 800
- + 350,- 800 + 350,- 800 + 650,- 550 + 300,- 800
- + 350,- 800 + 650,- 500 + 650,- 500 + 650,- 500
- + 350,- 800 + 650,- 500 + 650,- 500 + 350,- 850
- + 350,- 750 + 350,- 800 + 650,- 500 + 650,- 500
- + 350,- 800 + 650,- 500 + 650,- 500 + 650
-Duration=63900 us
+ + 600,- 550 + 600,- 550 + 300,- 850 + 600,- 550
+ + 300,- 800 + 650,- 500 + 650,- 500 + 600,- 550
+ + 600,- 550 + 350,- 800 + 350,- 800 + 600,- 550
+ + 600,- 550 + 350,- 800 + 600,- 550 + 600,- 550
+ + 600,- 550 + 600,- 550 + 600,- 550 + 600,- 550
+ + 600,- 550 + 600,- 550 + 600,- 550 + 600,- 550
+ + 600,- 550 + 600,- 550 + 600,- 550 + 350,- 800
+ + 350,- 800 + 350,- 800 + 600,- 600 + 300,- 850
+ + 300,- 800 + 650,- 550 + 600,- 550 + 600,- 550
+ + 300,- 800 + 600,- 550 + 600,- 550 + 350,- 850
+ + 300,- 800 + 350,- 800 + 600,- 550 + 600,- 550
+ + 350,- 800 + 600,- 550 + 600,- 550 + 600
+Sum: 63850
Send next protocols with IrSender.write
Send JVC
-Protocol=JVC Address=0xF1 Command=0x76 Raw-Data=0x76F1 16 bits LSB first Duration=40400 us
+Protocol=JVC Address=0xF1 Command=0x76 Raw-Data=0x76F1 16 bits LSB first
Send with: IrSender.sendJVC(0xF1, 0x76, <numberOfRepeats>);
-rawData[36]:
- -1087300
- +8400,-4100
- + 600,-1500 + 600,- 450 + 600,- 450 + 600,- 450
- + 600,-1500 + 600,-1500 + 600,-1500 + 600,-1500
- + 600,- 450 + 600,-1500 + 600,-1500 + 600,- 450
- + 600,-1500 + 600,-1500 + 600,-1500 + 600,- 450
- + 600
-Duration=40400 us
+rawData[36]:
+ -1085250
+ +8400,-4150
+ + 550,-1550 + 550,- 500 + 550,- 500 + 550,- 500
+ + 550,-1550 + 550,-1550 + 550,-1550 + 550,-1550
+ + 550,- 500 + 550,-1550 + 550,-1550 + 550,- 500
+ + 550,-1550 + 550,-1550 + 550,-1550 + 550,- 500
+ + 550
+Sum: 40400
Send LG
-Protocol=LG Address=0xF1 Command=0x9876 Raw-Data=0xF19876E 28 bits MSB first Duration=59450 us
+Protocol=LG Address=0xF1 Command=0x9876 Raw-Data=0xF19876E 28 bits MSB first
Send with: IrSender.sendLG(0xF1, 0x9876, <numberOfRepeats>);
-rawData[60]:
- -1041500
- +9000,-4150
- + 500,-1550 + 550,-1500 + 550,-1550 + 550,-1500
- + 550,- 500 + 550,- 500 + 550,- 500 + 550,-1550
- + 550,-1500 + 550,- 500 + 550,- 500 + 550,-1550
- + 550,-1500 + 550,- 500 + 550,- 500 + 550,- 500
- + 550,- 500 + 600,-1500 + 550,-1500 + 550,-1550
- + 550,- 500 + 550,-1500 + 550,-1550 + 550,- 500
- + 550,-1500 + 550,-1550 + 500,-1550 + 550,- 500
+rawData[60]:
+ -1039450
+ +8950,-4150
+ + 550,-1550 + 500,-1550 + 500,-1550 + 550,-1550
+ + 500,- 550 + 500,- 550 + 500,- 550 + 500,-1550
+ + 550,-1550 + 500,- 550 + 500,- 550 + 500,-1550
+ + 550,-1550 + 500,- 550 + 500,- 550 + 500,- 550
+ + 500,- 500 + 550,-1550 + 500,-1550 + 550,-1550
+ + 500,- 550 + 500,-1550 + 550,-1550 + 500,- 550
+ + 500,-1550 + 550,-1550 + 500,-1550 + 550,- 500
+ 550
-Duration=59450 us
+Sum: 59400
Send Bosewave with no address and 8 command bits
-Protocol=BoseWave Address=0x0 Command=0x76 Raw-Data=0x8976 16 bits LSB first Duration=26800 us
+Protocol=BoseWave Address=0x0 Command=0x76 Raw-Data=0x8976 16 bits LSB first
Send with: IrSender.sendBoseWave(0x0, 0x76, <numberOfRepeats>);
-rawData[36]:
- -1058350
+rawData[36]:
+ -1056200
+1050,-1450
- + 550,- 400 + 600,-1400 + 550,-1400 + 600,- 400
- + 600,-1400 + 550,-1400 + 600,-1400 + 600,- 400
- + 550,-1400 + 600,- 400 + 600,- 400 + 600,-1400
- + 550,- 400 + 600,- 400 + 600,- 400 + 600,-1400
+ + 550,- 450 + 550,-1400 + 550,-1450 + 550,- 450
+ + 550,-1400 + 550,-1450 + 550,-1400 + 550,- 450
+ + 550,-1450 + 550,- 450 + 550,- 400 + 550,-1450
+ + 550,- 450 + 550,- 450 + 550,- 450 + 550,-1400
+ 550
-Duration=26800 us
+Sum: 26800
Send FAST
-Protocol=FAST Address=0x0 Command=0x76 Raw-Data=0x8976 16 bits LSB first Duration=28900 us
+Protocol=FAST Address=0x0 Command=0x76 Raw-Data=0x8976 16 bits LSB first
Send with: IrSender.sendFAST(0x0, 0x76, <numberOfRepeats>);
-rawData[36]:
- -1042350
+rawData[36]:
+ -1040250
+2150,-1000
- + 550,- 500 + 600,-1500 + 550,-1550 + 550,- 500
- + 550,-1550 + 550,-1550 + 550,-1550 + 550,- 500
- + 550,-1550 + 550,- 500 + 550,- 500 + 600,-1500
- + 550,- 500 + 550,- 500 + 600,- 450 + 550,-1550
+ + 550,- 550 + 550,-1550 + 550,-1500 + 550,- 550
+ + 550,-1550 + 550,-1550 + 550,-1550 + 500,- 550
+ + 550,-1550 + 550,- 500 + 550,- 500 + 550,-1550
+ + 550,- 500 + 550,- 500 + 550,- 500 + 550,-1550
+ 550
-Duration=28900 us
+Sum: 28950
-Force buffer overflow by sending 450 marks and spaces
+Force buffer overflow by sending 280 marks and spaces
Overflow
-Try to increase the "RAW_BUFFER_LENGTH" value of 400 in ../src/UnitTest.cpp
-rawData[400]:
- -1041550
- + 300,- 500
- + 250,- 500 + 250,- 550 + 200,- 500 + 250,- 550
+Try to increase the "RAW_BUFFER_LENGTH" value of 200 in ../src/UnitTest.cpp
+rawData[200]:
+ -1039500
+ + 200,- 500
+ + 250,- 550 + 250,- 500 + 250,- 500 + 250,- 500
+ + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 550
+ 200,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 550 + 200,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
- + 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
+ 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
+ 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
+ 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
@@ -688,210 +642,195 @@ rawData[400]:
+ 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
+ 250,- 500 + 250,- 500 + 250,- 500 + 250,- 500
+ 250,- 500 + 250,- 500 + 250
-Duration=149550 us
+Sum: 74500
ERROR: Unknown protocol
-Stop receiver
-Start receiver
address=0xF2 command=0x87
Send NEC with 8 bit address and complete NEC frames as repeats to force decoding as NEC2
-Protocol=NEC Address=0xF2 Command=0x87 Raw-Data=0x78870DF2 32 bits LSB first Duration=67850 us
+Protocol=NEC Address=0xF2 Command=0x87 Raw-Data=0x78870DF2 32 bits LSB first
Send with: IrSender.sendNEC(0xF2, 0x87, <numberOfRepeats>);
-rawData[68]:
- -1028850
- +8900,-4400
- + 650,- 500 + 650,-1600 + 600,- 500 + 600,- 550
- + 600,-1650 + 600,-1600 + 650,-1600 + 650,-1600
- + 650,-1600 + 650,- 450 + 650,-1600 + 650,-1600
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,- 500
- + 650,-1600 + 650,-1600 + 650,-1600 + 650,- 450
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,-1600
- + 650,- 500 + 650,- 500 + 600,- 500 + 650,-1600
- + 650,-1600 + 650,-1600 + 600,-1650 + 600,- 500
- + 650
-Duration=67850 us
-
-Protocol=NEC2 Address=0xF2 Command=0x87 Repeat gap=67950us Raw-Data=0x78870DF2 32 bits LSB first Duration=67900 us
-Send with: IrSender.sendNEC2(0xF2, 0x87, <numberOfRepeats>);
-rawData[68]:
- -67950
+rawData[68]:
+ -3276750
+8950,-4400
- + 600,- 550 + 600,-1650 + 600,- 500 + 600,- 550
- + 600,-1600 + 600,-1650 + 600,-1650 + 600,-1650
- + 600,-1650 + 600,- 550 + 600,-1600 + 600,-1650
+ + 600,- 550 + 600,-1600 + 600,- 550 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1600
+ + 600,-1650 + 600,- 550 + 600,-1600 + 650,-1600
+ 600,- 550 + 600,- 500 + 600,- 550 + 600,- 500
+ 600,-1650 + 600,-1650 + 600,-1650 + 600,- 500
+ 600,- 550 + 600,- 500 + 600,- 550 + 600,-1650
- + 600,- 500 + 600,- 550 + 600,- 500 + 600,-1650
- + 600,-1650 + 650,-1600 + 650,-1600 + 600,- 500
- + 650
-Duration=67900 us
+ + 550,- 550 + 600,- 500 + 650,- 500 + 600,-1650
+ + 600,-1650 + 600,-1650 + 600,-1600 + 600,- 550
+ + 600
+Sum: 67800
+
+Protocol=NEC2 Address=0xF2 Command=0x87 Repeat gap=65900us Raw-Data=0x78870DF2 32 bits LSB first
+Send with: IrSender.sendNEC2(0xF2, 0x87, <numberOfRepeats>);
+rawData[68]:
+ -65900
+ +8900,-4450
+ + 550,- 550 + 600,-1650 + 600,- 500 + 600,- 550
+ + 600,-1600 + 650,-1600 + 600,-1650 + 600,-1650
+ + 600,-1650 + 600,- 500 + 600,-1650 + 600,-1650
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1600
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1600
+ + 650,-1600 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600
+Sum: 67750
Send NEC with 16 bit address
-Protocol=NEC Address=0xF2 Command=0x87 Raw-Data=0x78870DF2 32 bits LSB first Duration=67800 us
+Protocol=NEC Address=0xF2 Command=0x87 Raw-Data=0x78870DF2 32 bits LSB first
Send with: IrSender.sendNEC(0xF2, 0x87, <numberOfRepeats>);
-rawData[68]:
- -1062200
- +8950,-4400
- + 600,- 500 + 650,-1600 + 650,- 450 + 650,- 500
- + 650,-1600 + 600,-1600 + 650,-1600 + 650,-1600
- + 650,-1600 + 600,- 500 + 650,-1600 + 650,-1600
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,- 500
- + 650,-1600 + 650,-1600 + 600,-1650 + 600,- 500
- + 650,- 450 + 650,- 500 + 650,- 500 + 600,-1600
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,-1600
- + 650,-1600 + 650,-1600 + 600,-1650 + 600,- 500
- + 650
-Duration=67800 us
+rawData[68]:
+ -1060150
+ +8900,-4450
+ + 600,- 500 + 600,-1650 + 600,- 550 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1600 + 650,-1600
+ + 600,-1650 + 600,- 550 + 600,-1600 + 600,-1650
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,- 550
+ + 600,- 500 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1600
+ + 650,-1600 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600
+Sum: 67800
Send NEC2 with 16 bit address
-Protocol=NEC Address=0xF2 Command=0x87 Raw-Data=0x78870DF2 32 bits LSB first Duration=67850 us
+Protocol=NEC Address=0xF2 Command=0x87 Raw-Data=0x78870DF2 32 bits LSB first
Send with: IrSender.sendNEC(0xF2, 0x87, <numberOfRepeats>);
-rawData[68]:
- -1060650
- +8950,-4400
- + 650,- 500 + 600,-1650 + 600,- 500 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,-1600
- + 600,-1650 + 600,- 500 + 650,-1600 + 600,-1600
- + 650,- 500 + 650,- 500 + 600,- 500 + 650,- 500
- + 600,-1600 + 650,-1600 + 650,-1600 + 650,- 500
- + 600,- 500 + 650,- 500 + 600,- 500 + 650,-1600
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,-1600
- + 650,-1600 + 650,-1600 + 650,-1600 + 600,- 500
- + 650
-Duration=67850 us
+rawData[68]:
+ -1058650
+ +8900,-4400
+ + 650,- 500 + 600,-1650 + 600,- 500 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,-1650
+ + 600,-1600 + 650,- 500 + 600,-1650 + 600,-1600
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,- 550
+ + 600,-1600 + 600,-1650 + 600,-1650 + 600,- 550
+ + 600,- 500 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1600
+ + 650,-1600 + 600,-1650 + 600,-1650 + 600,- 500
+ + 600
+Sum: 67750
Send Onkyo (NEC with 16 bit command)
-Protocol=Onkyo Address=0xF2 Command=0x8887 Raw-Data=0x888700F2 32 bits LSB first Duration=62250 us
+Protocol=Onkyo Address=0xF2 Command=0x8887 Raw-Data=0x888700F2 32 bits LSB first
Send with: IrSender.sendOnkyo(0xF2, 0x8887, <numberOfRepeats>);
-rawData[68]:
- -1061250
- +8950,-4400
- + 650,- 500 + 600,-1600 + 650,- 500 + 650,- 500
- + 600,-1600 + 650,-1600 + 600,-1650 + 600,-1600
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,- 500
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,- 500
- + 650,-1600 + 650,-1600 + 650,-1600 + 650,- 450
- + 650,- 500 + 600,- 500 + 650,- 500 + 650,-1600
- + 600,- 500 + 650,- 500 + 650,- 450 + 650,-1600
- + 650,- 500 + 650,- 450 + 650,- 500 + 650,-1600
+rawData[68]:
+ -1059250
+ +8900,-4450
+ + 600,- 500 + 600,-1650 + 600,- 500 + 600,- 550
+ + 600,-1650 + 600,-1600 + 600,-1650 + 600,-1650
+ + 600,- 500 + 600,- 550 + 600,- 500 + 600,- 550
+ + 600,- 500 + 650,- 500 + 600,- 500 + 600,- 550
+ + 600,-1650 + 600,-1600 + 600,-1650 + 600,- 500
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1600
+ + 650,- 500 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1600
+ 600
-Duration=62250 us
+Sum: 62150
Send Apple
-Protocol=Apple Address=0xF2 Command=0x87 Raw-Data=0xF28787EE 32 bits LSB first Duration=71150 us
+Protocol=Apple Address=0xF2 Command=0x87 Raw-Data=0xF28787EE 32 bits LSB first
Send with: IrSender.sendApple(0xF2, 0x87, <numberOfRepeats>);
-rawData[68]:
- -1059700
- +8950,-4400
- + 600,- 500 + 650,-1600 + 650,-1600 + 650,-1550
- + 650,- 500 + 650,-1600 + 650,-1600 + 600,-1600
- + 650,-1600 + 650,-1600 + 600,-1600 + 650,- 500
- + 600,- 500 + 650,- 500 + 600,- 500 + 650,-1600
- + 650,-1600 + 650,-1600 + 600,-1600 + 650,- 500
- + 650,- 500 + 600,- 500 + 650,- 500 + 600,-1650
- + 600,- 500 + 650,-1600 + 650,- 500 + 600,- 500
- + 650,-1600 + 650,-1600 + 600,-1600 + 650,-1600
+rawData[68]:
+ -1057650
+ +8900,-4400
+ + 600,- 550 + 600,-1650 + 600,-1600 + 600,-1650
+ + 600,- 550 + 600,-1600 + 650,-1600 + 600,-1650
+ + 600,-1650 + 600,-1600 + 650,-1600 + 600,- 550
+ + 600,- 500 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,-1650 + 600,-1600 + 650,-1600 + 600,- 550
+ + 600,- 500 + 600,- 550 + 600,- 500 + 600,-1650
+ + 600,- 550 + 600,-1600 + 600,- 550 + 600,- 500
+ + 600,-1650 + 600,-1650 + 600,-1650 + 600,-1600
+ 650
-Duration=71150 us
+Sum: 71100
Send Panasonic
-Protocol=Panasonic Address=0xF2 Command=0x87 Raw-Data=0xA8870F20 48 bits LSB first Duration=59250 us
+Protocol=Panasonic Address=0xF2 Command=0x87 Raw-Data=0xA8870F20 48 bits LSB first
Send with: IrSender.sendPanasonic(0xF2, 0x87, <numberOfRepeats>);
-rawData[100]:
- -1059850
- +3500,-1650
- + 500,- 350 + 500,-1250 + 500,- 350 + 500,- 400
- + 450,- 400 + 500,- 350 + 500,- 400 + 450,- 400
- + 500,- 350 + 500,- 400 + 450,- 400 + 500,- 350
- + 500,- 400 + 500,-1200 + 500,- 400 + 450,- 400
- + 500,- 350 + 500,- 400 + 450,- 400 + 500,- 350
- + 500,- 400 + 500,-1200 + 500,- 400 + 450,- 400
- + 500,-1200 + 500,-1250 + 450,-1250 + 500,-1250
- + 450,- 400 + 500,- 350 + 500,- 400 + 450,- 400
- + 500,-1250 + 450,-1250 + 500,-1250 + 450,- 400
- + 500,- 350 + 500,- 400 + 500,- 350 + 500,-1250
- + 450,- 400 + 500,- 350 + 500,- 400 + 450,-1250
- + 500,- 350 + 500,-1250 + 500,- 350 + 500,-1200
+rawData[100]:
+ -1057750
+ +3450,-1700
+ + 500,- 400 + 450,-1250 + 500,- 400 + 450,- 400
+ + 450,- 400 + 500,- 400 + 450,- 400 + 450,- 450
+ + 450,- 400 + 450,- 400 + 500,- 400 + 450,- 400
+ + 450,- 400 + 500,-1250 + 450,- 400 + 500,- 400
+ + 450,- 400 + 450,- 400 + 500,- 400 + 450,- 400
+ + 450,- 450 + 450,-1250 + 450,- 400 + 500,- 400
+ + 450,-1250 + 450,-1300 + 450,-1250 + 500,-1250
+ + 450,- 400 + 450,- 450 + 450,- 400 + 450,- 450
+ + 450,-1250 + 450,-1300 + 450,-1250 + 450,- 400
+ + 500,- 400 + 450,- 400 + 450,- 450 + 450,-1250
+ + 450,- 400 + 500,- 400 + 450,- 400 + 450,-1300
+ + 450,- 400 + 450,-1300 + 450,- 400 + 450,-1250
+ 500
-Duration=59250 us
+Sum: 59350
Send Kaseikyo with 0x4711 as Vendor ID
-Protocol=Kaseikyo Address=0xF2 Command=0x87 Extra=0x4711 Raw-Data=0xAB870F23 48 bits LSB first Duration=66200 us
+Protocol=Kaseikyo Address=0xF2 Command=0x87 Extra=0x4711 Raw-Data=0xAB870F23 48 bits LSB first
Send with: IrSender.sendKaseikyo(0xF2, 0x87, <numberOfRepeats>, 0x4711);
-rawData[100]:
- -1079850
+rawData[100]:
+ -1077750
+3450,-1700
- + 500,-1200 + 500,- 400 + 450,- 400 + 500,- 400
- + 450,-1250 + 500,- 350 + 500,- 400 + 500,- 350
- + 500,-1250 + 450,-1250 + 500,-1250 + 450,- 400
- + 500,- 350 + 500,- 400 + 450,-1250 + 500,- 350
- + 500,-1250 + 500,-1250 + 450,- 400 + 500,- 350
- + 500,- 400 + 450,-1250 + 500,- 400 + 450,- 400
- + 500,-1200 + 500,-1250 + 450,-1250 + 500,-1250
- + 450,- 400 + 500,- 350 + 500,- 400 + 500,- 400
- + 450,-1250 + 500,-1250 + 450,-1250 + 500,- 400
- + 450,- 400 + 500,- 350 + 500,- 400 + 450,-1250
- + 500,-1250 + 450,-1250 + 500,- 400 + 450,-1250
- + 500,- 400 + 450,-1250 + 500,- 350 + 500,-1250
- + 500
-Duration=66200 us
+ + 450,-1250 + 450,- 450 + 450,- 400 + 450,- 400
+ + 450,-1300 + 450,- 400 + 450,- 400 + 500,- 400
+ + 450,-1250 + 450,-1300 + 450,-1250 + 450,- 400
+ + 500,- 400 + 450,- 400 + 450,-1300 + 450,- 400
+ + 450,-1250 + 450,-1300 + 450,- 400 + 500,- 400
+ + 450,- 400 + 450,-1300 + 450,- 400 + 450,- 400
+ + 500,-1250 + 450,-1250 + 450,-1300 + 450,-1250
+ + 500,- 400 + 450,- 400 + 450,- 400 + 500,- 400
+ + 450,-1300 + 450,-1250 + 500,-1250 + 450,- 400
+ + 450,- 400 + 500,- 400 + 450,- 400 + 450,-1300
+ + 450,-1250 + 450,-1300 + 450,- 400 + 450,-1300
+ + 450,- 400 + 450,-1250 + 450,- 450 + 450,-1250
+ + 450
+Sum: 66100
Send Kaseikyo_Denon variant
-Protocol=Kaseikyo_Denon Address=0xF2 Command=0x87 Raw-Data=0xA8870F20 48 bits LSB first Duration=62750 us
+Protocol=Kaseikyo_Denon Address=0xF2 Command=0x87 Raw-Data=0xA8870F20 48 bits LSB first
Send with: IrSender.sendKaseikyo_Denon(0xF2, 0x87, <numberOfRepeats>);
-rawData[100]:
- -1080600
- +3500,-1650
- + 500,- 350 + 500,- 400 + 500,-1200 + 500,- 400
- + 450,-1250 + 500,- 350 + 500,-1250 + 500,- 350
- + 500,- 400 + 500,-1200 + 500,- 400 + 450,- 400
- + 500,-1250 + 450,-1250 + 500,- 350 + 500,- 400
- + 500,- 350 + 500,- 350 + 500,- 400 + 500,- 350
- + 500,- 400 + 450,-1250 + 500,- 350 + 500,- 400
- + 450,-1250 + 500,-1250 + 450,-1250 + 500,-1250
- + 450,- 400 + 500,- 350 + 500,- 400 + 500,- 400
- + 450,-1250 + 500,-1250 + 450,-1250 + 500,- 400
- + 450,- 400 + 500,- 350 + 500,- 400 + 450,-1250
- + 500,- 400 + 450,- 400 + 500,- 350 + 500,-1250
- + 450,- 400 + 500,-1250 + 450,- 400 + 500,-1200
- + 500
-Duration=62750 us
+rawData[100]:
+ -1078550
+ +3450,-1750
+ + 450,- 400 + 450,- 400 + 500,-1250 + 450,- 400
+ + 450,-1300 + 450,- 400 + 450,-1250 + 450,- 450
+ + 450,- 400 + 450,-1300 + 450,- 400 + 450,- 400
+ + 450,-1300 + 450,-1250 + 450,- 450 + 450,- 400
+ + 450,- 400 + 500,- 400 + 450,- 400 + 450,- 450
+ + 450,- 400 + 450,-1250 + 450,- 450 + 450,- 400
+ + 450,-1250 + 500,-1250 + 450,-1250 + 450,-1300
+ + 450,- 400 + 450,- 400 + 500,- 350 + 500,- 400
+ + 450,-1300 + 450,-1250 + 450,-1300 + 450,- 400
+ + 450,- 400 + 450,- 450 + 450,- 400 + 450,-1300
+ + 450,- 400 + 450,- 400 + 500,- 400 + 450,-1250
+ + 500,- 400 + 450,-1250 + 450,- 450 + 450,-1250
+ + 450
+Sum: 62700
Send Denon
-Protocol=Denon Address=0x12 Command=0x87 Raw-Data=0x10F2 15 bits LSB first Duration=22150 us
+Protocol=Denon Address=0x12 Command=0x87 Raw-Data=0x10F2 15 bits LSB first
Send with: IrSender.sendDenon(0x12, 0x87, <numberOfRepeats>);
-rawData[32]:
- -1078350
- + 350,- 700 + 300,-1750 + 350,- 700 + 350,- 700
- + 350,-1700 + 350,-1750 + 300,-1750 + 350,-1750
- + 300,- 750 + 300,- 700 + 350,- 700 + 350,- 700
- + 300,-1750 + 350,- 700 + 350,- 700 + 350
-Duration=22150 us
+rawData[32]:
+ -1076250
+ + 300,- 750 + 300,-1750 + 300,- 750 + 300,- 750
+ + 300,-1750 + 300,-1800 + 300,-1750 + 300,-1800
+ + 250,- 750 + 300,- 750 + 300,- 750 + 300,- 750
+ + 300,-1750 + 300,- 750 + 300,- 750 + 300
+Sum: 22100
Send Denon/Sharp variant
-Protocol=Denon Address=0x12 Command=0x87 Raw-Data=0x30F2 15 bits LSB first Duration=23200 us
-Send with: IrSender.sendDenon(0x12, 0x87, <numberOfRepeats>);
-rawData[32]:
- -1020850
- + 350,- 700 + 350,-1750 + 300,- 700 + 350,- 700
- + 350,-1750 + 300,-1750 + 350,-1700 + 350,-1750
- + 300,- 750 + 300,- 750 + 300,- 700 + 350,- 700
- + 350,-1750 + 300,-1750 + 350,- 700 + 350
-Duration=23200 us
-
-Send Sony/SIRCS with 7 command and 5 address bits
-Protocol=Sony Address=0x12 Command=0x7 Raw-Data=0x907 12 bits LSB first Duration=19850 us
-Send with: IrSender.sendSony(0x12, 0x7, 2, 12);
-rawData[26]:
- -1022950
- +2450,- 550
- +1250,- 550 +1250,- 550 +1250,- 550 + 650,- 550
- + 650,- 550 + 650,- 550 + 650,- 550 + 650,- 550
- +1250,- 550 + 650,- 550 + 650,- 550 +1250
-Duration=19850 us
-
-
+Protocol=Sharp Address=0x12 Command=0x87 Raw-Data=0x50F2 15 bits LSB first
+Send with: IrSender.sendSharp(0x12, 0x87, <numberOfRepeats>);
+rawData[32]:
+ -1018800
+ + 300,- 700 + 300,-1800 + 250,- 750 + 300,- 750
+ + 300,-1800 + 250,-1800 + 300,-1750 + 300,-1800
+ + 300,- 750 + 250,- 750 + 300,- 750 + 300,- 750
+ + 300,-1750 + 300,- 750 + 300,-1800 + 250
+Sum: 23050
diff --git a/lib/IRremote/examples/UnitTest/UnitTest_64bit.log b/lib/IRremote/examples/UnitTest/UnitTest_64bit.log
index 7def9abb..96c2bffe 100644
--- a/lib/IRremote/examples/UnitTest/UnitTest_64bit.log
+++ b/lib/IRremote/examples/UnitTest/UnitTest_64bit.log
@@ -524,21 +524,6 @@ rawData[36]:
+ 550
Sum: 23450
-Send RC6A with 14 bit 0x2711 as extra
-Protocol=RC6A Address=0xF1 Command=0x76 Extra=0x2711 Toggle=1 Raw-Data=0xA711F176 35 bits MSB first
-Send with: IrSender.sendRC6A(0xF1, 0x76, <numberOfRepeats>, 0x2711);
-rawData[58]:
- -1032900
- +2650,- 900
- + 450,- 450 + 450,- 450 + 450,- 850 +1400,-1300
- + 950,- 850 + 500,- 400 + 950,- 400 + 500,- 450
- + 450,- 850 + 500,- 400 + 500,- 400 + 950,- 850
- + 500,- 400 + 500,- 400 + 950,- 450 + 450,- 450
- + 450,- 450 + 450,- 400 + 500,- 850 + 500,- 400
- + 500,- 400 + 950,- 850 + 950,- 400 + 500,- 400
- + 500,- 850 + 950,- 450 + 450,- 850 + 500
-Sum: 36850
-
Send Bang&Olufsen
- ENABLE_BEO_WITHOUT_FRAME_GAP is enabled
- Now print raw data and try to decode the first 6 entries, which results in rawData 0x0!
diff --git a/lib/IRremote/keywords.txt b/lib/IRremote/keywords.txt
index a67cd0ed..935f913e 100644
--- a/lib/IRremote/keywords.txt
+++ b/lib/IRremote/keywords.txt
@@ -16,40 +16,35 @@ decodedIRData KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
-# IRReceive
-available KEYWORD2
-begin KEYWORD2
-decode KEYWORD2
-disableIRIn KEYWORD2
-enableIRIn KEYWORD2
-isIdle KEYWORD2
-printActiveIRProtocols KEYWORD2
-printIRResultMinimal KEYWORD2
-printIRResultRawFormatted KEYWORD2
+
+setFeedbackLED KEYWORD2
+enableLEDFeedback KEYWORD2
+enableLEDFeedbackForSend KEYWORD2
+disableLEDFeedback KEYWORD2
+disableLEDFeedbackForSend KEYWORD2
printIRResultShort KEYWORD2
-printIRSendUsage KEYWORD2
-registerReceiveCompleteCallback KEYWORD2
-restartAfterSend KEYWORD2
-restartTimer KEYWORD2
-restartTimerWithTicksToAdd KEYWORD2
-resume KEYWORD2
-setReceivePin KEYWORD2
+begin KEYWORD2
start KEYWORD2
+available KEYWORD2
read KEYWORD2
stop KEYWORD2
end KEYWORD2
-
-# IRSend
+enableLEDFeedback KEYWORD2
+decode KEYWORD2
+resume KEYWORD2
+enableIRIn KEYWORD2
+disableIRIn KEYWORD2
+sendNEC KEYWORD2
setSendPin KEYWORD2
write KEYWORD2
+enableIROut KEYWORD2
+IRLedOff KEYWORD2
sendRaw KEYWORD2
sendJVC KEYWORD2
sendLG KEYWORD2
-sendLG2 KEYWORD2
-sendLG2Repeat KEYWORD2
+sendLGRepeat KEYWORD2
sendLGRaw KEYWORD2
sendNEC KEYWORD2
-sendNEC2 KEYWORD2
sendNECRepeat KEYWORD2
sendNECRaw KEYWORD2
sendOnkyo KEYWORD2
@@ -72,41 +67,18 @@ sendMagiQuest KEYWORD2
sendPronto KEYWORD2
sendMagiQuest KEYWORD2
sendFAST KEYWORD2
-
-# IRFeedbackLED
-disableLEDFeedback KEYWORD2
-disableLEDFeedbackForSend KEYWORD2
-enableLEDFeedback KEYWORD2
-enableLEDFeedbackForSend KEYWORD2
-setFeedbackLED KEYWORD2
-setLEDFeedback KEYWORD2
-
-# TinyIRReceiver
-disablePCIInterruptForTinyReceiver KEYWORD2
-enablePCIInterruptForTinyReceiver KEYWORD2
-initPCIInterruptForTinyReceiver KEYWORD2
-isIRReceiverAttachedForTinyReceiver KEYWORD2
-printTinyReceiverResultMinimal KEYWORD2
-TinyReceiverDecode KEYWORD2
-# TinyIRSender
-sendExtendedNEC KEYWORD2
-sendFAST KEYWORD2
-
#######################################
# Constants (LITERAL1)
#######################################
-UNKNOWN LITERAL1
PULSE_DISTANCE LITERAL1
PULSE_WIDTH LITERAL1
-APPLE LITERAL1
DENON LITERAL1
+DISH LITERAL1
JVC LITERAL1
LG LITERAL1
LG2 LITERAL1
NEC LITERAL1
-NEC2 LITERAL1
-ONKYO LITERAL1
PANASONIC LITERAL1
KASEIKYO LITERAL1
KASEIKYO_JVC LITERAL1
@@ -115,58 +87,18 @@ KASEIKYO_SHARP LITERAL1
KASEIKYO_MITSUBISHI LITERAL1
RC5 LITERAL1
RC6 LITERAL1
-RC6A LITERAL1
SAMSUNG LITERAL1
-SAMSUNGLG LITERAL1
-SAMSUNG48 LITERAL1
SHARP LITERAL1
SONY LITERAL1
+ONKYO LITERAL1
+APPLE LITERAL1
BANG_OLUFSEN LITERAL1
BOSEWAVE LITERAL1
LEGO_PF LITERAL1
MAGIQUEST LITERAL1
WHYNTER LITERAL1
FAST LITERAL1
-
-IRDATA_FLAGS_IS_REPEAT LITERAL1
-IRDATA_FLAGS_IS_AUTO_REPEAT LITERAL1
-IRDATA_FLAGS_PARITY_FAILED LITERAL1
-IRDATA_FLAGS_TOGGLE_BIT LITERAL1
-IRDATA_FLAGS_EXTRA_INFO LITERAL1
-IRDATA_FLAGS_WAS_OVERFLOW LITERAL1
-IRDATA_FLAGS_IS_MSB_FIRST LITERAL1
-
-
-RAW_BUFFER_LENGTH LITERAL1
-EXCLUDE_UNIVERSAL_PROTOCOLS LITERAL1
-EXCLUDE_EXOTIC_PROTOCOLS LITERAL1
-DECODE_STRICT_CHECKS LITERAL1
-IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK LITERAL1
-MARK_EXCESS_MICROS LITERAL1
-RECORD_GAP_MICROS LITERAL1
-DISTANCE_WIDTH_DECODER_DURATION_ARRAY_SIZE LITERAL1
-IR_INPUT_IS_ACTIVE_HIGH LITERAL1
-IR_SEND_PIN LITERAL1
-SEND_PWM_BY_TIMER LITERAL1
-IR_SEND_DUTY_CYCLE_PERCENT LITERAL1
-USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN LITERAL1
-USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN LITERAL1
-USE_NO_SEND_PWM LITERAL1
-USE_ACTIVE_HIGH_OUTPUT_FOR_NO_SEND_PWM LITERAL1
-DISABLE_CODE_FOR_RECEIVER LITERAL1
-FEEDBACK_LED_IS_ACTIVE_LOW LITERAL1
-NO_LED_FEEDBACK_CODE LITERAL1
-NO_LED_RECEIVE_FEEDBACK_CODE LITERAL1
-NO_LED_SEND_FEEDBACK_CODE LITERAL1
-MICROS_PER_TICK LITERAL1
-TOLERANCE_FOR_DECODERS_MARK_OR_SPACE_MATCHING_PERCENT LITERAL1
-
-# Constants for TinyIRReceiver
+UNKNOWN LITERAL1
IR_RECEIVE_PIN LITERAL1
-IR_FEEDBACK_LED_PIN LITERAL1
-DISABLE_PARITY_CHECKS LITERAL1
-USE_EXTENDED_NEC_PROTOCOL LITERAL1
-USE_ONKYO_PROTOCOL LITERAL1
-USE_FAST_PROTOCOL LITERAL1
-ENABLE_NEC2_REPEATS LITERAL1
-USE_CALLBACK_FOR_TINY_RECEIVER LITERAL1
+IR_SEND_PIN LITERAL1
+FEEDBACK_LED_IS_ACTIVE_LOW LITERAL1
diff --git a/lib/IRremote/library.json b/lib/IRremote/library.json
index 62260bdf..cda754b2 100644
--- a/lib/IRremote/library.json
+++ b/lib/IRremote/library.json
@@ -1,14 +1,15 @@
{
"name": "IRremote",
- "version": "4.4.3",
- "description": "Send and receive infrared signals with multiple protocols",
"keywords": "communication, infrared, ir, remote",
- "homepage": "https://github.com/Arduino-IRremote/Arduino-IRremote",
+ "description": "Send and receive infrared signals with multiple protocols",
"repository":
{
"type": "git",
"url": "https://github.com/Arduino-IRremote/Arduino-IRremote.git"
},
+ "version": "4.4.1",
+ "frameworks": "arduino",
+ "platforms": ["atmelavr", "atmelmegaavr", "atmelsam", "espressif8266", "espressif32", "ststm32"],
"authors" :
[
{
@@ -25,10 +26,5 @@
}
],
- "license": "MIT",
- "frameworks": "arduino",
- "platforms": ["atmelavr", "atmelmegaavr", "atmelsam", "espressif8266", "espressif32", "ststm32", "raspberrypi"],
- "headers": "IRRemote.hpp",
- "examples": "examples/*/*.ino",
- "export": {"exclude": [".github", "pictures"]}
+ "headers": "IRRemote.hpp"
}
diff --git a/lib/IRremote/library.properties b/lib/IRremote/library.properties
index b5c0b1eb..e42b826e 100644
--- a/lib/IRremote/library.properties
+++ b/lib/IRremote/library.properties
@@ -1,9 +1,9 @@
name=IRremote
-version=4.4.3
+version=4.4.1
author=shirriff, z3t0, ArminJo
maintainer=Armin Joachimsmeyer <[email protected]>
sentence=Send and receive infrared signals with multiple protocols
-paragraph=Currently included protocols: Denon / Sharp, JVC, LG / LG2, NEC / Onkyo / Apple, Panasonic / Kaseikyo, RC5, RC6, Samsung, Sony, (Pronto), BangOlufsen, BoseWave, Lego, Whynter, FAST, MagiQuest, Universal Pulse Distance and Pulse Width.
+paragraph=Currently included protocols: Denon / Sharp, JVC, LG / LG2, NEC / Onkyo / Apple, Panasonic / Kaseikyo, RC5, RC6, Samsung, Sony, (Pronto), BangOlufsen, BoseWave, Lego, Whynter, FAST, MagiQuest, Universal Pulse Distance and Pulse Width. NEW: TinyRSender improvements, sendSamsung bug fixes, new fields rawlen and initialGap and new functions stop/startTimer...().
category=Communication
url=https://github.com/Arduino-IRremote/Arduino-IRremote
architectures=avr,megaavr,samd,esp8266,esp32,stm32,STM32F1,mbed,mbed_nano,rp2040,mbed_rp2040,renesas_uno
diff --git a/lib/IRremote/pictures/IR_UnitTest_delay.bmp b/lib/IRremote/pictures/IR_UnitTest_delay.bmp
new file mode 100644
index 00000000..00e17dd4
Binary files /dev/null and b/lib/IRremote/pictures/IR_UnitTest_delay.bmp differ
diff --git a/lib/IRremote/src/IRFeedbackLED.hpp b/lib/IRremote/src/IRFeedbackLED.hpp
index 0db0c02f..97611b08 100644
--- a/lib/IRremote/src/IRFeedbackLED.hpp
+++ b/lib/IRremote/src/IRFeedbackLED.hpp
@@ -47,7 +47,7 @@ struct FeedbackLEDControlStruct {
struct FeedbackLEDControlStruct FeedbackLEDControl; ///< The feedback LED control instance
/**
- * Enables blinking of feedback LED (LED_BUILTIN is taken as default) on IR sending and receiving
+ * Enable blinking of feedback LED (LED_BUILTIN is taken as default) on IR sending and receiving
* Cannot disable it here!!! Use disableLEDFeedbackForReceive() or disableLEDFeedbackForSend()
* @param aFeedbackLEDPin If aFeedbackLEDPin == 0, then take board specific FEEDBACK_LED_ON() and FEEDBACK_LED_ON() and FEEDBACK_LED_OFF() functions
* If FeedbackLEDPin == 0 and no LED_BUILTIN defined, disable LED feedback
@@ -108,35 +108,33 @@ IRAM_ATTR
void setFeedbackLED(bool aSwitchLedOn) {
if (aSwitchLedOn) {
if (FeedbackLEDControl.FeedbackLEDPin != USE_DEFAULT_FEEDBACK_LED_PIN) {
- // Turn user defined pin LED on
#if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- if (__builtin_constant_p(FeedbackLEDControl.FeedbackLEDPin) ) { digitalWriteFast(FeedbackLEDControl.FeedbackLEDPin, LOW);} else { digitalWrite(FeedbackLEDControl.FeedbackLEDPin, LOW);}
+ digitalWriteFast(FeedbackLEDControl.FeedbackLEDPin, LOW); // Turn user defined pin LED on
#else
- if (__builtin_constant_p(FeedbackLEDControl.FeedbackLEDPin) ) { digitalWriteFast(FeedbackLEDControl.FeedbackLEDPin, HIGH);} else { digitalWrite(FeedbackLEDControl.FeedbackLEDPin, HIGH);}
+ digitalWriteFast(FeedbackLEDControl.FeedbackLEDPin, HIGH); // Turn user defined pin LED on
#endif
#if defined(LED_BUILTIN) // use fast macros here
- } else {
+ } else {
# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(LED_BUILTIN, LOW); // For AVR, this generates a single cbi command
+ digitalWriteFast(LED_BUILTIN, LOW); // For AVR, this generates a single cbi command
# else
- digitalWriteFast(LED_BUILTIN, HIGH); // For AVR, this generates a single sbi command
+ digitalWriteFast(LED_BUILTIN, HIGH); // For AVR, this generates a single sbi command
# endif
#endif
}
} else {
if (FeedbackLEDControl.FeedbackLEDPin != USE_DEFAULT_FEEDBACK_LED_PIN) {
- // Turn user defined pin LED off
#if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- if (__builtin_constant_p(FeedbackLEDControl.FeedbackLEDPin) ) { digitalWriteFast(FeedbackLEDControl.FeedbackLEDPin, HIGH);} else { digitalWrite(FeedbackLEDControl.FeedbackLEDPin, HIGH);}
+ digitalWriteFast(FeedbackLEDControl.FeedbackLEDPin, HIGH); // Turn user defined pin LED off
#else
- if (__builtin_constant_p(FeedbackLEDControl.FeedbackLEDPin) ) { digitalWriteFast(FeedbackLEDControl.FeedbackLEDPin, LOW);} else { digitalWrite(FeedbackLEDControl.FeedbackLEDPin, LOW);}
+ digitalWriteFast(FeedbackLEDControl.FeedbackLEDPin, LOW); // Turn user defined pin LED off
#endif
#if defined(LED_BUILTIN)
- } else {
+ } else {
# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(LED_BUILTIN, HIGH); // For AVR, this generates a single sbi command
+ digitalWriteFast(LED_BUILTIN, HIGH); // For AVR, this generates a single sbi command
# else
- digitalWriteFast(LED_BUILTIN, LOW); // For AVR, this generates a single cbi command
+ digitalWriteFast(LED_BUILTIN, LOW); // For AVR, this generates a single cbi command
# endif
#endif
}
diff --git a/lib/IRremote/src/IRProtocol.h b/lib/IRremote/src/IRProtocol.h
index 8f144589..7a2bebdd 100644
--- a/lib/IRremote/src/IRProtocol.h
+++ b/lib/IRremote/src/IRProtocol.h
@@ -8,7 +8,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2020-2025 Armin Joachimsmeyer
+ * Copyright (c) 2020-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -57,7 +57,6 @@ typedef enum {
KASEIKYO_MITSUBISHI,
RC5,
RC6,
- RC6A, /*31 bit + 3 fixed 0b110 mode bits*/
SAMSUNG, /* 20*/
SAMSUNGLG,
SAMSUNG48,
@@ -101,7 +100,7 @@ struct DistanceWidthTimingInfoStruct {
#define IRDATA_FLAGS_IS_MSB_FIRST 0x80 ///< Value is mainly determined by the (known) protocol.
#define IRDATA_FLAGS_IS_LSB_FIRST 0x00
-#define DECODED_RAW_DATA_ARRAY_SIZE ((((RAW_BUFFER_LENGTH - 2) - 1) / (2 * BITS_IN_RAW_DATA_TYPE)) + 1) // The -2 is for initial gap + stop bit mark, 128 mark + spaces for 64 bit.
+#define RAW_DATA_ARRAY_SIZE ((((RAW_BUFFER_LENGTH - 2) - 1) / (2 * BITS_IN_RAW_DATA_TYPE)) + 1) // The -2 is for initial gap + stop bit mark, 128 mark + spaces for 64 bit.
/**
* Data structure for the user application, available as decodedIRData.
* Filled by decoders and read by print functions or user application.
@@ -115,7 +114,7 @@ struct IRData {
#if defined(DECODE_DISTANCE_WIDTH)
// This replaces the address, command, extra and decodedRawData in case of protocol == PULSE_DISTANCE or -rather seldom- protocol == PULSE_WIDTH.
DistanceWidthTimingInfoStruct DistanceWidthTimingInfo; // 12 bytes
- IRRawDataType decodedRawDataArray[DECODED_RAW_DATA_ARRAY_SIZE]; ///< 32/64 bit decoded raw data, to be used for send function.
+ IRRawDataType decodedRawDataArray[RAW_DATA_ARRAY_SIZE]; ///< 32/64 bit decoded raw data, to be used for send function.
#endif
uint16_t numberOfBits; ///< Number of bits received for data (address + command + parity) - to determine protocol length if different length are possible.
uint8_t flags; ///< IRDATA_FLAGS_IS_REPEAT, IRDATA_FLAGS_WAS_OVERFLOW etc. See IRDATA_FLAGS_* definitions above
@@ -132,8 +131,6 @@ struct IRData {
irparams_struct *rawDataPtr; ///< Pointer of the raw timing data to be decoded. Mainly the OverflowFlag and the data buffer filled by receiving ISR.
};
-extern uint8_t sLastSendToggleValue; // Currently used by RC5 + RC6
-
struct PulseDistanceWidthProtocolConstants {
decode_type_t ProtocolIndex;
uint_fast8_t FrequencyKHz;
@@ -171,8 +168,7 @@ const __FlashStringHelper* getProtocolString(decode_type_t aProtocol);
#else
const char* getProtocolString(decode_type_t aProtocol);
#endif
-void printIRResultShort(Print *aSerial, IRData *aIRDataPtr, bool aPrintRepeatGap) __attribute__ ((deprecated ("Remove last parameter, it is not supported any more.")));
-void printIRResultShort(Print *aSerial, IRData *aIRDataPtr); // A static function to be able to print send or copied received data.
+void printIRResultShort(Print *aSerial, IRData *aIRDataPtr, bool aPrintGap); // A static function to be able to print send or copied received data.
/*
* Convenience functions to convert MSB to LSB values
diff --git a/lib/IRremote/src/IRProtocol.hpp b/lib/IRremote/src/IRProtocol.hpp
index bed8fa7a..e8c7a554 100644
--- a/lib/IRremote/src/IRProtocol.hpp
+++ b/lib/IRremote/src/IRProtocol.hpp
@@ -33,7 +33,7 @@
#ifndef _IR_PROTOCOL_HPP
#define _IR_PROTOCOL_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -62,7 +62,6 @@ const char string_Kaseikyo_JVC[] PROGMEM = "Kaseikyo_JVC";
const char string_Kaseikyo_Mitsubishi[] PROGMEM = "Kaseikyo_Mitsubishi";
const char string_RC5[] PROGMEM = "RC5";
const char string_RC6[] PROGMEM = "RC6";
-const char string_RC6A[] PROGMEM = "RC6A";
const char string_Samsung[] PROGMEM = "Samsung";
const char string_SamsungLG[] PROGMEM = "SamsungLG";
const char string_Samsung48[] PROGMEM = "Samsung48";
@@ -81,8 +80,8 @@ const char string_FAST[] PROGMEM = "FAST";
const char *const ProtocolNames[]
PROGMEM = { string_Unknown, string_PulseWidth, string_PulseDistance, string_Apple, string_Denon, string_JVC, string_LG, string_LG2,
string_NEC, string_NEC2, string_Onkyo, string_Panasonic, string_Kaseikyo, string_Kaseikyo_Denon, string_Kaseikyo_Sharp,
- string_Kaseikyo_JVC, string_Kaseikyo_Mitsubishi, string_RC5, string_RC6, string_RC6A, string_Samsung, string_SamsungLG,
- string_Samsung48, string_Sharp, string_Sony
+ string_Kaseikyo_JVC, string_Kaseikyo_Mitsubishi, string_RC5, string_RC6, string_Samsung, string_SamsungLG, string_Samsung48,
+ string_Sharp, string_Sony
#if !defined(EXCLUDE_EXOTIC_PROTOCOLS)
, string_BangOlufsen, string_BoseWave, string_Lego, string_MagiQuest, string_Whynter, string_FAST
#endif
@@ -150,10 +149,6 @@ namespace PrintULL {
# endif
#endif
-/** @}
- * \addtogroup Print Print functions
- * @{
- */
/**
* Function to print decoded result and flags in one line.
* A static function to be able to print data to send or copied received data.
@@ -165,10 +160,6 @@ namespace PrintULL {
*
*/
void printIRResultShort(Print *aSerial, IRData *aIRDataPtr, bool aPrintRepeatGap) {
- (void) aPrintRepeatGap;
- printIRResultShort(aSerial, aIRDataPtr);
-}
-void printIRResultShort(Print *aSerial, IRData *aIRDataPtr) {
if (aIRDataPtr->flags & IRDATA_FLAGS_WAS_OVERFLOW) {
aSerial->println(F("Overflow"));
return;
@@ -218,6 +209,22 @@ void printIRResultShort(Print *aSerial, IRData *aIRDataPtr) {
#if defined(DECODE_DISTANCE_WIDTH)
}
#endif
+ if (aIRDataPtr->flags & (IRDATA_FLAGS_IS_AUTO_REPEAT | IRDATA_FLAGS_IS_REPEAT)) {
+ aSerial->print(' ');
+ if (aIRDataPtr->flags & IRDATA_FLAGS_IS_AUTO_REPEAT) {
+ aSerial->print(F("Auto-"));
+ }
+ aSerial->print(F("Repeat"));
+#if !defined(DISABLE_CODE_FOR_RECEIVER)
+ if (aPrintRepeatGap) {
+ aSerial->print(F(" gap="));
+ aSerial->print((uint32_t) aIRDataPtr->initialGapTicks * MICROS_PER_TICK);
+ aSerial->print(F("us"));
+ }
+#else
+ (void)aPrintRepeatGap;
+#endif
+ }
/*
* Print raw data
@@ -237,44 +244,17 @@ void printIRResultShort(Print *aSerial, IRData *aIRDataPtr) {
aSerial->print(F(" bits"));
if (aIRDataPtr->flags & IRDATA_FLAGS_IS_MSB_FIRST) {
- aSerial->print(F(" MSB first"));
+ aSerial->println(F(" MSB first"));
} else {
- aSerial->print(F(" LSB first"));
- }
- }
-
- /*
- * Print gap and duration, in order to be able to compute the repeat period of the protocol by adding the next gap time
- */
- if (aIRDataPtr->flags & (IRDATA_FLAGS_IS_AUTO_REPEAT | IRDATA_FLAGS_IS_REPEAT)) {
- aSerial->print(' ');
- if (aIRDataPtr->flags & IRDATA_FLAGS_IS_AUTO_REPEAT) {
- aSerial->print(F("Auto-"));
+ aSerial->println(F(" LSB first"));
}
- aSerial->print(F("Repeat"));
- }
-#if !defined(DISABLE_CODE_FOR_RECEIVER)
- aSerial->print(F(" Gap="));
- aSerial->print((uint32_t) aIRDataPtr->initialGapTicks * MICROS_PER_TICK);
- aSerial->print(F("us"));
- uint16_t tSumOfDurationTicks = 0;
- for (IRRawlenType i = 1; i < aIRDataPtr->rawlen; i++) {
- tSumOfDurationTicks += aIRDataPtr->rawDataPtr->rawbuf[i];
+ } else {
+ aSerial->println();
}
- aSerial->print(F(" Duration="));
- aSerial->print((uint32_t) tSumOfDurationTicks * MICROS_PER_TICK, DEC);
- aSerial->println(F("us"));
-#else
- aSerial->println();
-#endif
}
}
-/** @}
- * \addtogroup Utils Utility functions
- * @{
- */
/**********************************************************************************************************************
* Function to bit reverse OLD MSB values of e.g. NEC.
**********************************************************************************************************************/
diff --git a/lib/IRremote/src/IRReceive.hpp b/lib/IRremote/src/IRReceive.hpp
index bf13923c..ec7963d4 100644
--- a/lib/IRremote/src/IRReceive.hpp
+++ b/lib/IRremote/src/IRReceive.hpp
@@ -33,7 +33,7 @@
#ifndef _IR_RECEIVE_HPP
#define _IR_RECEIVE_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
//#define LOCAL_DEBUG //
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -71,7 +71,7 @@ unsigned long sMicrosAtLastStopTimer = 0; // Used to adjust TickCounterForISR wi
IRrecv::IRrecv() {
decodedIRData.rawDataPtr = &irparams; // for decodePulseDistanceData() etc.
setReceivePin(0);
-#if !defined(NO_LED_RECEIVE_FEEDBACK_CODE)
+#if !defined(NO_LED_FEEDBACK_CODE)
setLEDFeedback(0, DO_NOT_ENABLE_LED_FEEDBACK);
#endif
}
@@ -79,7 +79,7 @@ IRrecv::IRrecv() {
IRrecv::IRrecv(uint_fast8_t aReceivePin) {
decodedIRData.rawDataPtr = &irparams; // for decodePulseDistanceData() etc.
setReceivePin(aReceivePin);
-#if !defined(NO_LED_RECEIVE_FEEDBACK_CODE)
+#if !defined(NO_LED_FEEDBACK_CODE)
setLEDFeedback(0, DO_NOT_ENABLE_LED_FEEDBACK);
#endif
}
@@ -92,7 +92,7 @@ IRrecv::IRrecv(uint_fast8_t aReceivePin) {
IRrecv::IRrecv(uint_fast8_t aReceivePin, uint_fast8_t aFeedbackLEDPin) {
decodedIRData.rawDataPtr = &irparams; // for decodePulseDistanceData() etc.
setReceivePin(aReceivePin);
-#if !defined(NO_LED_RECEIVE_FEEDBACK_CODE)
+#if !defined(NO_LED_FEEDBACK_CODE)
setLEDFeedback(aFeedbackLEDPin, DO_NOT_ENABLE_LED_FEEDBACK);
#else
(void) aFeedbackLEDPin;
@@ -167,18 +167,15 @@ void IRReceiveTimerInterruptHandler() {
* Initialize all state machine variables
*/
irparams.OverflowFlag = false;
- // irparams.rawbuf[0] = irparams.TickCounterForISR;
- // Usage of initialGapTicks enables usage of 8 bit buffer instead of 16 bit since 4.4,
- // because the big gap value is not stored in this buffer any more
- irparams.initialGapTicks = irparams.TickCounterForISR;
+// irparams.rawbuf[0] = irparams.TickCounterForISR;
+ irparams.initialGapTicks = irparams.TickCounterForISR; // Enabling 8 bit buffer since 4.4
irparams.rawlen = 1;
irparams.StateForISR = IR_REC_STATE_MARK;
} // otherwise stay in idle state
irparams.TickCounterForISR = 0; // reset counter in both cases
}
- } else if (irparams.StateForISR == IR_REC_STATE_MARK) {
- // Timing mark here, rawlen is even
+ } else if (irparams.StateForISR == IR_REC_STATE_MARK) { // Timing mark
if (tIRInputLevel != INPUT_MARK) {
/*
* Mark ended here. Record mark time in rawbuf array
@@ -191,18 +188,35 @@ void IRReceiveTimerInterruptHandler() {
irparams.TickCounterForISR = 0; // This resets the tick counter also at end of frame :-)
}
- } else if (irparams.StateForISR == IR_REC_STATE_SPACE) {
- /*
- * In space receiving here, rawlen is odd
- * Check for timeout or overflow
- */
- if (irparams.TickCounterForISR > RECORD_GAP_TICKS || irparams.rawlen >= RAW_BUFFER_LENGTH - 1) {
+ } else if (irparams.StateForISR == IR_REC_STATE_SPACE) { // Timing space
+ if (tIRInputLevel == INPUT_MARK) {
+ /*
+ * Space ended here. Check for overflow and record space time in rawbuf array
+ */
if (irparams.rawlen >= RAW_BUFFER_LENGTH) {
// Flag up a read OverflowFlag; Stop the state machine
irparams.OverflowFlag = true;
+ irparams.StateForISR = IR_REC_STATE_STOP;
+#if !defined(IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK)
+ /*
+ * Call callback if registered (not NULL)
+ */
+ if (irparams.ReceiveCompleteCallbackFunction != NULL) {
+ irparams.ReceiveCompleteCallbackFunction();
+ }
+#endif
+ } else {
+#if defined(_IR_MEASURE_TIMING) && defined(_IR_TIMING_TEST_PIN)
+// digitalWriteFast(_IR_TIMING_TEST_PIN, HIGH); // 2 clock cycles
+#endif
+ irparams.rawbuf[irparams.rawlen++] = irparams.TickCounterForISR; // record space
+ irparams.StateForISR = IR_REC_STATE_MARK;
}
+ irparams.TickCounterForISR = 0;
+
+ } else if (irparams.TickCounterForISR > RECORD_GAP_TICKS) {
/*
- * Overflow or maximum space duration reached here.
+ * Maximum space duration reached here.
* Current code is ready for processing!
* We received a long space, which indicates gap between codes.
* Switch to IR_REC_STATE_STOP
@@ -221,23 +235,12 @@ void IRReceiveTimerInterruptHandler() {
irparams.StateForISR = IR_REC_STATE_STOP; // This signals the decode(), that a complete frame was received
#if !defined(IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK)
/*
- * Call callback if registered (not nullptr)
+ * Call callback if registered (not NULL)
*/
- if (irparams.ReceiveCompleteCallbackFunction != nullptr) {
+ if (irparams.ReceiveCompleteCallbackFunction != NULL) {
irparams.ReceiveCompleteCallbackFunction();
}
#endif
- } else if (tIRInputLevel == INPUT_MARK) {
- /*
- * Space ended here.
- */
-
-#if defined(_IR_MEASURE_TIMING) && defined(_IR_TIMING_TEST_PIN)
-// digitalWriteFast(_IR_TIMING_TEST_PIN, HIGH); // 2 clock cycles
-#endif
- irparams.rawbuf[irparams.rawlen++] = irparams.TickCounterForISR; // record space
- irparams.StateForISR = IR_REC_STATE_MARK;
- irparams.TickCounterForISR = 0;
}
} else if (irparams.StateForISR == IR_REC_STATE_STOP) {
/*
@@ -253,8 +256,8 @@ void IRReceiveTimerInterruptHandler() {
}
}
-#if !defined(NO_LED_RECEIVE_FEEDBACK_CODE)
- if (FeedbackLEDControl.LedFeedbackEnabled & LED_FEEDBACK_ENABLED_FOR_RECEIVE) {
+#if !defined(NO_LED_FEEDBACK_CODE)
+ if (FeedbackLEDControl.LedFeedbackEnabled == LED_FEEDBACK_ENABLED_FOR_RECEIVE) {
setFeedbackLED(tIRInputLevel == INPUT_MARK);
}
#endif
@@ -283,7 +286,6 @@ ISR()
/**********************************************************************************************************************
* Stream like API
**********************************************************************************************************************/
-
/**
* Initializes the receive and feedback pin
* @param aReceivePin The Arduino pin number, where a demodulating IR receiver is connected.
@@ -293,7 +295,7 @@ ISR()
void IRrecv::begin(uint_fast8_t aReceivePin, bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin) {
setReceivePin(aReceivePin);
-#if !defined(NO_LED_RECEIVE_FEEDBACK_CODE)
+#if !defined(NO_LED_FEEDBACK_CODE)
uint_fast8_t tEnableLEDFeedback = DO_NOT_ENABLE_LED_FEEDBACK;
if (aEnableLEDFeedback) {
tEnableLEDFeedback = LED_FEEDBACK_ENABLED_FOR_RECEIVE;
@@ -338,18 +340,13 @@ void IRrecv::setReceivePin(uint_fast8_t aReceivePinNumber) {
irparams.IRReceivePinPortInputRegister = portInputRegister(digitalPinToPort(aReceivePinNumber)); // requires 44 bytes PGM, even if not referenced
# endif
#endif
- // Seems to be at least required by ESP32
// Set pin mode once. pinModeFast makes no difference if used, but saves 224 if not referenced :-(
- if (__builtin_constant_p(aReceivePinNumber)) {
- pinModeFast(aReceivePinNumber, INPUT);
- } else {
- pinModeFast(aReceivePinNumber, INPUT);
- }
+ pinModeFast(aReceivePinNumber, INPUT); // Seems to be at least required by ESP32
}
#if !defined(IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK)
/**
- * Sets the function to call if a complete protocol frame has arrived
+ * Sets the function to call if a protocol message has arrived
*/
void IRrecv::registerReceiveCompleteCallback(void (*aReceiveCompleteCallbackFunction)(void)) {
irparams.ReceiveCompleteCallbackFunction = aReceiveCompleteCallbackFunction;
@@ -377,7 +374,7 @@ void IRrecv::start() {
}
/*
- * Restarts timer interrupts, adjusts TickCounterForISR for correct gap value after stopTimer(). Does not call resume()!
+ * Do not resume() reading of IR data
*/
void IRrecv::restartTimer() {
// Setup for cyclic 50 us interrupt
@@ -400,7 +397,7 @@ void IRrecv::enableIRIn() {
}
/**
- * Configures the timer and the state machine for IR reception. Does not call resume()!
+ * Configures the timer and the state machine for IR reception.
* We assume, that timer interrupts are disabled here, otherwise it makes no sense to use this functions.
* Therefore we do not need to guard the change of the volatile TickCounterForISR here :-).
* The tick counter value is already at 100 when decode() gets true, because of the 5000 us minimal gap defined in RECORD_GAP_MICROS.
@@ -417,10 +414,6 @@ void IRrecv::restartTimer(uint32_t aMicrosecondsToAddToGapCounter) {
pinModeFast(_IR_TIMING_TEST_PIN, OUTPUT);
#endif
}
-/**
- * Configures the timer and the state machine for IR reception. Does not call resume()!
- * @param aTicksToAddToGapCounter To compensate for the amount of ticks the timer was stopped / disabled.
- */
void IRrecv::restartTimerWithTicksToAdd(uint16_t aTicksToAddToGapCounter) {
irparams.TickCounterForISR += aTicksToAddToGapCounter;
timerConfigForReceive(); // no interrupts enabled here!
@@ -525,16 +518,16 @@ bool IRrecv::available() {
}
/**
- * Returns pointer to IrReceiver.decodedIRData if IR receiver data is available, else nullptr.
+ * If IR receiver data is available, returns pointer to IrReceiver.decodedIRData, else NULL.
*/
IRData* IRrecv::read() {
if (irparams.StateForISR != IR_REC_STATE_STOP) {
- return nullptr;
+ return NULL;
}
if (decode()) {
return &decodedIRData;
} else {
- return nullptr;
+ return NULL;
}
}
@@ -988,15 +981,6 @@ bool IRrecv::decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *a
aProtocolConstants->Flags);
}
-bool IRrecv::decodePulseDistanceWidthData_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM,
- uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset) {
- PulseDistanceWidthProtocolConstants tTemporaryPulseDistanceWidthProtocolConstants;
- memcpy_P(&tTemporaryPulseDistanceWidthProtocolConstants, aProtocolConstantsPGM,
- sizeof(tTemporaryPulseDistanceWidthProtocolConstants));
-
- return decodePulseDistanceWidthData(&tTemporaryPulseDistanceWidthProtocolConstants, aNumberOfBits, aStartOffset);
-}
-
/*
* Static variables for the getBiphaselevel function
*/
@@ -1091,16 +1075,16 @@ uint_fast8_t IRrecv::compare(uint16_t oldval, uint16_t newval) {
}
/**
- * Decodes an arbitrary IR code to a 32-bit value.
+ * decodeHash - decode an arbitrary IR code.
* Instead of decoding using a standard encoding scheme
* (e.g. Sony, NEC, RC5), the code is hashed to a 32-bit value.
*
- * The algorithm looks at the sequence of MARK and SPACE signals, and see if each one
+ * The algorithm: look at the sequence of MARK and SPACE signals, and see if each one
* is shorter (0), the same length (1), or longer (2) than the previous MARK or SPACE.
- * It hash the resulting sequence of 0's, 1's, and 2's to a 32-bit value.
+ * Hash the resulting sequence of 0's, 1's, and 2's to a 32-bit value.
* This will give a unique value for each different code (probably), for most code systems.
*
- * Uses FNV hash algorithm: http://isthe.com/chongo/tech/comp/fnv/#FNV-param
+ * Use FNV hash algorithm: http://isthe.com/chongo/tech/comp/fnv/#FNV-param
* Converts the raw code values into a 32-bit hash code.
* Hopefully this code is unique for each button.
* This isn't a "real" decoding, just an arbitrary value.
@@ -1180,35 +1164,15 @@ bool IRrecv::checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants
return true;
}
-bool IRrecv::checkHeader_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM) {
-// Check header "mark" and "space"
- if (!matchMark(decodedIRData.rawDataPtr->rawbuf[1], pgm_read_word(&aProtocolConstantsPGM->DistanceWidthTimingInfo.HeaderMarkMicros))) {
-#if defined(LOCAL_TRACE)
- Serial.print(::getProtocolString(aProtocolConstantsPGM->ProtocolIndex));
- Serial.println(F(": Header mark length is wrong"));
-#endif
- return false;
- }
- if (!matchSpace(decodedIRData.rawDataPtr->rawbuf[2], pgm_read_word(&aProtocolConstantsPGM->DistanceWidthTimingInfo.HeaderSpaceMicros))) {
-#if defined(LOCAL_TRACE)
- Serial.print(::getProtocolString(aProtocolConstantsPGM->ProtocolIndex));
- Serial.println(F(": Header space length is wrong"));
-#endif
- return false;
- }
- return true;
-}
-
/*
- * Does not check for same address and command, because it is almost not possible to press 2 different buttons on the remote within around 100 ms.
+ * Do not check for same address and command, because it is almost not possible to press 2 different buttons on the remote within around 100 ms.
* And if really required, it can be enabled here, or done manually in user program.
* And we have still no RC6 toggle bit check for detecting a second press on the same button.
*/
void IRrecv::checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks) {
if (decodedIRData.initialGapTicks < aMaximumRepeatSpaceTicks
-#if defined(ENABLE_COMPLETE_REPEAT_CHECK)
-// Check also for same command and address values to detect a repeat. Not sensible for standard protocols, because it is almost not possible to press 2 different buttons on the remote within around 100 ms
- && decodedIRData.address == lastDecodedAddress && decodedIRData.command == lastDecodedCommand /* requires around 44 bytes program space */
+#if defined(ENABLE_FULL_REPEAT_CHECK)
+ && decodedIRData.address == lastDecodedAddress && decodedIRData.command == lastDecodedCommand /* requires around 85 bytes program space */
#endif
) {
decodedIRData.flags |= IRDATA_FLAGS_IS_REPEAT;
@@ -1319,8 +1283,8 @@ int getMarkExcessMicros() {
return MARK_EXCESS_MICROS;
}
-/**
- * Checks if protocol is not detected and detected space between two transmissions
+/*
+ * Check if protocol is not detected and detected space between two transmissions
* is smaller than known value for protocols (Sony with around 24 ms)
* @return true, if CheckForRecordGapsMicros() has printed a message, i.e. gap < 15ms (RECORD_GAP_MICROS_WARNING_THRESHOLD)
*/
@@ -1353,10 +1317,6 @@ void IRrecv::printActiveIRProtocols(Print *aSerial) {
// call no class function with same name
::printActiveIRProtocols(aSerial);
}
-/*
- * Prints a list of enabled protocols for this application.
- * @param aSerial pointer to serial used for printing. Use "&Serial".
- */
void printActiveIRProtocols(Print *aSerial) {
#if defined(DECODE_ONKYO)
aSerial->print(F("Onkyo, "));
@@ -1424,18 +1384,14 @@ void printActiveIRProtocols(Print *aSerial) {
* Ends with println().
*
* @param aSerial The Print object on which to write, for Arduino you can use &Serial.
+ * @param aPrintRepeatGap If true also print the gap before repeats.
* @param aCheckForRecordGapsMicros If true, call CheckForRecordGapsMicros() which may do a long printout,
* which in turn may block the proper detection of repeats.*
* @return true, if CheckForRecordGapsMicros() has printed a message, i.e. gap < 15ms (RECORD_GAP_MICROS_WARNING_THRESHOLD).
*/
-bool IRrecv::printIRResultShort(Print *aSerial, bool aPrintRepeatGap, bool aCheckForRecordGapsMicros) {
- // DEPRECATED
- (void) aPrintRepeatGap;
- return printIRResultShort(aSerial, aCheckForRecordGapsMicros);
-}
-bool IRrecv::printIRResultShort(Print *aSerial, bool aCheckForRecordGapsMicros) {
+bool IRrecv::printIRResultShort(Print *aSerial, bool aPrintRepeatGap, bool aCheckForRecordGapsMicros) {
// call no class function with same name
- ::printIRResultShort(aSerial, &decodedIRData);
+ ::printIRResultShort(aSerial, &decodedIRData, aPrintRepeatGap);
if (aCheckForRecordGapsMicros && decodedIRData.protocol != UNKNOWN) {
return checkForRecordGapsMicros(aSerial);
}
@@ -1626,8 +1582,8 @@ void IRrecv::printIRSendUsage(Print *aSerial) {
aSerial->print(F("SB_FIRST, <RepeatPeriodMillis>, <numberOfRepeats>"));
}
#endif
-#if defined(DECODE_PANASONIC) || defined(DECODE_KASEIKYO) || defined(DECODE_RC6)
- if ((decodedIRData.flags & IRDATA_FLAGS_EXTRA_INFO) && (decodedIRData.protocol == KASEIKYO || decodedIRData.protocol == RC6A)) {
+#if defined(DECODE_PANASONIC) || defined(DECODE_KASEIKYO)
+ if ((decodedIRData.flags & IRDATA_FLAGS_EXTRA_INFO) && decodedIRData.protocol == KASEIKYO) {
aSerial->print(F(", 0x"));
aSerial->print(decodedIRData.extra, HEX);
}
@@ -1681,25 +1637,6 @@ void IRrecv::printIRResultMinimal(Print *aSerial) {
}
}
-/*
- * Not used yet
- */
-void IRrecv::printIRDuration(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks) {
- uint16_t tSumOfDurationTicks = 0;
- for (IRRawlenType i = 1; i < decodedIRData.rawlen; i++) {
- tSumOfDurationTicks += decodedIRData.rawDataPtr->rawbuf[i];
- }
- aSerial->print(F("Duration="));
- if (aOutputMicrosecondsInsteadOfTicks) {
- aSerial->print((uint32_t) tSumOfDurationTicks * MICROS_PER_TICK, DEC);
- aSerial->println(F("us"));
-
- } else {
- aSerial->print(tSumOfDurationTicks, DEC);
- aSerial->println(F(" ticks"));
- }
-}
-
/**
* Dump out the timings in IrReceiver.decodedIRData.rawDataPtr->rawbuf[] array 8 values per line.
*
@@ -1780,17 +1717,12 @@ void IRrecv::printIRResultRawFormatted(Print *aSerial, bool aOutputMicrosecondsI
}
aSerial->println();
- aSerial->print(F("Duration="));
+ aSerial->print(F("Sum: "));
if (aOutputMicrosecondsInsteadOfTicks) {
- aSerial->print((uint32_t) tSumOfDurationTicks * MICROS_PER_TICK, DEC);
- aSerial->println(F("us"));
-
+ aSerial->println((uint32_t) tSumOfDurationTicks * MICROS_PER_TICK, DEC);
} else {
- aSerial->print(tSumOfDurationTicks, DEC);
- aSerial->println(F(" ticks"));
+ aSerial->println(tSumOfDurationTicks, DEC);
}
- aSerial->println();
-
}
/**
diff --git a/lib/IRremote/src/IRSend.hpp b/lib/IRremote/src/IRSend.hpp
index 756af9d9..5669b1de 100644
--- a/lib/IRremote/src/IRSend.hpp
+++ b/lib/IRremote/src/IRSend.hpp
@@ -8,7 +8,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2009-2025 Ken Shirriff, Rafi Khan, Armin Joachimsmeyer
+ * Copyright (c) 2009-2023 Ken Shirriff, Rafi Khan, Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@
#ifndef _IR_SEND_HPP
#define _IR_SEND_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -69,7 +69,7 @@ IRsend::IRsend() { // @suppress("Class members should be properly initialized")
sendPin = 0;
#endif
-#if !defined(NO_LED_SEND_FEEDBACK_CODE)
+#if !defined(NO_LED_FEEDBACK_CODE)
setLEDFeedback(0, DO_NOT_ENABLE_LED_FEEDBACK);
#endif
}
@@ -80,7 +80,7 @@ IRsend::IRsend() { // @suppress("Class members should be properly initialized")
* Simple start with defaults - LED feedback enabled! Used if IR_SEND_PIN is defined. Saves program memory.
*/
void IRsend::begin(){
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
+# if !defined(NO_LED_FEEDBACK_CODE)
setLEDFeedback(USE_DEFAULT_FEEDBACK_LED_PIN, LED_FEEDBACK_ENABLED_FOR_SEND);
# endif
#if defined(_IR_MEASURE_TIMING) && defined(_IR_TIMING_TEST_PIN)
@@ -94,7 +94,7 @@ void IRsend::begin(){
* @param aFeedbackLEDPin If 0 / USE_DEFAULT_FEEDBACK_LED_PIN, then take board specific FEEDBACK_LED_ON() and FEEDBACK_LED_OFF() functions
*/
void IRsend::begin(bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin) {
-#if !defined(NO_LED_SEND_FEEDBACK_CODE)
+#if !defined(NO_LED_FEEDBACK_CODE)
uint_fast8_t tEnableLEDFeedback = DO_NOT_ENABLE_LED_FEEDBACK;
if(aEnableLEDFeedback) {
tEnableLEDFeedback = LED_FEEDBACK_ENABLED_FOR_SEND;
@@ -109,7 +109,7 @@ void IRsend::begin(bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin) {
#else // defined(IR_SEND_PIN)
IRsend::IRsend(uint_fast8_t aSendPin) { // @suppress("Class members should be properly initialized")
sendPin = aSendPin;
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
+# if !defined(NO_LED_FEEDBACK_CODE)
setLEDFeedback(0, DO_NOT_ENABLE_LED_FEEDBACK);
# endif
}
@@ -120,7 +120,7 @@ IRsend::IRsend(uint_fast8_t aSendPin) { // @suppress("Class members should be pr
*/
void IRsend::begin(uint_fast8_t aSendPin) {
sendPin = aSendPin;
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
+# if !defined(NO_LED_FEEDBACK_CODE)
setLEDFeedback(USE_DEFAULT_FEEDBACK_LED_PIN, LED_FEEDBACK_ENABLED_FOR_SEND);
# endif
}
@@ -142,7 +142,7 @@ void IRsend::begin(uint_fast8_t aSendPin, bool aEnableLEDFeedback, uint_fast8_t
sendPin = aSendPin;
#endif
-#if !defined(NO_LED_SEND_FEEDBACK_CODE)
+#if !defined(NO_LED_FEEDBACK_CODE)
uint_fast8_t tEnableLEDFeedback = DO_NOT_ENABLE_LED_FEEDBACK;
if (aEnableLEDFeedback) {
tEnableLEDFeedback = LED_FEEDBACK_ENABLED_FOR_SEND;
@@ -408,7 +408,7 @@ size_t IRsend::write(decode_type_t aProtocol, uint16_t aAddress, uint16_t aComma
}
/**
- * Sends a 16 byte microsecond timing array.
+ * Function using an 16 byte microsecond timing array for every purpose.
* Raw data starts with a Mark. No leading space as in received timing data!
*/
void IRsend::sendRaw(const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz) {
@@ -429,7 +429,7 @@ void IRsend::sendRaw(const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLe
}
/**
- * Sends an 8 byte tick timing array to save program memory.
+ * Function using an 8 byte tick timing array to save program memory
* Raw data starts with a Mark. No leading space as in received timing data!
*/
void IRsend::sendRaw(const uint8_t aBufferWithTicks[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz) {
@@ -597,87 +597,6 @@ void IRsend::sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, uint16_
}
}
-void IRsend::sendPulseDistanceWidthFromPGMArray(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
- uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
- IRRawDataType const *aDecodedRawDataPGMArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
- int_fast8_t aNumberOfRepeats) {
-
- // Set IR carrier frequency
- enableIROut(aFrequencyKHz);
-
- uint_fast8_t tNumberOfCommands = aNumberOfRepeats + 1;
- uint_fast8_t tNumberOf32Or64BitChunks = ((aNumberOfBits - 1) / BITS_IN_RAW_DATA_TYPE) + 1;
-
-#if defined(LOCAL_DEBUG)
- // fist data
- Serial.print(F("Data[0]=0x"));
- Serial.print(aDecodedRawDataPGMArray[0], HEX);
- if (tNumberOf32Or64BitChunks > 1) {
- Serial.print(F(" Data[1]=0x"));
- Serial.print(aDecodedRawDataPGMArray[1], HEX);
- }
- Serial.print(F(" #="));
- Serial.println(aNumberOfBits);
- Serial.flush();
-#endif
-
- while (tNumberOfCommands > 0) {
- unsigned long tStartOfFrameMillis = millis();
-
- // Header
- mark(aHeaderMarkMicros);
- space(aHeaderSpaceMicros);
-
- for (uint_fast8_t i = 0; i < tNumberOf32Or64BitChunks; ++i) {
- uint8_t tNumberOfBitsForOneSend;
-
- // Manage stop bit
- uint8_t tFlags;
- if (i == (tNumberOf32Or64BitChunks - 1)) {
- // End of data
- tNumberOfBitsForOneSend = aNumberOfBits;
- tFlags = aFlags;
- } else {
- // intermediate data
- tNumberOfBitsForOneSend = BITS_IN_RAW_DATA_TYPE;
- tFlags = aFlags | SUPPRESS_STOP_BIT; // No stop bit for leading data
- }
-
- IRRawDataType tDecodedRawData;
-#if (__INT_WIDTH__ < 32)
- tDecodedRawData = pgm_read_dword(&aDecodedRawDataPGMArray[i]); // pgm_read_dword reads 32 bit on AVR
-#else
- tDecodedRawData = aDecodedRawDataPGMArray[i]; // assume non Harvard architecture here
-#endif
- sendPulseDistanceWidthData(aOneMarkMicros, aOneSpaceMicros, aZeroMarkMicros, aZeroSpaceMicros, tDecodedRawData,
- tNumberOfBitsForOneSend, tFlags);
- aNumberOfBits -= BITS_IN_RAW_DATA_TYPE;
- }
-
- tNumberOfCommands--;
- // skip last delay!
- if (tNumberOfCommands > 0) {
- /*
- * Check and fallback for wrong RepeatPeriodMillis parameter. I.e the repeat period must be greater than each frame duration.
- */
- auto tFrameDurationMillis = millis() - tStartOfFrameMillis;
- if (aRepeatPeriodMillis > tFrameDurationMillis) {
- delay(aRepeatPeriodMillis - tFrameDurationMillis);
- }
- }
- }
-}
-
-void IRsend::sendPulseDistanceWidthFromArray_P(uint_fast8_t aFrequencyKHz,
- DistanceWidthTimingInfoStruct const *aDistanceWidthTimingInfoPGM, IRRawDataType *aDecodedRawDataArray,
- uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats) {
-
- DistanceWidthTimingInfoStruct tTemporaryDistanceWidthTimingInfo;
- memcpy_P(&tTemporaryDistanceWidthTimingInfo, aDistanceWidthTimingInfoPGM, sizeof(tTemporaryDistanceWidthTimingInfo));
- sendPulseDistanceWidthFromArray(aFrequencyKHz, &tTemporaryDistanceWidthTimingInfo, aDecodedRawDataArray, aNumberOfBits, aFlags,
- aRepeatPeriodMillis, aNumberOfRepeats);
-}
-
/**
* Sends PulseDistance data from array using PulseDistanceWidthProtocolConstants
* For LSB First the LSB of array[0] is sent first then all bits until MSB of array[0]. Next is LSB of array[1] and so on.
@@ -761,104 +680,6 @@ void IRsend::sendPulseDistanceWidthFromArray(PulseDistanceWidthProtocolConstants
}
}
-void IRsend::sendPulseDistanceWidthFromArray_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM,
- IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats) {
-
- PulseDistanceWidthProtocolConstants tTemporaryPulseDistanceWidthProtocolConstants;
- memcpy_P(&tTemporaryPulseDistanceWidthProtocolConstants, aProtocolConstantsPGM,
- sizeof(tTemporaryPulseDistanceWidthProtocolConstants));
- sendPulseDistanceWidthFromArray(&tTemporaryPulseDistanceWidthProtocolConstants, aDecodedRawDataArray, aNumberOfBits,
- aNumberOfRepeats);
-}
-void IRsend::sendPulseDistanceWidthFromPGMArray_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM,
- IRRawDataType const *aDecodedRawDataPGMArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats) {
-
- PulseDistanceWidthProtocolConstants tTemporaryPulseDistanceWidthProtocolConstants;
- memcpy_P(&tTemporaryPulseDistanceWidthProtocolConstants, aProtocolConstantsPGM,
- sizeof(tTemporaryPulseDistanceWidthProtocolConstants));
- sendPulseDistanceWidthFromPGMArray(&tTemporaryPulseDistanceWidthProtocolConstants, aDecodedRawDataPGMArray, aNumberOfBits,
- aNumberOfRepeats);
-}
-
-void IRsend::sendPulseDistanceWidthFromPGMArray(PulseDistanceWidthProtocolConstants *aProtocolConstants,
- IRRawDataType const *aDecodedRawDataPGMArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats) {
-
-// Calling sendPulseDistanceWidthFromArray() costs 68 bytes program memory compared to the implementation below
-// sendPulseDistanceWidthFromArray(aProtocolConstants->FrequencyKHz, aProtocolConstants->DistanceWidthTimingInfo.HeaderMarkMicros,
-// aProtocolConstants->DistanceWidthTimingInfo.HeaderSpaceMicros,
-// aProtocolConstants->DistanceWidthTimingInfo.OneMarkMicros, aProtocolConstants->DistanceWidthTimingInfo.OneSpaceMicros,
-// aProtocolConstants->DistanceWidthTimingInfo.ZeroMarkMicros, aProtocolConstants->DistanceWidthTimingInfo.ZeroSpaceMicros,
-// aDecodedRawDataArray, aNumberOfBits, aProtocolConstants->Flags, aProtocolConstants->RepeatPeriodMillis,
-// aNumberOfRepeats);
- // Set IR carrier frequency
- enableIROut(aProtocolConstants->FrequencyKHz);
-
- uint_fast8_t tNumberOf32Or64BitChunks = ((aNumberOfBits - 1) / BITS_IN_RAW_DATA_TYPE) + 1;
-
-#if defined(LOCAL_DEBUG)
- // fist data
- Serial.print(F("Data[0]=0x"));
- Serial.print(aDecodedRawDataPGMArray[0], HEX);
- if (tNumberOf32Or64BitChunks > 1) {
- Serial.print(F(" Data[1]=0x"));
- Serial.print(aDecodedRawDataPGMArray[1], HEX);
- }
- Serial.print(F(" #="));
- Serial.println(aNumberOfBits);
- Serial.flush();
-#endif
-
- uint_fast8_t tNumberOfCommands = aNumberOfRepeats + 1;
- while (tNumberOfCommands > 0) {
- auto tStartOfFrameMillis = millis();
- auto tNumberOfBits = aNumberOfBits; // refresh value for repeats
-
- // Header
- mark(aProtocolConstants->DistanceWidthTimingInfo.HeaderMarkMicros);
- space(aProtocolConstants->DistanceWidthTimingInfo.HeaderSpaceMicros);
- uint8_t tOriginalFlags = aProtocolConstants->Flags;
-
- for (uint_fast8_t i = 0; i < tNumberOf32Or64BitChunks; ++i) {
- uint8_t tNumberOfBitsForOneSend;
-
- uint8_t tFlags;
- if (i == (tNumberOf32Or64BitChunks - 1)) {
- // End of data
- tNumberOfBitsForOneSend = tNumberOfBits;
- tFlags = tOriginalFlags;
- } else {
- // intermediate data
- tNumberOfBitsForOneSend = BITS_IN_RAW_DATA_TYPE;
- tFlags = tOriginalFlags | SUPPRESS_STOP_BIT; // No stop bit for leading data
- }
-
- IRRawDataType tDecodedRawData;
-#if (__INT_WIDTH__ < 32)
- tDecodedRawData = pgm_read_dword(&aDecodedRawDataPGMArray[i]); // pgm_read_dword reads 32 bit on AVR
-#else
- tDecodedRawData = aDecodedRawDataPGMArray[i]; // assume non Harvard architecture here
-#endif
- sendPulseDistanceWidthData(aProtocolConstants->DistanceWidthTimingInfo.OneMarkMicros,
- aProtocolConstants->DistanceWidthTimingInfo.OneSpaceMicros,
- aProtocolConstants->DistanceWidthTimingInfo.ZeroMarkMicros,
- aProtocolConstants->DistanceWidthTimingInfo.ZeroSpaceMicros, tDecodedRawData, tNumberOfBitsForOneSend, tFlags);
- tNumberOfBits -= BITS_IN_RAW_DATA_TYPE;
- }
-
- tNumberOfCommands--;
- // skip last delay!
- if (tNumberOfCommands > 0) {
- /*
- * Check and fallback for wrong RepeatPeriodMillis parameter. I.e the repeat period must be greater than each frame duration.
- */
- auto tFrameDurationMillis = millis() - tStartOfFrameMillis;
- if (aProtocolConstants->RepeatPeriodMillis > tFrameDurationMillis) {
- delay(aProtocolConstants->RepeatPeriodMillis - tFrameDurationMillis);
- }
- }
- }
-}
-
/**
* Sends PulseDistance frames and repeats
* @param aProtocolConstants The constants to use for sending this protocol.
@@ -879,7 +700,7 @@ void IRsend::sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtoc
#endif
if (aNumberOfRepeats < 0) {
- if (aProtocolConstants->SpecialSendRepeatFunction != nullptr) {
+ if (aProtocolConstants->SpecialSendRepeatFunction != NULL) {
/*
* Send only a special repeat and return
*/
@@ -898,7 +719,7 @@ void IRsend::sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtoc
while (tNumberOfCommands > 0) {
unsigned long tStartOfFrameMillis = millis();
- if (tNumberOfCommands < ((uint_fast8_t) aNumberOfRepeats + 1) && aProtocolConstants->SpecialSendRepeatFunction != nullptr) {
+ if (tNumberOfCommands < ((uint_fast8_t) aNumberOfRepeats + 1) && aProtocolConstants->SpecialSendRepeatFunction != NULL) {
// send special repeat, if specified and we are not in the first loop
aProtocolConstants->SpecialSendRepeatFunction();
} else {
@@ -923,13 +744,6 @@ void IRsend::sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtoc
}
}
}
-void IRsend::sendPulseDistanceWidth_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, IRRawDataType aData,
- uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats) {
- PulseDistanceWidthProtocolConstants tTemporaryPulseDistanceWidthProtocolConstants;
- memcpy_P(&tTemporaryPulseDistanceWidthProtocolConstants, aProtocolConstantsPGM,
- sizeof(tTemporaryPulseDistanceWidthProtocolConstants));
- sendPulseDistanceWidth(&tTemporaryPulseDistanceWidthProtocolConstants, aData, aNumberOfBits, aNumberOfRepeats);
-}
/**
* Sends PulseDistance frames and repeats.
@@ -939,7 +753,7 @@ void IRsend::sendPulseDistanceWidth_P(PulseDistanceWidthProtocolConstants const
* @param aFlags Evaluated flags are PROTOCOL_IS_MSB_FIRST and SUPPRESS_STOP_BIT. Stop bit is otherwise sent for all pulse distance protocols.
* @param aNumberOfRepeats If < 0 and a aProtocolConstants->SpecialSendRepeatFunction() is specified
* then it is called without leading and trailing space.
- * @param aSpecialSendRepeatFunction If nullptr, the first frame is repeated completely, otherwise this function is used for sending the repeat frame.
+ * @param aSpecialSendRepeatFunction If NULL, the first frame is repeated completely, otherwise this function is used for sending the repeat frame.
*/
void IRsend::sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros, IRRawDataType aData,
@@ -947,7 +761,7 @@ void IRsend::sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz, uint16_t aHeader
void (*aSpecialSendRepeatFunction)()) {
if (aNumberOfRepeats < 0) {
- if (aSpecialSendRepeatFunction != nullptr) {
+ if (aSpecialSendRepeatFunction != NULL) {
aSpecialSendRepeatFunction();
return;
} else {
@@ -962,7 +776,7 @@ void IRsend::sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz, uint16_t aHeader
while (tNumberOfCommands > 0) {
unsigned long tStartOfFrameMillis = millis();
- if (tNumberOfCommands < ((uint_fast8_t) aNumberOfRepeats + 1) && aSpecialSendRepeatFunction != nullptr) {
+ if (tNumberOfCommands < ((uint_fast8_t) aNumberOfRepeats + 1) && aSpecialSendRepeatFunction != NULL) {
// send special repeat
aSpecialSendRepeatFunction();
} else {
@@ -1003,15 +817,6 @@ void IRsend::sendPulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aPr
aProtocolConstants->DistanceWidthTimingInfo.ZeroSpaceMicros, aData, aNumberOfBits, aProtocolConstants->Flags);
}
-void IRsend::sendPulseDistanceWidthData_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, IRRawDataType aData,
- uint_fast8_t aNumberOfBits) {
-
- PulseDistanceWidthProtocolConstants tTemporaryPulseDistanceWidthProtocolConstants;
- memcpy_P(&tTemporaryPulseDistanceWidthProtocolConstants, aProtocolConstantsPGM,
- sizeof(tTemporaryPulseDistanceWidthProtocolConstants));
- sendPulseDistanceWidthData(&tTemporaryPulseDistanceWidthProtocolConstants, aData, aNumberOfBits);
-}
-
/**
* Sends PulseDistance data with timing parameters and flag parameters.
* The output always ends with a space
@@ -1142,7 +947,7 @@ void IRsend::sendBiphaseData(uint16_t aBiphaseTimeUnit, uint32_t aData, uint_fas
void IRsend::mark(uint16_t aMarkMicros) {
#if defined(SEND_PWM_BY_TIMER) || defined(USE_NO_SEND_PWM)
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
+# if !defined(NO_LED_FEEDBACK_CODE)
if (FeedbackLEDControl.LedFeedbackEnabled == LED_FEEDBACK_ENABLED_FOR_SEND) {
setFeedbackLED(true);
}
@@ -1165,7 +970,7 @@ void IRsend::mark(uint16_t aMarkMicros) {
# if defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN) && !defined(OUTPUT_OPEN_DRAIN)
// Here we have no hardware supported Open Drain outputs, so we must mimicking it
pinModeFast(sendPin, OUTPUT); // active state for mimicking open drain
-# elif defined(USE_ACTIVE_HIGH_OUTPUT_FOR_NO_SEND_PWM) || defined(USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN) // USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN is old and deprecated
+# elif defined(USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN)
digitalWriteFast(sendPin, HIGH); // Set output to active high.
# else
digitalWriteFast(sendPin, LOW); // Set output to active low.
@@ -1173,7 +978,7 @@ void IRsend::mark(uint16_t aMarkMicros) {
customDelayMicroseconds(aMarkMicros);
IRLedOff();
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
+# if !defined(NO_LED_FEEDBACK_CODE)
if (FeedbackLEDControl.LedFeedbackEnabled == LED_FEEDBACK_ENABLED_FOR_SEND) {
setFeedbackLED(false);
}
@@ -1187,58 +992,41 @@ void IRsend::mark(uint16_t aMarkMicros) {
unsigned long tStartMicros = micros();
unsigned long tNextPeriodEnding = tStartMicros;
unsigned long tMicros;
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
+# if !defined(NO_LED_FEEDBACK_CODE)
bool FeedbackLedIsActive = false;
# endif
do {
// digitalToggleFast(_IR_TIMING_TEST_PIN);
/*
- * Output the PWM pulse - IR LED is active
+ * Output the PWM pulse
*/
noInterrupts(); // do not let interrupts extend the short on period
-# if defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN) || defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN) || defined(OUTPUT_OPEN_DRAIN)
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, LOW); // set output to active low. Also applicable for pin with mode OUTPUT_OPEN_DRAIN :-)
- } else {
- digitalWrite(sendPin, LOW);
- }
+# if defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN)
+# if defined(OUTPUT_OPEN_DRAIN)
+ digitalWriteFast(sendPin, LOW); // set output with pin mode OUTPUT_OPEN_DRAIN to active low
# else
pinModeFast(sendPin, OUTPUT); // active state for mimicking open drain
# endif
# else
// 3.5 us from FeedbackLed on to pin setting. 5.7 us from call of mark() to pin setting incl. setting of feedback pin.
// 4.3 us from do{ to pin setting if sendPin is no constant
- // check must be here because of MegaTinyCore and its badArg() check
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
+ digitalWriteFast(sendPin, HIGH);
# endif
delayMicroseconds (periodOnTimeMicros); // On time is 8 us for 30% duty cycle. This is normally implemented by a blocking wait.
/*
- * Output the PWM pause - IR LED is inactive
+ * Output the PWM pause
*/
-# if defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN) || defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN) || defined(OUTPUT_OPEN_DRAIN)
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH); // Set output to inactive high. Also applicable for pin with mode OUTPUT_OPEN_DRAIN
- } else {
- digitalWrite(sendPin, HIGH);
- }
+# if defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN) && !defined(OUTPUT_OPEN_DRAIN)
+# if defined(OUTPUT_OPEN_DRAIN)
+ digitalWriteFast(sendPin, HIGH); // Set output with pin mode OUTPUT_OPEN_DRAIN to inactive high.
# else
pinModeFast(sendPin, INPUT); // to mimic the open drain inactive state
# endif
# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, LOW);
- } else {
- digitalWrite(sendPin, LOW);
- }
+ digitalWriteFast(sendPin, LOW);
# endif
/*
* Enable interrupts at start of the longer off period. Required at least to keep micros correct.
@@ -1246,13 +1034,13 @@ void IRsend::mark(uint16_t aMarkMicros) {
*/
interrupts();
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
+# if !defined(NO_LED_FEEDBACK_CODE)
/*
* Delayed call of setFeedbackLED() to get better startup timing, especially required for consecutive marks
*/
if (!FeedbackLedIsActive) {
FeedbackLedIsActive = true;
- if (FeedbackLEDControl.LedFeedbackEnabled & LED_FEEDBACK_ENABLED_FOR_SEND) {
+ if (FeedbackLEDControl.LedFeedbackEnabled == LED_FEEDBACK_ENABLED_FOR_SEND) {
setFeedbackLED(true);
}
}
@@ -1261,8 +1049,8 @@ void IRsend::mark(uint16_t aMarkMicros) {
* PWM pause timing
* Measured delta between pause duration values are 13 us for a 16 MHz Uno (from 13 to 26), if interrupts are disabled below
* Measured delta between pause duration values are 20 us for a 16 MHz Uno (from 7.8 to 28), if interrupts are not disabled below
- * Minimal pause duration is 5.2 us with NO_LED_SEND_FEEDBACK_CODE enabled
- * and 8.1 us with NO_LED_SEND_FEEDBACK_CODE disabled.
+ * Minimal pause duration is 5.2 us with NO_LED_FEEDBACK_CODE enabled
+ * and 8.1 us with NO_LED_FEEDBACK_CODE disabled.
*/
tNextPeriodEnding += periodTimeMicros;
#if defined(__AVR__) // micros() for STM sometimes give decreasing values if interrupts are disabled. See https://github.com/stm32duino/Arduino_Core_STM32/issues/1680
@@ -1276,8 +1064,8 @@ void IRsend::mark(uint16_t aMarkMicros) {
* For AVR @16MHz we have only 4 us resolution.
* The duration of the micros() call itself is 3 us.
* It takes 0.9 us from signal going low here.
- * The rest of the loop takes 1.2 us with NO_LED_SEND_FEEDBACK_CODE enabled
- * and 3 us with NO_LED_SEND_FEEDBACK_CODE disabled.
+ * The rest of the loop takes 1.2 us with NO_LED_FEEDBACK_CODE enabled
+ * and 3 us with NO_LED_FEEDBACK_CODE disabled.
*/
#if defined(_IR_MEASURE_TIMING) && defined(_IR_TIMING_TEST_PIN)
digitalWriteFast(_IR_TIMING_TEST_PIN, LOW); // 2 clock cycles
@@ -1290,9 +1078,9 @@ void IRsend::mark(uint16_t aMarkMicros) {
#if defined(__AVR__)
// reset feedback led in the last pause before end
// tDeltaMicros += (160 / CLOCKS_PER_MICRO); // adding this once increases program size, so do it below !
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
+# if !defined(NO_LED_FEEDBACK_CODE)
if (tDeltaMicros >= aMarkMicros - (30 + (112 / CLOCKS_PER_MICRO))) { // 30 to be constant. Using periodTimeMicros increases program size too much.
- if (FeedbackLEDControl.LedFeedbackEnabled & LED_FEEDBACK_ENABLED_FOR_SEND) {
+ if (FeedbackLEDControl.LedFeedbackEnabled == LED_FEEDBACK_ENABLED_FOR_SEND) {
setFeedbackLED(false);
}
}
@@ -1301,7 +1089,7 @@ void IRsend::mark(uint16_t aMarkMicros) {
if (tDeltaMicros >= aMarkMicros - (112 / CLOCKS_PER_MICRO)) { // To compensate for call duration - 112 is an empirical value
#else
if (tDeltaMicros >= aMarkMicros) {
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
+# if !defined(NO_LED_FEEDBACK_CODE)
if (FeedbackLEDControl.LedFeedbackEnabled == LED_FEEDBACK_ENABLED_FOR_SEND) {
setFeedbackLED(false);
}
@@ -1329,33 +1117,25 @@ void IRsend::IRLedOff() {
# if defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN) && !defined(OUTPUT_OPEN_DRAIN)
digitalWriteFast(sendPin, LOW); // prepare for all next active states.
pinModeFast(sendPin, INPUT);// inactive state for open drain
-# elif defined(USE_ACTIVE_HIGH_OUTPUT_FOR_NO_SEND_PWM) || defined(USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN) // USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN is old and deprecated
+# elif defined(USE_ACTIVE_HIGH_OUTPUT_FOR_SEND_PIN)
digitalWriteFast(sendPin, LOW); // Set output to inactive low.
# else
digitalWriteFast(sendPin, HIGH); // Set output to inactive high.
# endif
#else
-# if defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN) || defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN) || defined(OUTPUT_OPEN_DRAIN)
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH); // set output to inactive high.
- } else {
- digitalWrite(sendPin, HIGH);
- }
+# if defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN)
+# if defined(OUTPUT_OPEN_DRAIN)
+ digitalWriteFast(sendPin, HIGH); // Set output to inactive high.
# else
pinModeFast(sendPin, INPUT); // inactive state to mimic open drain
# endif
# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, LOW); // set output to active low.
- } else {
- digitalWrite(sendPin, LOW);
- }
+ digitalWriteFast(sendPin, LOW);
# endif
#endif
-#if !defined(NO_LED_SEND_FEEDBACK_CODE)
- if (FeedbackLEDControl.LedFeedbackEnabled & LED_FEEDBACK_ENABLED_FOR_SEND) {
+#if !defined(NO_LED_FEEDBACK_CODE)
+ if (FeedbackLEDControl.LedFeedbackEnabled == LED_FEEDBACK_ENABLED_FOR_SEND) {
setFeedbackLED(false);
}
#endif
@@ -1403,7 +1183,7 @@ void IRsend::customDelayMicroseconds(unsigned long aMicroseconds) {
* Enables IR output. The kHz value controls the modulation frequency in kilohertz.
* IF PWM should be generated by a timer, it uses the platform specific timerConfigForSend() function,
* otherwise it computes the delays used by the mark() function.
- * If IR_SEND_PIN is defined, maximum PWM frequency for an AVR @16 MHz is 170 kHz (180 kHz if NO_LED_SEND_FEEDBACK_CODE is defined)
+ * If IR_SEND_PIN is defined, maximum PWM frequency for an AVR @16 MHz is 170 kHz (180 kHz if NO_LED_FEEDBACK_CODE is defined)
*/
void IRsend::enableIROut(uint_fast8_t aFrequencyKHz) {
#if defined(SEND_PWM_BY_TIMER)
@@ -1436,11 +1216,7 @@ void IRsend::enableIROut(uint_fast8_t aFrequencyKHz) {
# if defined(IR_SEND_PIN)
pinModeFast(IR_SEND_PIN, OUTPUT);
# else
- if (__builtin_constant_p(sendPin)) {
- pinModeFast(sendPin, OUTPUT);
- } else {
- pinMode(sendPin, OUTPUT);
- }
+ pinModeFast(sendPin, OUTPUT);
# endif
# endif
#endif // defined(USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN)
diff --git a/lib/IRremote/src/IRVersion.h b/lib/IRremote/src/IRVersion.h
index acbafa22..d4dd23f3 100644
--- a/lib/IRremote/src/IRVersion.h
+++ b/lib/IRremote/src/IRVersion.h
@@ -6,7 +6,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2015-2025 Ken Shirriff http://www.righto.com, Rafi Khan, Armin Joachimsmeyer
+ * Copyright (c) 2015-2024 Ken Shirriff http://www.righto.com, Rafi Khan, Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -36,10 +36,10 @@
#ifndef _IR_VERSION_HPP
#define _IR_VERSION_HPP
-#define VERSION_IRREMOTE "4.4.2"
+#define VERSION_IRREMOTE "4.4.1"
#define VERSION_IRREMOTE_MAJOR 4
#define VERSION_IRREMOTE_MINOR 4
-#define VERSION_IRREMOTE_PATCH 2
+#define VERSION_IRREMOTE_PATCH 1
/*
* Macro to convert 3 version parts into an integer
diff --git a/lib/IRremote/src/IRremote.h b/lib/IRremote/src/IRremote.h
index 73cae038..3af3f582 100644
--- a/lib/IRremote/src/IRremote.h
+++ b/lib/IRremote/src/IRremote.h
@@ -9,13 +9,14 @@
#include "IRremote.hpp"
-#warning It seems, that you are using an old version 2.0 code / example.
+#warning Thank you for using the IRremote library!
+#warning It seems, that you are using a old version 2.0 code / example.
#warning This version is no longer supported!
-#warning Upgrade instructions can be found here: "https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#converting-your-2x-program-to-the-4x-version"
-#warning Please use one of the new code examples from the library, available at "File > Examples > Examples from Custom Libraries / IRremote".
+#warning Please use one of the new code examples from the library available at "File > Examples > Examples from Custom Libraries / IRremote".
+#warning Or downgrade your library to version 2.6.0.
#warning Start with the SimpleReceiver or SimpleSender example.
-#warning The examples are documented here: "https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#examples-for-this-library"
-#warning Or just downgrade your library to version 2.6.0.
+#warning The examples are documented here: https://github.com/Arduino-IRremote/Arduino-IRremote#examples-for-this-library
+#warning A guide how to convert your 2.0 program is here: https://github.com/Arduino-IRremote/Arduino-IRremote#converting-your-2x-program-to-the-4x-version
/**********************************************************************************************************************
* The OLD and DEPRECATED decode function with parameter aResults, kept for backward compatibility to old 2.0 tutorials
@@ -30,19 +31,18 @@ bool IRrecv::decode(decode_results *aResults) {
if (!sMessageWasSent) {
Serial.println(F("**************************************************************************************************"));
Serial.println(F("Thank you for using the IRremote library!"));
- Serial.println(F("It seems, that you are using an old version 2.0 code / example."));
+ Serial.println(F("It seems, that you are using a old version 2.0 code / example."));
Serial.println(F("This version is no longer supported!"));
- Serial.println();
- Serial.println(F("Upgrade instructions can be found here:"));
- Serial.println(F(" https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#converting-your-2x-program-to-the-4x-version"));
- Serial.println();
Serial.println(F("Please use one of the new code examples from the library,"));
Serial.println(F(" available at \"File > Examples > Examples from Custom Libraries / IRremote\"."));
+ Serial.println(F("Or downgrade your library to version 2.6.0."));
+ Serial.println();
Serial.println(F("Start with the SimpleReceiver or SimpleSender example."));
- Serial.println(F("The examples are documented here:"));
- Serial.println(F(" https://github.com/Arduino-IRremote/Arduino-IRremote?tab=readme-ov-file#examples-for-this-library"));
Serial.println();
- Serial.println(F("Or just downgrade your library to version 2.6.0."));
+ Serial.println(F("The examples are documented here:"));
+ Serial.println(F(" https://github.com/Arduino-IRremote/Arduino-IRremote#examples-for-this-library"));
+ Serial.println(F("A guide how to convert your 2.0 program is here:"));
+ Serial.println(F(" https://github.com/Arduino-IRremote/Arduino-IRremote#converting-your-2x-program-to-the-4x-version"));
Serial.println();
Serial.println(F("Thanks"));
Serial.println(F("**************************************************************************************************"));
diff --git a/lib/IRremote/src/IRremote.hpp b/lib/IRremote/src/IRremote.hpp
index 942e9aba..657f0687 100644
--- a/lib/IRremote/src/IRremote.hpp
+++ b/lib/IRremote/src/IRremote.hpp
@@ -13,7 +13,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2015-2025 Ken Shirriff http://www.righto.com, Rafi Khan, Armin Joachimsmeyer
+ * Copyright (c) 2015-2023 Ken Shirriff http://www.righto.com, Rafi Khan, Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -46,11 +46,9 @@
*
* - RAW_BUFFER_LENGTH Buffer size of raw input buffer. Must be even! 100 is sufficient for *regular* protocols of up to 48 bits.
* - IR_SEND_PIN If specified (as constant), reduces program size and improves send timing for AVR.
- * - USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN Reverts the polarity at the send pin.
- * - USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN Use or simulate open drain output mode at send pin. Attention, active state of open drain is LOW, so connect the send LED between positive supply and send pin!
* - SEND_PWM_BY_TIMER Disable carrier PWM generation in software and use (restricted) hardware PWM.
* - USE_NO_SEND_PWM Use no carrier PWM, just simulate an **active low** receiver signal. Overrides SEND_PWM_BY_TIMER definition.
- * - USE_ACTIVE_HIGH_OUTPUT_FOR_NO_SEND_PWM Simulate an **active high** receiver signal instead of an active low signal.
+ * - USE_OPEN_DRAIN_OUTPUT_FOR_SEND_PIN Use or simulate open drain output mode at send pin. Attention, active state of open drain is LOW, so connect the send LED between positive supply and send pin!
* - EXCLUDE_EXOTIC_PROTOCOLS If activated, BANG_OLUFSEN, BOSEWAVE, WHYNTER, FAST and LEGO_PF are excluded in decode() and in sending with IrSender.write().
* - EXCLUDE_UNIVERSAL_PROTOCOLS If activated, the universal decoder for pulse distance protocols and decodeHash (special decoder for all protocols) are excluded in decode().
* - DECODE_* Selection of individual protocols to be decoded. See below.
@@ -58,8 +56,6 @@
* - RECORD_GAP_MICROS Minimum gap between IR transmissions, to detect the end of a protocol.
* - FEEDBACK_LED_IS_ACTIVE_LOW Required on some boards (like my BluePill and my ESP8266 board), where the feedback LED is active low.
* - NO_LED_FEEDBACK_CODE This completely disables the LED feedback code for send and receive.
- * - NO_LED_RECEIVE_FEEDBACK_CODE This disables the LED feedback code for receive.
- * - NO_LED_SEND_FEEDBACK_CODE This disables the LED feedback code for send.
* - IR_INPUT_IS_ACTIVE_HIGH Enable it if you use a RF receiver, which has an active HIGH output signal.
* - IR_SEND_DUTY_CYCLE_PERCENT Duty cycle of IR send signal.
* - MICROS_PER_TICK Resolution of the raw input buffer data. Corresponds to 2 pulses of each 26.3 us at 38 kHz.
@@ -136,23 +132,21 @@
****************************************************/
/**
* MARK_EXCESS_MICROS is subtracted from all marks and added to all spaces before decoding,
- * to compensate for the signal forming of different IR receiver modules.
- * 20 is taken as default if not otherwise specified / defined.
+ * to compensate for the signal forming of different IR receiver modules
* For Vishay TSOP*, marks tend to be too long and spaces tend to be too short.
- * If you set MARK_EXCESS_MICROS to approx. 40 to 50 us then the TSOP4838 works best.
- * At 100 us it also worked, but not as well.
- * Set MARK_EXCESS to 100 us and the VS1838 doesn't work at all.
+ * If you set MARK_EXCESS_MICROS to approx. 50us then the TSOP4838 works best.
+ * At 100us it also worked, but not as well.
+ * Set MARK_EXCESS to 100us and the VS1838 doesn't work at all.
*
* The right value is critical for IR codes using short pulses like Denon / Sharp / Lego
*
* Observed values:
- * Delta of each signal type is around 50 up to 100 us and at low signals up to 200 us.
- * TSOP is better, especially at low IR signal level.
- * VS1838 Mark Excess -50 us at low intensity to +50 us at high intensity
+ * Delta of each signal type is around 50 up to 100 and at low signals up to 200. TSOP is better, especially at low IR signal level.
+ * VS1838 Mark Excess -50 at low intensity to +50 us at high intensity
* TSOP31238 Mark Excess 0 to +50
*/
#if !defined(MARK_EXCESS_MICROS)
-// To override this value, you simply can add a line #define "MARK_EXCESS_MICROS <My_new_value>" in your ino file before the line "#include <IRremote.hpp>"
+// To change this value, you simply can add a line #define "MARK_EXCESS_MICROS <My_new_value>" in your ino file before the line "#include <IRremote.hpp>"
#define MARK_EXCESS_MICROS 20
#endif
@@ -249,7 +243,6 @@
#define IR_SEND_DUTY_CYCLE_PERCENT 30 // 30 saves power and is compatible to the old existing code
#endif
-
/**
* microseconds per clock interrupt tick
*/
@@ -261,23 +254,12 @@
#define MICROS_IN_ONE_SECOND 1000000L
#define MICROS_IN_ONE_MILLI 1000L
-#if defined(NO_LED_FEEDBACK_CODE)
-# if !defined(NO_LED_RECEIVE_FEEDBACK_CODE)
-#define NO_LED_RECEIVE_FEEDBACK_CODE
-# endif
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
-#define NO_LED_SEND_FEEDBACK_CODE
-# endif
-#endif
-
#include "IRremoteInt.h"
/*
* We always use digitalWriteFast() and digitalReadFast() functions to have a consistent mapping for pins.
* For most non AVR cpu's, it is just a mapping to digitalWrite() and digitalRead() functions.
*/
-#if !defined(MEGATINYCORE) // megaTinyCore has it own digitalWriteFast function set, except digitalToggleFast().
#include "digitalWriteFast.h"
-#endif
#if !defined(USE_IRREMOTE_HPP_AS_PLAIN_INCLUDE)
#include "private/IRTimer.hpp" // defines IR_SEND_PIN for AVR and SEND_PWM_BY_TIMER
@@ -324,7 +306,7 @@ void disableLEDFeedback() {}; // dummy function for examples
#include "ir_Others.hpp"
#include "ir_Pronto.hpp" // pronto is an universal decoder and encoder
# if defined(DECODE_DISTANCE_WIDTH) // universal decoder for pulse distance width protocols - requires up to 750 bytes additional program memory
-#include "ir_DistanceWidthProtocol.hpp"
+#include <ir_DistanceWidthProtocol.hpp>
# endif
#endif // #if !defined(USE_IRREMOTE_HPP_AS_PLAIN_INCLUDE)
diff --git a/lib/IRremote/src/IRremoteInt.h b/lib/IRremote/src/IRremoteInt.h
index 1fe27979..716d4ebc 100644
--- a/lib/IRremote/src/IRremoteInt.h
+++ b/lib/IRremote/src/IRremoteInt.h
@@ -9,7 +9,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2015-2025 Ken Shirriff http://www.righto.com, Rafi Khan, Armin Joachimsmeyer
+ * Copyright (c) 2015-2023 Ken Shirriff http://www.righto.com, Rafi Khan, Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -73,10 +73,7 @@
* Air conditioners often send a longer protocol data stream up to 750 bits.
*/
#if !defined(RAW_BUFFER_LENGTH)
-# if (defined(RAMEND) && RAMEND <= 0x2FF) || (defined(RAMSIZE) && RAMSIZE < 0x2FF)
-// for RAMsize <= 512 bytes
-#define RAW_BUFFER_LENGTH 100 ///< Length of raw duration buffer. Must be even. 100 supports up to 48 bit codings inclusive 1 start and 1 stop bit.
-# elif (defined(RAMEND) && RAMEND <= 0x8FF) || (defined(RAMSIZE) && RAMSIZE < 0x8FF)
+# if (defined(RAMEND) && RAMEND <= 0x8FF) || (defined(RAMSIZE) && RAMSIZE < 0x8FF)
// for RAMsize <= 2k
#define RAW_BUFFER_LENGTH 200 ///< Length of raw duration buffer. Must be even. 100 supports up to 48 bit codings inclusive 1 start and 1 stop bit.
# else
@@ -102,7 +99,7 @@ typedef unsigned int IRRawlenType;
* we can choose to use a 8 bit buffer even for frame gaps up to 200000 us.
* This enables the use of 8 bit buffer even for more some protocols like B&O or LG air conditioner etc.
*/
-#if RECORD_GAP_TICKS <= 400 // Corresponds to RECORD_GAP_MICROS of 200000. A value of 255 is foolproof, but we assume, that the frame gap is way greater than the biggest mark or space duration.
+#if RECORD_GAP_TICKS <= 400 // Corresponds to RECORD_GAP_MICROS of 200000. A value of 255 is foolproof, but we assume, that the frame gap is
typedef uint8_t IRRawbufType; // all timings up to the gap fit into 8 bit.
#else
typedef uint16_t IRRawbufType; // The gap does not fit into 8 bit ticks value. This must not be a reason to use 16 bit for buffer, but it is at least save.
@@ -206,12 +203,8 @@ class IRrecv {
public:
IRrecv();
- IRrecv(
- uint_fast8_t aReceivePin)
- __attribute__ ((deprecated ("Please use the default IRrecv instance \"IrReceiver\" and IrReceiver.begin(), and not your own IRrecv instance.")));
- IRrecv(uint_fast8_t aReceivePin,
- uint_fast8_t aFeedbackLEDPin)
- __attribute__ ((deprecated ("Please use the default IRrecv instance \"IrReceiver\" and IrReceiver.begin(), and not your own IRrecv instance..")));
+ IRrecv(uint_fast8_t aReceivePin) __attribute__ ((deprecated ("Please use the default IRrecv instance \"IrReceiver\" and IrReceiver.begin(), and not your own IRrecv instance.")));
+ IRrecv(uint_fast8_t aReceivePin, uint_fast8_t aFeedbackLEDPin) __attribute__ ((deprecated ("Please use the default IRrecv instance \"IrReceiver\" and IrReceiver.begin(), and not your own IRrecv instance..")));
void setReceivePin(uint_fast8_t aReceivePinNumber);
#if !defined(IR_REMOTE_DISABLE_RECEIVE_COMPLETE_CALLBACK)
void registerReceiveCompleteCallback(void (*aReceiveCompleteCallbackFunction)(void));
@@ -229,6 +222,7 @@ public:
void restartTimerWithTicksToAdd(uint16_t aTicksToAddToGapCounter);
void restartAfterSend();
+
bool available();
IRData* read(); // returns decoded data
// write is a method of class IRsend below
@@ -250,7 +244,6 @@ public:
* Useful info and print functions
*/
void printIRResultMinimal(Print *aSerial);
- void printIRDuration(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks);
void printIRResultRawFormatted(Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks = true);
void printIRResultAsCVariables(Print *aSerial);
uint8_t getMaximumMarkTicksFromRawData();
@@ -261,9 +254,7 @@ public:
/*
* Next 4 functions are also available as non member functions
*/
- bool printIRResultShort(Print *aSerial, bool aPrintRepeatGap, bool aCheckForRecordGapsMicros)
- __attribute__ ((deprecated ("Remove second parameter, it is not supported any more.")));
- bool printIRResultShort(Print *aSerial, bool aCheckForRecordGapsMicros = true);
+ bool printIRResultShort(Print *aSerial, bool aPrintRepeatGap = true, bool aCheckForRecordGapsMicros = true);
void printDistanceWidthTimingInfo(Print *aSerial, DistanceWidthTimingInfoStruct *aDistanceWidthTimingInfo);
void printIRSendUsage(Print *aSerial);
#if defined(__AVR__)
@@ -288,9 +279,6 @@ public:
bool decodePulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits,
IRRawlenType aStartOffset = 3);
- bool decodePulseDistanceWidthData_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM,
- uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset = 3);
-
bool decodePulseDistanceWidthData(uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset, uint16_t aOneMarkMicros,
uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, bool aMSBfirst);
@@ -362,19 +350,15 @@ public:
void initDecodedIRData();
uint_fast8_t compare(uint16_t oldval, uint16_t newval);
bool checkHeader(PulseDistanceWidthProtocolConstants *aProtocolConstants);
- bool checkHeader_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM);
void checkForRepeatSpaceTicksAndSetFlag(uint16_t aMaximumRepeatSpaceTicks);
bool checkForRecordGapsMicros(Print *aSerial);
IRData decodedIRData; // Decoded IR data for the application
- // Last decoded IR data for repeat detection and to fill in JVC, LG, NEC repeat values. Parity for Denon autorepeat
+ // Last decoded IR data for repeat detection and parity for Denon autorepeat
decode_type_t lastDecodedProtocol;
- uint16_t lastDecodedAddress;
- uint16_t lastDecodedCommand;
-#if defined(DECODE_DISTANCE_WIDTH)
- IRRawDataType lastDecodedRawData;
-#endif
+ uint32_t lastDecodedAddress;
+ uint32_t lastDecodedCommand;
uint8_t repeatCount; // Used e.g. for Denon decode for autorepeat decoding.
};
@@ -479,7 +463,7 @@ public:
// The next function is a dummy to avoid acceptance of pre 4.3 calls to begin(DISABLE_LED_FEEDBACK);
void begin(uint8_t aSendPin)
# if !defined (DOXYGEN)
- __attribute__ ((deprecated ("ERROR: IR_SEND_PIN is still defined, therefore the function begin(aSendPin) is NOT available. You must disable '#define IR_SEND_PIN' to enable this function.")));
+ __attribute__ ((deprecated ("Error: IR_SEND_PIN is still defined, therefore the function begin(aSendPin) is NOT available. You must disable '#define IR_SEND_PIN' to enable this function.")));
# endif
// The next function is a dummy to avoid acceptance of pre 4.0 calls to begin(IR_SEND_PIN, DISABLE_LED_FEEDBACK);
@@ -503,49 +487,28 @@ public:
void enableHighFrequencyIROut(uint_fast16_t aFrequencyKHz); // Used for Bang&Olufsen
#endif
- /*
- * Array functions
- */
void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
int_fast8_t aNumberOfRepeats);
- void sendPulseDistanceWidthFromPGMArray(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
- uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
- IRRawDataType const *aDecodedRawDataPGMArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
- int_fast8_t aNumberOfRepeats);
void sendPulseDistanceWidthFromArray(PulseDistanceWidthProtocolConstants *aProtocolConstants,
IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats);
- void sendPulseDistanceWidthFromPGMArray(PulseDistanceWidthProtocolConstants *aProtocolConstants,
- IRRawDataType const *aDecodedRawDataPGMArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats);
- void sendPulseDistanceWidthFromArray_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM,
- IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats);
- void sendPulseDistanceWidthFromPGMArray_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM,
- IRRawDataType const *aDecodedRawDataPGMArray, uint16_t aNumberOfBits, int_fast8_t aNumberOfRepeats);
-
void sendPulseDistanceWidthFromArray(uint_fast8_t aFrequencyKHz, DistanceWidthTimingInfoStruct *aDistanceWidthTimingInfo,
IRRawDataType *aDecodedRawDataArray, uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
int_fast8_t aNumberOfRepeats);
- void sendPulseDistanceWidthFromArray_P(uint_fast8_t aFrequencyKHz,
- DistanceWidthTimingInfoStruct const *aDistanceWidthTimingInfoPGM, IRRawDataType *aDecodedRawDataArray,
- uint16_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis, int_fast8_t aNumberOfRepeats);
void sendPulseDistanceWidth(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData,
uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats);
- void sendPulseDistanceWidth_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, IRRawDataType aData,
- uint_fast8_t aNumberOfBits, int_fast8_t aNumberOfRepeats);
void sendPulseDistanceWidthData(PulseDistanceWidthProtocolConstants *aProtocolConstants, IRRawDataType aData,
uint_fast8_t aNumberOfBits);
- void sendPulseDistanceWidthData_P(PulseDistanceWidthProtocolConstants const *aProtocolConstantsPGM, IRRawDataType aData,
- uint_fast8_t aNumberOfBits);
void sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
IRRawDataType aData, uint_fast8_t aNumberOfBits, uint8_t aFlags, uint16_t aRepeatPeriodMillis,
- int_fast8_t aNumberOfRepeats, void (*aSpecialSendRepeatFunction)() = nullptr);
+ int_fast8_t aNumberOfRepeats, void (*aSpecialSendRepeatFunction)() = NULL);
void sendPulseDistanceWidth(uint_fast8_t aFrequencyKHz, uint16_t aHeaderMarkMicros, uint16_t aHeaderSpaceMicros,
uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, uint16_t aZeroSpaceMicros,
IRRawDataType aData, uint_fast8_t aNumberOfBits, bool aMSBFirst, bool aSendStopBit, uint16_t aRepeatPeriodMillis,
- int_fast8_t aNumberOfRepeats, void (*aSpecialSendRepeatFunction)() = nullptr)
+ int_fast8_t aNumberOfRepeats, void (*aSpecialSendRepeatFunction)() = NULL)
__attribute__ ((deprecated ("Since version 4.1.0 parameter aSendStopBit is not longer required.")));
void sendPulseDistanceWidthData(uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros,
uint16_t aZeroSpaceMicros, IRRawDataType aData, uint_fast8_t aNumberOfBits, uint8_t aFlags);
@@ -574,7 +537,7 @@ public:
void sendBangOlufsenRawDataLink(uint64_t aRawData, int_fast8_t aBits, bool aBackToBack = false,
bool aUseDatalinkTiming = false);
void sendBoseWave(uint8_t aCommand, int_fast8_t aNumberOfRepeats = NO_REPEATS);
- void sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t aSendSharpFrameMarker = 0);
+ void sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aSendSharp = false);
void sendDenonRaw(uint16_t aRawData, int_fast8_t aNumberOfRepeats = NO_REPEATS)
#if !defined (DOXYGEN)
__attribute__ ((deprecated ("Please use sendDenon(aAddress, aCommand, aNumberOfRepeats).")));
@@ -606,8 +569,6 @@ public:
void sendRC5(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle = true);
void sendRC6(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aEnableAutomaticToggle = true);
- void sendRC6A(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint16_t aCustomer,
- bool aEnableAutomaticToggle = true);
void sendSamsungLGRepeat();
void sendSamsung(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
void sendSamsung16BitAddressAnd8BitCommand(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats);
@@ -615,7 +576,6 @@ public:
void sendSamsung48(uint16_t aAddress, uint32_t aCommand, int_fast8_t aNumberOfRepeats);
void sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats);
void sendSharp(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats); // redirected to sendDenon
- void sendSharp2(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats); // redirected to sendDenon
void sendSony(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t numberOfBits = 12); // SIRCS_12_PROTOCOL
void sendLegoPowerFunctions(uint8_t aChannel, uint8_t tCommand, uint8_t aMode, bool aDoSend5Times = true);
@@ -666,7 +626,7 @@ public:
void sendRC6(uint32_t data, uint8_t nbits) __attribute__ ((deprecated ("Please use sendRC6Raw().")));
void sendRC6Raw(uint64_t data, uint8_t nbits);
void sendRC6(uint64_t data, uint8_t nbits) __attribute__ ((deprecated ("Please use sendRC6Raw().")));
-
+ ;
void sendSharpRaw(unsigned long data, int nbits);
void sendSharp(uint16_t address, uint16_t command);
void sendSAMSUNG(unsigned long data, int nbits);
@@ -676,7 +636,7 @@ public:
void sendSony(unsigned long data,
int nbits)
__attribute__ ((deprecated ("This old function sends MSB first! Please use sendSony(aAddress, aCommand, aNumberOfRepeats).")));
-
+ ;
void sendWhynter(uint32_t aData, uint8_t aNumberOfBitsToSend);
#if !defined(IR_SEND_PIN)
diff --git a/lib/IRremote/src/TinyIR.h b/lib/IRremote/src/TinyIR.h
index 8e29871e..c01a67ab 100644
--- a/lib/IRremote/src/TinyIR.h
+++ b/lib/IRremote/src/TinyIR.h
@@ -2,7 +2,7 @@
* TinyIR.h
*
*
- * Copyright (C) 2021-2025 Armin Joachimsmeyer
+ * Copyright (C) 2021-2023 Armin Joachimsmeyer
*
* This file is part of IRMP https://github.com/IRMP-org/IRMP.
@@ -218,11 +218,11 @@ struct TinyIRReceiverStruct {
/*
* Definitions for member TinyIRReceiverCallbackDataStruct.Flags
- * This is a copy of flags from IRremoteInt.h
+ * From IRremoteInt.h
*/
#define IRDATA_FLAGS_EMPTY 0x00
#define IRDATA_FLAGS_IS_REPEAT 0x01
-#define IRDATA_FLAGS_IS_AUTO_REPEAT 0x02 // not used for TinyIR
+#define IRDATA_FLAGS_IS_AUTO_REPEAT 0x02 // not used here, overwritten with _IRDATA_FLAGS_IS_SHORT_REPEAT
#define IRDATA_FLAGS_PARITY_FAILED 0x04 ///< the current (autorepeat) frame violated parity check
/**
@@ -263,19 +263,6 @@ void sendNECMinimal(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint
void sendNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_t aNumberOfRepeats = 0, bool aSendNEC2Repeats = false);
void sendExtendedNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_t aNumberOfRepeats = 0, bool aSendNEC2Repeats = false);
-#if defined(NO_LED_FEEDBACK_CODE)
-# if !defined(NO_LED_RECEIVE_FEEDBACK_CODE)
-#define NO_LED_RECEIVE_FEEDBACK_CODE
-# endif
-# if !defined(NO_LED_SEND_FEEDBACK_CODE)
-#define NO_LED_SEND_FEEDBACK_CODE
-# endif
-#endif
-
-#if !defined(IR_FEEDBACK_LED_PIN) && defined(LED_BUILTIN)
-#define IR_FEEDBACK_LED_PIN LED_BUILTIN
-#endif
-
/*
* Version 2.2.0 - 7/2024
* - New TinyReceiverDecode() function to be used as drop in for IrReceiver.decode().
diff --git a/lib/IRremote/src/TinyIRReceiver.hpp b/lib/IRremote/src/TinyIRReceiver.hpp
index af66d3c8..39b3414e 100644
--- a/lib/IRremote/src/TinyIRReceiver.hpp
+++ b/lib/IRremote/src/TinyIRReceiver.hpp
@@ -1,7 +1,7 @@
/*
* TinyIRReceiver.hpp
*
- * Receives IR data of NEC protocol using pin change interrupts.
+ * Receives IR protocol data of NEC protocol using pin change interrupts.
* NEC is the protocol of most cheap remote controls for Arduino.
*
* Parity check is done for address and data.
@@ -28,7 +28,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2022-2025 Armin Joachimsmeyer
+ * Copyright (c) 2022-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -56,15 +56,13 @@
*
* - IR_RECEIVE_PIN The pin number for TinyIRReceiver IR input.
* - IR_FEEDBACK_LED_PIN The pin number for TinyIRReceiver feedback LED.
- * - NO_LED_FEEDBACK_CODE Disables the feedback LED function for send and receive. Saves 14 bytes program memory.
- * - NO_LED_RECEIVE_FEEDBACK_CODE Disables the LED feedback code for receive.
- * - NO_LED_SEND_FEEDBACK_CODE Disables the LED feedback code for send.
- * - DISABLE_PARITY_CHECKS Disable parity checks. Saves 48 bytes of program memory.
- * - USE_EXTENDED_NEC_PROTOCOL Like NEC, but take the 16 bit address as one 16 bit value and not as 8 bit normal and 8 bit inverted value.
+ * - NO_LED_FEEDBACK_CODE Disables the feedback LED function. Saves 14 bytes program memory.
+ * - DISABLE_PARITY_CHECKS Disable parity checks. Saves 48 bytes of program memory.
+ * - USE_EXTENDED_NEC_PROTOCOL Like NEC, but take the 16 bit address as one 16 bit value and not as 8 bit normal and 8 bit inverted value.
* - USE_ONKYO_PROTOCOL Like NEC, but take the 16 bit address and command each as one 16 bit value and not as 8 bit normal and 8 bit inverted value.
* - USE_FAST_PROTOCOL Use FAST protocol (no address and 16 bit data, interpreted as 8 bit command and 8 bit inverted command) instead of NEC.
* - ENABLE_NEC2_REPEATS Instead of sending / receiving the NEC special repeat code, send / receive the original frame for repeat.
- * - USE_CALLBACK_FOR_TINY_RECEIVER Call the user provided function "void handleReceivedTinyIRData()" each time a frame or repeat is received.
+ * - USE_CALLBACK_FOR_TINY_RECEIVER Call the fixed function "void handleReceivedTinyIRData()" each time a frame or repeat is received.
*/
#ifndef _TINY_IR_RECEIVER_HPP
@@ -72,6 +70,12 @@
#include <Arduino.h>
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
+#define LOCAL_DEBUG
+#else
+//#define LOCAL_DEBUG // This enables debug output only for this file
+#endif
+
/*
* Protocol selection
*/
@@ -80,11 +84,7 @@
//#define USE_ONKYO_PROTOCOL // Like NEC, but take the 16 bit address and command each as one 16 bit value and not as 8 bit normal and 8 bit inverted value.
//#define USE_FAST_PROTOCOL // Use FAST protocol instead of NEC / ONKYO.
//#define ENABLE_NEC2_REPEATS // Instead of sending / receiving the NEC special repeat code, send / receive the original frame for repeat.
-
-//#define IR_RECEIVE_PIN 2
-//#define NO_LED_RECEIVE_FEEDBACK_CODE // Disables the LED feedback code for receive.
-//#define IR_FEEDBACK_LED_PIN 12 // Use this, to disable use of LED_BUILTIN definition for IR_FEEDBACK_LED_PIN
-#include "TinyIR.h"
+#include "TinyIR.h" // If not defined, it defines IR_RECEIVE_PIN, IR_FEEDBACK_LED_PIN and TINY_RECEIVER_USE_ARDUINO_ATTACH_INTERRUPT
#include "digitalWriteFast.h"
/** \addtogroup TinyReceiver Minimal receiver for NEC and FAST protocol
@@ -92,13 +92,10 @@
*/
#if defined(DEBUG)
-#define LOCAL_DEBUG
#define LOCAL_DEBUG_ATTACH_INTERRUPT
#else
-//#define LOCAL_DEBUG // This enables debug output only for this file
-//#define LOCAL_DEBUG_ATTACH_INTERRUPT // To see if attachInterrupt() or static interrupt (by register tweaking) is used and no other debug output
+//#define LOCAL_DEBUG_ATTACH_INTERRUPT // to see if attachInterrupt() or static interrupt (by register tweaking) is used
#endif
-
#if defined(TRACE)
#define LOCAL_TRACE_STATE_MACHINE
#else
@@ -117,20 +114,22 @@ volatile TinyIRReceiverCallbackDataStruct TinyIRReceiverData;
#warning "IR_INPUT_PIN is deprecated, use IR_RECEIVE_PIN"
#define IR_RECEIVE_PIN IR_INPUT_PIN
#endif
-
#if !defined(IR_RECEIVE_PIN)
-# if defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)
+#if defined(__AVR_ATtiny1616__) || defined(__AVR_ATtiny3216__) || defined(__AVR_ATtiny3217__)
#warning "IR_RECEIVE_PIN is not defined, so it is set to 10"
#define IR_RECEIVE_PIN 10
-# elif defined(__AVR_ATtiny816__)
+#elif defined(__AVR_ATtiny816__)
#warning "IR_RECEIVE_PIN is not defined, so it is set to 14"
#define IR_RECEIVE_PIN 14
-# else
+#else
#warning "IR_RECEIVE_PIN is not defined, so it is set to 2"
#define IR_RECEIVE_PIN 2
-# endif
+#endif
#endif
+#if !defined(IR_FEEDBACK_LED_PIN) && defined(LED_BUILTIN)
+#define IR_FEEDBACK_LED_PIN LED_BUILTIN
+#endif
#if !( \
(defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)) /* ATtinyX5 */ \
@@ -150,9 +149,11 @@ volatile TinyIRReceiverCallbackDataStruct TinyIRReceiverData;
* Declaration of the callback function provided by the user application.
* It is called every time a complete IR command or repeat was received.
*/
-extern void handleReceivedTinyIRData();
+extern void handleTinyReceivedIRData();
-uint32_t sMicrosOfGap; // The length of the gap before the start bit, used for trace
+#if defined(LOCAL_DEBUG)
+uint32_t sMicrosOfGap; // The length of the gap before the start bit
+#endif
/**
* The ISR (Interrupt Service Routine) of TinyIRRreceiver.
* It handles the NEC protocol decoding and calls the user callback function on complete.
@@ -171,12 +172,8 @@ void IRPinChangeInterruptHandler(void) {
*/
uint_fast8_t tIRLevel = digitalReadFast(IR_RECEIVE_PIN);
-#if !defined(NO_LED_RECEIVE_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(IR_FEEDBACK_LED_PIN, tIRLevel);
-# else
+#if !defined(NO_LED_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
digitalWriteFast(IR_FEEDBACK_LED_PIN, !tIRLevel);
-# endif
#endif
/*
@@ -212,7 +209,7 @@ void IRPinChangeInterruptHandler(void) {
// We are at the beginning of the header mark, check timing at the next transition
tState = IR_RECEIVER_STATE_WAITING_FOR_START_SPACE;
TinyIRReceiverControl.Flags = IRDATA_FLAGS_EMPTY; // If we do it here, it saves 4 bytes
-#if defined(TRACE) // Do not use LOCAL_TRACE here since sMicrosOfGap is read in a cpp file at TRACE
+#if defined(LOCAL_TRACE)
sMicrosOfGap = tMicrosOfMarkOrSpace32;
#endif
#if defined(ENABLE_NEC2_REPEATS)
@@ -229,7 +226,7 @@ void IRPinChangeInterruptHandler(void) {
if (tMicrosOfMarkOrSpace >= lowerValue25Percent(TINY_RECEIVER_HEADER_SPACE)
&& tMicrosOfMarkOrSpace <= upperValue25Percent(TINY_RECEIVER_HEADER_SPACE)) {
/*
- * We had a valid data header space here -> initialize data
+ * We have a valid data header space here -> initialize data
*/
TinyIRReceiverControl.IRRawDataBitCounter = 0;
#if (TINY_RECEIVER_BITS > 16)
@@ -326,7 +323,7 @@ void IRPinChangeInterruptHandler(void) {
* Check address parity
* Address is sent first and contained in the lower word
*/
- if (TinyIRReceiverControl.IRRawData.UBytes[0] != (uint8_t)(~TinyIRReceiverControl.IRRawData.UBytes[1])) {
+ if (TinyIRReceiverControl.IRRawData.UBytes[0] != (uint8_t) (~TinyIRReceiverControl.IRRawData.UBytes[1])) {
#if defined(ENABLE_NEC2_REPEATS)
TinyIRReceiverControl.Flags |= IRDATA_FLAGS_PARITY_FAILED; // here we can have the repeat flag already set
#else
@@ -339,7 +336,7 @@ void IRPinChangeInterruptHandler(void) {
* Check command parity
*/
#if (TINY_RECEIVER_ADDRESS_BITS > 0)
- if (TinyIRReceiverControl.IRRawData.UBytes[2] != (uint8_t)(~TinyIRReceiverControl.IRRawData.UBytes[3])) {
+ if (TinyIRReceiverControl.IRRawData.UBytes[2] != (uint8_t) (~TinyIRReceiverControl.IRRawData.UBytes[3])) {
#if defined(ENABLE_NEC2_REPEATS)
TinyIRReceiverControl.Flags |= IRDATA_FLAGS_PARITY_FAILED;
#else
@@ -457,17 +454,15 @@ bool isIRReceiverAttachedForTinyReceiver() {
bool initPCIInterruptForTinyReceiver() {
pinModeFast(IR_RECEIVE_PIN, INPUT);
-#if !defined(NO_LED_RECEIVE_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
+#if !defined(NO_LED_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
pinModeFast(IR_FEEDBACK_LED_PIN, OUTPUT);
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(IR_FEEDBACK_LED_PIN, HIGH);
-# endif
#endif
return enablePCIInterruptForTinyReceiver();
}
void printTinyReceiverResultMinimal(Print *aSerial) {
// Print only very short output, since we are in an interrupt context and do not want to miss the next interrupts of the repeats coming soon
+ // Print only very short output, since we are in an interrupt context and do not want to miss the next interrupts of the repeats coming soon
#if defined(USE_FAST_PROTOCOL)
aSerial->print(F("C=0x"));
#else
@@ -573,19 +568,14 @@ bool enablePCIInterruptForTinyReceiver() {
#if defined(USE_ATTACH_INTERRUPT) || defined(USE_ATTACH_INTERRUPT_DIRECT)
# if defined(USE_ATTACH_INTERRUPT)
-# if defined(NOT_AN_INTERRUPT) // check if IDE has defined the check of digitalPinToInterrupt
+#if defined(NOT_AN_INTERRUPT)
if(digitalPinToInterrupt(IR_RECEIVE_PIN) == NOT_AN_INTERRUPT){
return false;
}
-# endif
+#endif
// costs 112 bytes program memory + 4 bytes RAM
-# if defined(ARDUINO_ARCH_SAMD) // see https://www.arduino.cc/reference/tr/language/functions/external-interrupts/attachinterrupt/ paragraph: Syntax
- attachInterrupt(IR_RECEIVE_PIN, IRPinChangeInterruptHandler, CHANGE); // no extra pin mapping here :-(
-# else
attachInterrupt(digitalPinToInterrupt(IR_RECEIVE_PIN), IRPinChangeInterruptHandler, CHANGE);
-# endif
# else
- // USE_ATTACH_INTERRUPT_DIRECT here, only defined for ATtinies *16, see above
// 2.2 us more than version configured with macros and not compatible
attachInterrupt(IR_RECEIVE_PIN, IRPinChangeInterruptHandler, CHANGE); // no extra pin mapping here
# endif
@@ -593,11 +583,11 @@ bool enablePCIInterruptForTinyReceiver() {
# if defined(LOCAL_DEBUG_ATTACH_INTERRUPT)
Serial.println(F("Use attachInterrupt for pin=" STR(IR_RECEIVE_PIN)));
# endif
+
#else
# if defined(LOCAL_DEBUG_ATTACH_INTERRUPT)
Serial.println(F("Use static interrupt for pin=" STR(IR_RECEIVE_PIN)));
# endif
-
# if defined(USE_INT0)
// interrupt on any logical change
EICRA |= _BV(ISC00);
diff --git a/lib/IRremote/src/TinyIRSender.hpp b/lib/IRremote/src/TinyIRSender.hpp
index be0d07ef..65a1fe18 100644
--- a/lib/IRremote/src/TinyIRSender.hpp
+++ b/lib/IRremote/src/TinyIRSender.hpp
@@ -19,7 +19,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2022-2025 Armin Joachimsmeyer
+ * Copyright (c) 2022-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -48,13 +48,11 @@
//#define ENABLE_NEC2_REPEATS // Instead of sending / receiving the NEC special repeat code, send / receive the original frame for repeat.
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
#endif
-//#define NO_LED_SEND_FEEDBACK_CODE // Disables the LED feedback code for receive.
-//#define IR_FEEDBACK_LED_PIN 12 // Use this, to disable use of LED_BUILTIN definition for IR_FEEDBACK_LED_PIN
#include "TinyIR.h" // Defines protocol timings
#include "digitalWriteFast.h"
@@ -116,15 +114,6 @@ void sendMark(uint8_t aSendPin, unsigned int aMarkMicros) {
void sendONKYO(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_t aNumberOfRepeats, bool aSendNEC2Repeats) {
pinModeFast(aSendPin, OUTPUT);
-#if !defined(NO_LED_SEND_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
- pinModeFast(IR_FEEDBACK_LED_PIN, OUTPUT);
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(IR_FEEDBACK_LED_PIN, LOW);
-# else
- digitalWriteFast(IR_FEEDBACK_LED_PIN, HIGH);
-# endif
-#endif
-
uint_fast8_t tNumberOfCommands = aNumberOfRepeats + 1;
while (tNumberOfCommands > 0) {
unsigned long tStartOfFrameMillis = millis();
@@ -132,10 +121,10 @@ void sendONKYO(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast
sendMark(aSendPin, NEC_HEADER_MARK);
if ((!aSendNEC2Repeats) && (tNumberOfCommands < aNumberOfRepeats + 1)) {
// send the NEC special repeat
- delayMicroseconds (NEC_REPEAT_HEADER_SPACE); // - 2250
+ delayMicroseconds(NEC_REPEAT_HEADER_SPACE); // - 2250
} else {
// send header
- delayMicroseconds (NEC_HEADER_SPACE);
+ delayMicroseconds(NEC_HEADER_SPACE);
LongUnion tData;
tData.UWord.LowWord = aAddress;
tData.UWord.HighWord = aCommand;
@@ -143,9 +132,9 @@ void sendONKYO(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast
for (uint_fast8_t i = 0; i < NEC_BITS; ++i) {
sendMark(aSendPin, NEC_BIT_MARK); // constant mark length
if (tData.ULong & 1) {
- delayMicroseconds (NEC_ONE_SPACE);
+ delayMicroseconds(NEC_ONE_SPACE);
} else {
- delayMicroseconds (NEC_ZERO_SPACE);
+ delayMicroseconds(NEC_ZERO_SPACE);
}
tData.ULong >>= 1; // shift command for next bit
}
@@ -164,14 +153,6 @@ void sendONKYO(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast
}
}
}
-#if !defined(NO_LED_SEND_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
- pinModeFast(IR_FEEDBACK_LED_PIN, OUTPUT);
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(IR_FEEDBACK_LED_PIN, HIGH);
-# else
- digitalWriteFast(IR_FEEDBACK_LED_PIN, LOW);
-# endif
-#endif
}
/*
@@ -187,15 +168,6 @@ void sendNECMinimal(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint
void sendNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_t aNumberOfRepeats, bool aSendNEC2Repeats) {
pinModeFast(aSendPin, OUTPUT);
-#if !defined(NO_LED_SEND_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
- pinModeFast(IR_FEEDBACK_LED_PIN, OUTPUT);
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(IR_FEEDBACK_LED_PIN, LOW);
-# else
- digitalWriteFast(IR_FEEDBACK_LED_PIN, HIGH);
-# endif
-#endif
-
uint_fast8_t tNumberOfCommands = aNumberOfRepeats + 1;
while (tNumberOfCommands > 0) {
unsigned long tStartOfFrameMillis = millis();
@@ -203,10 +175,10 @@ void sendNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_
sendMark(aSendPin, NEC_HEADER_MARK);
if ((!aSendNEC2Repeats) && (tNumberOfCommands < aNumberOfRepeats + 1)) {
// send the NEC special repeat
- delayMicroseconds (NEC_REPEAT_HEADER_SPACE); // - 2250
+ delayMicroseconds(NEC_REPEAT_HEADER_SPACE); // - 2250
} else {
// send header
- delayMicroseconds (NEC_HEADER_SPACE);
+ delayMicroseconds(NEC_HEADER_SPACE);
LongUnion tData;
/*
* The compiler is intelligent and removes the code for "(aAddress > 0xFF)" if we are called with an uint8_t address :-).
@@ -229,9 +201,9 @@ void sendNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_
sendMark(aSendPin, NEC_BIT_MARK); // constant mark length
if (tData.ULong & 1) {
- delayMicroseconds (NEC_ONE_SPACE);
+ delayMicroseconds(NEC_ONE_SPACE);
} else {
- delayMicroseconds (NEC_ZERO_SPACE);
+ delayMicroseconds(NEC_ZERO_SPACE);
}
tData.ULong >>= 1; // shift command for next bit
}
@@ -250,14 +222,6 @@ void sendNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_
}
}
}
-#if !defined(NO_LED_SEND_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
- pinModeFast(IR_FEEDBACK_LED_PIN, OUTPUT);
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(IR_FEEDBACK_LED_PIN, HIGH);
-# else
- digitalWriteFast(IR_FEEDBACK_LED_PIN, LOW);
-# endif
-#endif
}
/*
@@ -270,15 +234,6 @@ void sendNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_
void sendExtendedNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uint_fast8_t aNumberOfRepeats, bool aSendNEC2Repeats) {
pinModeFast(aSendPin, OUTPUT);
-#if !defined(NO_LED_SEND_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
- pinModeFast(IR_FEEDBACK_LED_PIN, OUTPUT);
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(IR_FEEDBACK_LED_PIN, LOW);
-# else
- digitalWriteFast(IR_FEEDBACK_LED_PIN, HIGH);
-# endif
-#endif
-
uint_fast8_t tNumberOfCommands = aNumberOfRepeats + 1;
while (tNumberOfCommands > 0) {
unsigned long tStartOfFrameMillis = millis();
@@ -286,10 +241,10 @@ void sendExtendedNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uin
sendMark(aSendPin, NEC_HEADER_MARK);
if ((!aSendNEC2Repeats) && (tNumberOfCommands < aNumberOfRepeats + 1)) {
// send the NEC special repeat
- delayMicroseconds (NEC_REPEAT_HEADER_SPACE); // - 2250
+ delayMicroseconds(NEC_REPEAT_HEADER_SPACE); // - 2250
} else {
// send header
- delayMicroseconds (NEC_HEADER_SPACE);
+ delayMicroseconds(NEC_HEADER_SPACE);
LongUnion tData;
tData.UWord.LowWord = aAddress;
if (aCommand > 0xFF) {
@@ -303,9 +258,9 @@ void sendExtendedNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uin
sendMark(aSendPin, NEC_BIT_MARK); // constant mark length
if (tData.ULong & 1) {
- delayMicroseconds (NEC_ONE_SPACE);
+ delayMicroseconds(NEC_ONE_SPACE);
} else {
- delayMicroseconds (NEC_ZERO_SPACE);
+ delayMicroseconds(NEC_ZERO_SPACE);
}
tData.ULong >>= 1; // shift command for next bit
}
@@ -324,14 +279,6 @@ void sendExtendedNEC(uint8_t aSendPin, uint16_t aAddress, uint16_t aCommand, uin
}
}
}
-#if !defined(NO_LED_SEND_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
- pinModeFast(IR_FEEDBACK_LED_PIN, OUTPUT);
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(IR_FEEDBACK_LED_PIN, HIGH);
-# else
- digitalWriteFast(IR_FEEDBACK_LED_PIN, LOW);
-# endif
-#endif
}
/*
@@ -347,15 +294,6 @@ void sendFast8BitAndParity(uint8_t aSendPin, uint8_t aCommand, uint_fast8_t aNum
void sendFAST(uint8_t aSendPin, uint16_t aCommand, uint_fast8_t aNumberOfRepeats) {
pinModeFast(aSendPin, OUTPUT);
-#if !defined(NO_LED_SEND_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
- pinModeFast(IR_FEEDBACK_LED_PIN, OUTPUT);
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(IR_FEEDBACK_LED_PIN, LOW);
-# else
- digitalWriteFast(IR_FEEDBACK_LED_PIN, HIGH);
-# endif
-#endif
-
uint_fast8_t tNumberOfCommands = aNumberOfRepeats + 1;
while (tNumberOfCommands > 0) {
unsigned long tStartOfFrameMillis = millis();
@@ -399,14 +337,6 @@ void sendFAST(uint8_t aSendPin, uint16_t aCommand, uint_fast8_t aNumberOfRepeats
}
}
}
-#if !defined(NO_LED_SEND_FEEDBACK_CODE) && defined(IR_FEEDBACK_LED_PIN)
- pinModeFast(IR_FEEDBACK_LED_PIN, OUTPUT);
-# if defined(FEEDBACK_LED_IS_ACTIVE_LOW)
- digitalWriteFast(IR_FEEDBACK_LED_PIN, HIGH);
-# else
- digitalWriteFast(IR_FEEDBACK_LED_PIN, LOW);
-# endif
-#endif
}
/** @}*/
diff --git a/lib/IRremote/src/digitalWriteFast.h b/lib/IRremote/src/digitalWriteFast.h
index faeaa5af..043ae715 100644
--- a/lib/IRremote/src/digitalWriteFast.h
+++ b/lib/IRremote/src/digitalWriteFast.h
@@ -5,22 +5,12 @@
* by Watterott electronic (www.watterott.com)
* based on https://code.google.com/p/digitalwritefast
*
- * The value of DigitalReadFast() is the content of the input register e.g. 0x04 for pin2 and NOT always 0 or 1.
- *
* License: BSD 3-Clause License (https://opensource.org/licenses/BSD-3-Clause)
*/
#ifndef __digitalWriteFast_h_
#define __digitalWriteFast_h_ 1
-//#define THROW_ERROR_IF_NOT_FAST // If activated, an error is thrown if pin is not a compile time constant
-void NonConstantsUsedForPinModeFast( void ) __attribute__ (( error("Parameter for pinModeFast() function is not constant") ));
-void NonConstantsUsedForDigitalWriteFast( void ) __attribute__ (( error("Parameter for digitalWriteFast() function is not constant") ));
-void NonConstantsUsedForDigitalToggleFast( void ) __attribute__ (( error("Parameter for digitalToggleFast() function is not constant") ));
-int NonConstantsUsedForDigitalReadFast( void ) __attribute__ (( error("Parameter for digitalReadFast() function is not constant") ));
-
-#if !defined(MEGATINYCORE) // megaTinyCore has it own digitalWriteFast function set, except digitalToggleFast().
-
//#define SANGUINO_PINOUT // define for Sanguino pinout
// general macros/defines
@@ -39,6 +29,10 @@ int NonConstantsUsedForDigitalReadFast( void ) __attribute__ (( error("Paramete
#include <Arduino.h> // declarations for the fallback to digitalWrite(), digitalRead() etc.
+#if defined(MEGATINYCORE)
+#error Do not use "#include digitalWriteFast.h" because megaTinyCore has it own digitalWriteFast function set, except digitalToggleFast().
+#endif
+
// --- Arduino Mega and ATmega128x/256x based boards ---
#if (defined(ARDUINO_AVR_MEGA) || \
defined(ARDUINO_AVR_MEGA1280) || \
@@ -322,26 +316,28 @@ int NonConstantsUsedForDigitalReadFast( void ) __attribute__ (( error("Paramete
#endif
+
+void NonConstantsUsedForPinModeFast( void ) __attribute__ (( error("Parameter for pinModeFast() function is not constant") ));
+void NonConstantsUsedForDigitalWriteFast( void ) __attribute__ (( error("Parameter for digitalWriteFast() function is not constant") ));
+void NonConstantsUsedForDigitalToggleFast( void ) __attribute__ (( error("Parameter for digitalToggleFast() function is not constant") ));
+int NonConstantsUsedForDigitalReadFast( void ) __attribute__ (( error("Parameter for digitalReadFast() function is not constant") ));
+
#if !defined(digitalWriteFast)
# if (defined(__AVR__) || defined(ARDUINO_ARCH_AVR)) && defined(__digitalPinToPortReg)
# if defined(THROW_ERROR_IF_NOT_FAST)
#define digitalWriteFast(P, V) \
-do { \
- if (__builtin_constant_p(P)) { \
- BIT_WRITE(*__digitalPinToPortReg(P), __digitalPinToBit(P), (V)); \
- } else { \
+if (__builtin_constant_p(P)) { \
+ BIT_WRITE(*__digitalPinToPortReg(P), __digitalPinToBit(P), (V)); \
+} else { \
NonConstantsUsedForDigitalWriteFast(); \
- } \
-} while (0)
+}
# else
#define digitalWriteFast(P, V) \
-do { \
- if (__builtin_constant_p(P)) { \
- BIT_WRITE(*__digitalPinToPortReg(P), __digitalPinToBit(P), (V)); \
- } else { \
- digitalWrite((P), (V)); \
- } \
-} while (0)
+if (__builtin_constant_p(P)) { \
+ BIT_WRITE(*__digitalPinToPortReg(P), __digitalPinToBit(P), (V)); \
+} else { \
+ digitalWrite((P), (V)); \
+}
# endif // defined(THROW_ERROR_IF_NOT_FAST)
# else
#define digitalWriteFast digitalWrite
@@ -352,32 +348,28 @@ do { \
# if (defined(__AVR__) || defined(ARDUINO_ARCH_AVR)) && defined(__digitalPinToPortReg)
# if defined(THROW_ERROR_IF_NOT_FAST)
#define pinModeFast(P, V) \
-do { \
- if (__builtin_constant_p(P) && __builtin_constant_p(V)) { \
- if (V == INPUT_PULLUP) {\
- BIT_CLEAR(*__digitalPinToDDRReg(P), __digitalPinToBit(P)); \
- BIT_SET(*__digitalPinToPortReg(P), __digitalPinToBit(P)); \
- } else { \
- BIT_WRITE(*__digitalPinToDDRReg(P), __digitalPinToBit(P), (V)); \
- } \
+if (__builtin_constant_p(P) && __builtin_constant_p(V)) { \
+ if (V == INPUT_PULLUP) {\
+ BIT_CLEAR(*__digitalPinToDDRReg(P), __digitalPinToBit(P)); \
+ BIT_SET(*__digitalPinToPortReg(P), __digitalPinToBit(P)); \
} else { \
- NonConstantsUsedForPinModeFast(); \
+ BIT_WRITE(*__digitalPinToDDRReg(P), __digitalPinToBit(P), (V)); \
} \
-} while (0)
+} else { \
+ NonConstantsUsedForPinModeFast(); \
+}
# else
#define pinModeFast(P, V) \
-do { \
- if (__builtin_constant_p(P) && __builtin_constant_p(V)) { \
- if (V == INPUT_PULLUP) {\
- BIT_CLEAR(*__digitalPinToDDRReg(P), __digitalPinToBit(P)); \
- BIT_SET(*__digitalPinToPortReg(P), __digitalPinToBit(P)); \
- } else { \
- BIT_WRITE(*__digitalPinToDDRReg(P), __digitalPinToBit(P), (V)); \
- } \
+if (__builtin_constant_p(P) && __builtin_constant_p(V)) { \
+ if (V == INPUT_PULLUP) {\
+ BIT_CLEAR(*__digitalPinToDDRReg(P), __digitalPinToBit(P)); \
+ BIT_SET(*__digitalPinToPortReg(P), __digitalPinToBit(P)); \
} else { \
- pinMode((P), (V)); \
+ BIT_WRITE(*__digitalPinToDDRReg(P), __digitalPinToBit(P), (V)); \
} \
-} while (0)
+} else { \
+ pinMode((P), (V)); \
+}
# endif // defined(THROW_ERROR_IF_NOT_FAST)
# else
#define pinModeFast pinMode
@@ -389,11 +381,17 @@ do { \
# if defined(THROW_ERROR_IF_NOT_FAST)
#define digitalReadFast(P) ( (int) __digitalReadFast((P)) )
// since we have return values, it is easier to implement it by ?:
-#define __digitalReadFast(P ) ( (__builtin_constant_p(P) ) ? (( BIT_READ(*__digitalPinToPINReg(P), __digitalPinToBit(P))) ? HIGH:LOW ) : NonConstantsUsedForDigitalReadFast() )
+#define __digitalReadFast(P ) \
+ (__builtin_constant_p(P) ) ? \
+ (( BIT_READ(*__digitalPinToPINReg(P), __digitalPinToBit(P))) ? HIGH:LOW ) : \
+ NonConstantsUsedForDigitalReadFast()
# else
#define digitalReadFast(P) ( (int) __digitalReadFast((P)) )
// since we have return values, it is easier to implement it by ?:
-#define __digitalReadFast(P ) ( (__builtin_constant_p(P) ) ? (( BIT_READ(*__digitalPinToPINReg(P), __digitalPinToBit(P))) ? HIGH:LOW ) : digitalRead((P)) )
+#define __digitalReadFast(P ) \
+ (__builtin_constant_p(P) ) ? \
+ (( BIT_READ(*__digitalPinToPINReg(P), __digitalPinToBit(P))) ? HIGH:LOW ) : \
+ digitalRead((P))
# endif // defined(THROW_ERROR_IF_NOT_FAST)
# else
#define digitalReadFast digitalRead
@@ -404,27 +402,22 @@ do { \
# if (defined(__AVR__) || defined(ARDUINO_ARCH_AVR)) && defined(__digitalPinToPINReg)
# if defined(THROW_ERROR_IF_NOT_FAST)
#define digitalToggleFast(P) \
-do { \
- if (__builtin_constant_p(P)) { \
- BIT_SET(*__digitalPinToPINReg(P), __digitalPinToBit(P)); \
- } else { \
+if (__builtin_constant_p(P)) { \
+ BIT_SET(*__digitalPinToPINReg(P), __digitalPinToBit(P)); \
+} else { \
NonConstantsUsedForDigitalToggleFast(); \
- } \
-} while (0)
+}
# else
#define digitalToggleFast(P) \
-do { \
- if (__builtin_constant_p(P)) { \
- BIT_SET(*__digitalPinToPINReg(P), __digitalPinToBit(P)); \
- } else { \
- digitalWrite(P, ! digitalRead(P)); \
- } \
-} while (0)
+if (__builtin_constant_p(P)) { \
+ BIT_SET(*__digitalPinToPINReg(P), __digitalPinToBit(P)); \
+} else { \
+ digitalWrite(P, ! digitalRead(P)); \
+}
# endif // defined(THROW_ERROR_IF_NOT_FAST)
# else
#define digitalToggleFast(P) digitalWrite(P, ! digitalRead(P))
# endif
#endif // !defined(digitalToggleFast)
-#endif // !defined(MEGATINYCORE)
#endif //__digitalWriteFast_h_
diff --git a/lib/IRremote/src/ir_BangOlufsen.hpp b/lib/IRremote/src/ir_BangOlufsen.hpp
index f399741f..628a5792 100644
--- a/lib/IRremote/src/ir_BangOlufsen.hpp
+++ b/lib/IRremote/src/ir_BangOlufsen.hpp
@@ -96,11 +96,11 @@
//#define SUPPORT_BEO_DATALINK_TIMING_FOR_DECODE // This also supports headers up to 32 bit. Requires additional 150 bytes program memory.
#if defined(DECODE_BEO)
# if defined(ENABLE_BEO_WITHOUT_FRAME_GAP)
-# if RECORD_GAP_MICROS > 15000 && !defined(SUPPRESS_BEO_RECORD_GAP_MICROS_WARNING)
+# if RECORD_GAP_MICROS > 15000
#warning If defined ENABLE_BEO_WITHOUT_FRAME_GAP, RECORD_GAP_MICROS must be set to <= 15000 by "#define RECORD_GAP_MICROS 12750"
# endif
# else
-# if RECORD_GAP_MICROS < 16000 && !defined(SUPPRESS_BEO_RECORD_GAP_MICROS_WARNING)
+# if RECORD_GAP_MICROS < 16000
#error If not defined ENABLE_BEO_WITHOUT_FRAME_GAP, RECORD_GAP_MICROS must be set to a value >= 16000 by "#define RECORD_GAP_MICROS 16000"
# endif
# endif
diff --git a/lib/IRremote/src/ir_BoseWave.hpp b/lib/IRremote/src/ir_BoseWave.hpp
index 336d886f..c8ec9b7a 100644
--- a/lib/IRremote/src/ir_BoseWave.hpp
+++ b/lib/IRremote/src/ir_BoseWave.hpp
@@ -9,7 +9,7 @@
#ifndef _IR_BOSEWAVE_HPP
#define _IR_BOSEWAVE_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -46,9 +46,9 @@
#define BOSEWAVE_REPEAT_DISTANCE 50000
#define BOSEWAVE_MAXIMUM_REPEAT_DISTANCE 62000
-struct PulseDistanceWidthProtocolConstants const BoseWaveProtocolConstants PROGMEM = {BOSEWAVE, BOSEWAVE_KHZ, BOSEWAVE_HEADER_MARK,
- BOSEWAVE_HEADER_SPACE, BOSEWAVE_BIT_MARK, BOSEWAVE_ONE_SPACE, BOSEWAVE_BIT_MARK, BOSEWAVE_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST
- , (BOSEWAVE_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), nullptr};
+struct PulseDistanceWidthProtocolConstants BoseWaveProtocolConstants = { BOSEWAVE, BOSEWAVE_KHZ, BOSEWAVE_HEADER_MARK,
+BOSEWAVE_HEADER_SPACE, BOSEWAVE_BIT_MARK, BOSEWAVE_ONE_SPACE, BOSEWAVE_BIT_MARK, BOSEWAVE_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST
+ , (BOSEWAVE_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), NULL };
/************************************
* Start of send and decode functions
@@ -58,12 +58,12 @@ void IRsend::sendBoseWave(uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
// send 8 command bits and then 8 inverted command bits LSB first
uint16_t tData = ((~aCommand) << 8) | aCommand;
- sendPulseDistanceWidth_P(&BoseWaveProtocolConstants, tData, BOSEWAVE_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&BoseWaveProtocolConstants, tData, BOSEWAVE_BITS, aNumberOfRepeats);
}
bool IRrecv::decodeBoseWave() {
- if (!checkHeader_P(&BoseWaveProtocolConstants)) {
+ if (!checkHeader(&BoseWaveProtocolConstants)) {
return false;
}
@@ -76,7 +76,7 @@ bool IRrecv::decodeBoseWave() {
return false;
}
- if (!decodePulseDistanceWidthData_P(&BoseWaveProtocolConstants, BOSEWAVE_BITS)) {
+ if (!decodePulseDistanceWidthData(&BoseWaveProtocolConstants, BOSEWAVE_BITS)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("Bose: "));
Serial.println(F("Decode failed"));
diff --git a/lib/IRremote/src/ir_Denon.hpp b/lib/IRremote/src/ir_Denon.hpp
index bfbe45ca..f2214114 100644
--- a/lib/IRremote/src/ir_Denon.hpp
+++ b/lib/IRremote/src/ir_Denon.hpp
@@ -32,7 +32,7 @@
#ifndef _IR_DENON_HPP
#define _IR_DENON_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -82,7 +82,7 @@
* 000A 0046 000A 0046 000A 001E 000A 001E 000A 001E 000A 0046 000A 001E 000A 001E // 8 inverted command bits
* 000A 0046 000A 0046 000A 0679 // 2 frame bits 1,1 + stop bit + space for Repeat
* From analyzing the codes for Tuner preset 1 to 8 in tab Main Zone ID#1 it is obvious, that the protocol is LSB first at least for command.
- * All Denon codes with 32 as 3. value use the Kaseikyo Denon variant.
+ * All Denon codes with 32 as 3. value use the Kaseyikyo Denon variant.
*/
// LSB first, no start bit, 5 address + 8 command + 2 frame (0,0) + 1 stop bit - each frame 2 times
// Every frame is auto repeated with a space period of 45 ms and the command and frame inverted to (1,1) or (0,1) for SHARP.
@@ -105,38 +105,27 @@
#define DENON_HEADER_MARK DENON_UNIT // The length of the Header:Mark
#define DENON_HEADER_SPACE (3 * DENON_UNIT) // 780 // The length of the Header:Space
-struct PulseDistanceWidthProtocolConstants const DenonProtocolConstants PROGMEM = {DENON, DENON_KHZ, DENON_HEADER_MARK, DENON_HEADER_SPACE,
- DENON_BIT_MARK, DENON_ONE_SPACE, DENON_BIT_MARK, DENON_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST,
- (DENON_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), nullptr};
+struct PulseDistanceWidthProtocolConstants DenonProtocolConstants = { DENON, DENON_KHZ, DENON_HEADER_MARK, DENON_HEADER_SPACE,
+DENON_BIT_MARK, DENON_ONE_SPACE, DENON_BIT_MARK, DENON_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST,
+ (DENON_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), NULL };
/************************************
* Start of send and decode functions
************************************/
void IRsend::sendSharp(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
- sendDenon(aAddress, aCommand, aNumberOfRepeats, 1);
- // see https://github.com/Arduino-IRremote/Arduino-IRremote/issues/1272
+ sendDenon(aAddress, aCommand, aNumberOfRepeats, true);
}
-void IRsend::sendSharp2(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
- sendDenon(aAddress, aCommand, aNumberOfRepeats, 2);
-}
-
-/*
- * Denon frames are always sent 3 times. A non inverted (normal), an inverted frame, ending with a normal frame.
- * Repeats are done by just adding an inverted and a normal frame with no extra delay, so it is quite responsible :-)
- * If you specify a repeat of e.g. 3, then 3 + 6 frames are sent.
- * Measured at Denon RC 1081.
- */
-void IRsend::sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t aSendSharpFrameMarker) {
+void IRsend::sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, bool aSendSharp) {
// Set IR carrier frequency
enableIROut (DENON_KHZ); // 38 kHz
// Add frame marker for sharp
uint16_t tCommand = aCommand;
- // see https://github.com/Arduino-IRremote/Arduino-IRremote/issues/1272
- tCommand |= aSendSharpFrameMarker << 8; // the 2 upper bits are 00 for Denon and 01 or 10 for Sharp
-
+ if (aSendSharp) {
+ tCommand |= 0x0200; // the 2 upper bits are 00 for Denon and 10 for Sharp
+ }
uint16_t tData = aAddress | ((uint16_t) tCommand << DENON_ADDRESS_BITS);
uint16_t tInvertedData = (tData ^ 0x7FE0); // Command and frame (upper 10 bits) are inverted
@@ -144,22 +133,19 @@ void IRsend::sendDenon(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOf
while (tNumberOfCommands > 0) {
// Data
- sendPulseDistanceWidthData_P(&DenonProtocolConstants, tData, DENON_BITS);
+ sendPulseDistanceWidthData(&DenonProtocolConstants, tData, DENON_BITS);
// Inverted autorepeat frame
delay(DENON_AUTO_REPEAT_DISTANCE / MICROS_IN_ONE_MILLI);
- sendPulseDistanceWidthData_P(&DenonProtocolConstants, tInvertedData, DENON_BITS);
+ sendPulseDistanceWidthData(&DenonProtocolConstants, tInvertedData, DENON_BITS);
tNumberOfCommands--;
- // send repeated command with a fixed space gap
- delay( DENON_AUTO_REPEAT_DISTANCE / MICROS_IN_ONE_MILLI);
+ // skip last delay!
+ if (tNumberOfCommands > 0) {
+ // send repeated command with a fixed space gap
+ delay( DENON_AUTO_REPEAT_DISTANCE / MICROS_IN_ONE_MILLI);
+ }
}
- /*
- * always end with a normal frame
- * skip last delay!
- */
- sendPulseDistanceWidthData_P(&DenonProtocolConstants, tData, DENON_BITS);
-
}
bool IRrecv::decodeSharp() {
@@ -179,7 +165,7 @@ bool IRrecv::decodeDenon() {
}
// Try to decode as Denon protocol
- if (!decodePulseDistanceWidthData_P(&DenonProtocolConstants, DENON_BITS, 1)) {
+ if (!decodePulseDistanceWidthData(&DenonProtocolConstants, DENON_BITS, 1)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("Denon: "));
Serial.println(F("Decode failed"));
@@ -214,8 +200,8 @@ bool IRrecv::decodeDenon() {
* Here we are in the auto repeated frame with the inverted command
*/
#if defined(LOCAL_DEBUG)
- Serial.print(F("Denon: "));
- Serial.println(F("Autorepeat received="));
+ Serial.print(F("Denon: "));
+ Serial.println(F("Autorepeat received="));
#endif
decodedIRData.flags |= IRDATA_FLAGS_IS_AUTO_REPEAT;
// Check parity of consecutive received commands. There is no parity in one data set.
@@ -288,7 +274,7 @@ void IRsend::sendDenon(unsigned long data, int nbits) {
* Old function without parameter aNumberOfRepeats
*/
void IRsend::sendSharp(uint16_t aAddress, uint16_t aCommand) {
- sendDenon(aAddress, aCommand, 0, true);
+ sendDenon(aAddress, aCommand, true, 0);
}
bool IRrecv::decodeDenonOld(decode_results *aResults) {
diff --git a/lib/IRremote/src/ir_DistanceWidthProtocol.hpp b/lib/IRremote/src/ir_DistanceWidthProtocol.hpp
index 0012625c..aa2d4ed2 100644
--- a/lib/IRremote/src/ir_DistanceWidthProtocol.hpp
+++ b/lib/IRremote/src/ir_DistanceWidthProtocol.hpp
@@ -34,7 +34,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2022-2025 Armin Joachimsmeyer
+ * Copyright (c) 2022-2024 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -62,7 +62,7 @@
#define DISTANCE_WIDTH_MAXIMUM_REPEAT_DISTANCE_MICROS 100000 // 100 ms, bit it is just a guess
#endif
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -192,21 +192,17 @@ bool aggregateArrayCounts(uint8_t aArray[], uint8_t aMaxIndex, uint8_t *aShortIn
* 3. Try to decode with the mark and space data found in step 1
* No data and address decoding, only raw data as result.
*
- * Restrictions:
- * Only protocols with at least 7 bits (+ start and trailing stop bit) are accepted.
- * Pulse or pause duration must be below 2500 us (depends on DISTANCE_WIDTH_DECODER_DURATION_ARRAY_SIZE).
- *
* calloc() version is 700 bytes larger :-(
*/
bool IRrecv::decodeDistanceWidth() {
/*
* Array for up to 49 ticks / 2500 us (or 199 ticks / 10 ms us if RAM > 2k)
- * tick array index 0 covers mark or space durations from 0 to 49 us, and index 49 from 2450 to 2499 us
+ * 0 tick covers mark or space durations from 0 to 49 us, and 49 ticks from 2450 to 2499 us
*/
uint8_t tDurationArray[DISTANCE_WIDTH_DECODER_DURATION_ARRAY_SIZE];
/*
- * Only protocols with at least 7 bits are accepted
+ * Accept only protocols with at least 7 bits
*/
if (decodedIRData.rawlen < (2 * 7) + 4) {
IR_DEBUG_PRINT(F("PULSE_DISTANCE_WIDTH: "));
@@ -438,12 +434,8 @@ bool IRrecv::decodeDistanceWidth() {
decodedIRData.flags = IRDATA_FLAGS_IS_MSB_FIRST;
#endif
- // Check for repeat. Check also for equality of last DecodedRawData.
- if (decodedIRData.initialGapTicks < DISTANCE_WIDTH_MAXIMUM_REPEAT_DISTANCE_MICROS / MICROS_PER_TICK
- && decodedIRData.decodedRawDataArray[tNumberOfAdditionalArrayValues] == lastDecodedRawData) {
- decodedIRData.flags |= IRDATA_FLAGS_IS_REPEAT;
- }
- lastDecodedRawData = decodedIRData.decodedRawData;
+ // Check for repeat
+ checkForRepeatSpaceTicksAndSetFlag(DISTANCE_WIDTH_MAXIMUM_REPEAT_DISTANCE_MICROS / MICROS_PER_TICK);
/*
* Store timing data to reproduce frame for sending
diff --git a/lib/IRremote/src/ir_FAST.hpp b/lib/IRremote/src/ir_FAST.hpp
index e01f9829..f9ea167c 100644
--- a/lib/IRremote/src/ir_FAST.hpp
+++ b/lib/IRremote/src/ir_FAST.hpp
@@ -35,7 +35,7 @@
#include "TinyIR.h"
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -54,19 +54,18 @@
//==============================================================================
#include "TinyIR.h"
/*
- Protocol=FAST Address=0x0 Command=0x76 Raw-Data=0x8976 16 bits LSB first
+Protocol=FAST Address=0x0 Command=0x76 Raw-Data=0x8976 16 bits LSB first
+2100,-1050
+ 550,- 500 + 550,-1550 + 550,-1550 + 550,- 500
+ 550,-1550 + 550,-1550 + 550,-1550 + 550,- 500
+ 550,-1550 + 550,- 500 + 550,- 500 + 550,-1550
+ 550,- 500 + 550,- 500 + 550,- 500 + 550,-1550
+ 550
- Sum: 28900
- */
-struct PulseDistanceWidthProtocolConstants const FASTProtocolConstants PROGMEM = { FAST, FAST_KHZ, FAST_HEADER_MARK,
- FAST_HEADER_SPACE,
- FAST_BIT_MARK, FAST_ONE_SPACE, FAST_BIT_MARK, FAST_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (FAST_REPEAT_PERIOD
- / MICROS_IN_ONE_MILLI), nullptr };
+Sum: 28900
+*/
+struct PulseDistanceWidthProtocolConstants FASTProtocolConstants = { FAST, FAST_KHZ, FAST_HEADER_MARK, FAST_HEADER_SPACE,
+FAST_BIT_MARK, FAST_ONE_SPACE, FAST_BIT_MARK, FAST_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (FAST_REPEAT_PERIOD / MICROS_IN_ONE_MILLI),
+NULL };
/************************************
* Start of send and decode functions
@@ -85,7 +84,7 @@ void IRsend::sendFAST(uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
mark(FAST_HEADER_MARK);
space(FAST_HEADER_SPACE);
- sendPulseDistanceWidthData_P(&FASTProtocolConstants, aCommand | (((uint8_t)(~aCommand)) << 8), FAST_BITS);
+ sendPulseDistanceWidthData(&FASTProtocolConstants, aCommand | (((uint8_t)(~aCommand)) << 8), FAST_BITS);
tNumberOfCommands--;
// skip last delay!
@@ -109,11 +108,11 @@ bool IRrecv::decodeFAST() {
return false;
}
- if (!checkHeader_P(&FASTProtocolConstants)) {
+ if (!checkHeader(&FASTProtocolConstants)) {
return false;
}
- if (!decodePulseDistanceWidthData_P(&FASTProtocolConstants, FAST_BITS)) {
+ if (!decodePulseDistanceWidthData(&FASTProtocolConstants, FAST_BITS)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("FAST: "));
Serial.println(F("Decode failed"));
@@ -124,7 +123,7 @@ bool IRrecv::decodeFAST() {
WordUnion tValue;
tValue.UWord = decodedIRData.decodedRawData;
- if (tValue.UByte.LowByte != (uint8_t) ~(tValue.UByte.HighByte)) {
+ if (tValue.UByte.LowByte != (uint8_t)~(tValue.UByte.HighByte)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("FAST: "));
Serial.print(F("8 bit parity is not correct. Expected=0x"));
diff --git a/lib/IRremote/src/ir_JVC.hpp b/lib/IRremote/src/ir_JVC.hpp
index ef69a598..614cc00c 100644
--- a/lib/IRremote/src/ir_JVC.hpp
+++ b/lib/IRremote/src/ir_JVC.hpp
@@ -32,7 +32,7 @@
#ifndef _IR_JVC_HPP
#define _IR_JVC_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -62,8 +62,7 @@
// IRP: {38k,525}<1,-1|1,-3>(16,-8,(D:8,F:8,1,-45)+)
// LSB first, 1 start bit + 8 bit address + 8 bit command + 1 stop bit.
// The JVC protocol repeats by skipping the header mark and space -> this leads to a poor repeat detection for JVC protocol.
-// Some JVC devices require to send 3 repeats.
-
+// Some JVC devices require to send 3 repeats. https://github.com/Arduino-IRremote/Arduino-IRremote/issues/21
#define JVC_ADDRESS_BITS 8 // 8 bit address
#define JVC_COMMAND_BITS 8 // Command
@@ -80,8 +79,8 @@
#define JVC_REPEAT_DISTANCE (uint16_t)(45 * JVC_UNIT) // 23625 - Commands are repeated with a distance of 23 ms for as long as the key on the remote control is held down.
#define JVC_REPEAT_PERIOD 65000 // assume around 40 ms for a JVC frame. JVC IR Remotes: RM-SA911U, RM-SX463U have 45 ms period
-struct PulseDistanceWidthProtocolConstants const JVCProtocolConstants PROGMEM = {JVC, JVC_KHZ, JVC_HEADER_MARK, JVC_HEADER_SPACE, JVC_BIT_MARK,
- JVC_ONE_SPACE, JVC_BIT_MARK, JVC_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (JVC_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), nullptr};
+struct PulseDistanceWidthProtocolConstants JVCProtocolConstants = { JVC, JVC_KHZ, JVC_HEADER_MARK, JVC_HEADER_SPACE, JVC_BIT_MARK,
+JVC_ONE_SPACE, JVC_BIT_MARK, JVC_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (JVC_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), NULL };
/************************************
* Start of send and decode functions
@@ -106,7 +105,7 @@ void IRsend::sendJVC(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRe
while (tNumberOfCommands > 0) {
// Address + command
- sendPulseDistanceWidthData_P(&JVCProtocolConstants, aAddress | (aCommand << JVC_ADDRESS_BITS), JVC_BITS);
+ sendPulseDistanceWidthData(&JVCProtocolConstants, aAddress | (aCommand << JVC_ADDRESS_BITS), JVC_BITS);
tNumberOfCommands--;
// skip last delay!
@@ -149,11 +148,11 @@ bool IRrecv::decodeJVC() {
}
} else {
- if (!checkHeader_P(&JVCProtocolConstants)) {
+ if (!checkHeader(&JVCProtocolConstants)) {
return false;
}
- if (!decodePulseDistanceWidthData_P(&JVCProtocolConstants, JVC_BITS)) {
+ if (!decodePulseDistanceWidthData(&JVCProtocolConstants, JVC_BITS)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("JVC: "));
Serial.println(F("Decode failed"));
diff --git a/lib/IRremote/src/ir_Kaseikyo.hpp b/lib/IRremote/src/ir_Kaseikyo.hpp
index 9abce660..fe61f63e 100644
--- a/lib/IRremote/src/ir_Kaseikyo.hpp
+++ b/lib/IRremote/src/ir_Kaseikyo.hpp
@@ -32,7 +32,7 @@
#ifndef _IR_KASEIKYO_HPP
#define _IR_KASEIKYO_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -118,9 +118,9 @@
#define SHARP_VENDOR_ID_CODE 0x5AAA
#define JVC_VENDOR_ID_CODE 0x0103
-struct PulseDistanceWidthProtocolConstants const KaseikyoProtocolConstants PROGMEM = {KASEIKYO, KASEIKYO_KHZ, KASEIKYO_HEADER_MARK,
- KASEIKYO_HEADER_SPACE, KASEIKYO_BIT_MARK, KASEIKYO_ONE_SPACE, KASEIKYO_BIT_MARK, KASEIKYO_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST
- , (KASEIKYO_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), nullptr};
+struct PulseDistanceWidthProtocolConstants KaseikyoProtocolConstants = { KASEIKYO, KASEIKYO_KHZ, KASEIKYO_HEADER_MARK,
+KASEIKYO_HEADER_SPACE, KASEIKYO_BIT_MARK, KASEIKYO_ONE_SPACE, KASEIKYO_BIT_MARK, KASEIKYO_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST
+ , (KASEIKYO_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), NULL };
/************************************
* Start of send and decode functions
@@ -146,7 +146,7 @@ void IRsend::sendKaseikyo(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumb
IRRawDataType tRawKaseikyoData[2];
tRawKaseikyoData[0] = (uint32_t) tSendValue.UWord.LowWord << 16 | aVendorCode; // LSB of tRawKaseikyoData[0] is sent first
tRawKaseikyoData[1] = tSendValue.UWord.HighWord;
- sendPulseDistanceWidthFromArray_P(&KaseikyoProtocolConstants, &tRawKaseikyoData[0], KASEIKYO_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidthFromArray(&KaseikyoProtocolConstants, &tRawKaseikyoData[0], KASEIKYO_BITS, aNumberOfRepeats);
#else
LongLongUnion tSendValue;
tSendValue.UWords[0] = aVendorCode;
@@ -154,7 +154,7 @@ void IRsend::sendKaseikyo(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumb
tSendValue.UWords[1] = (aAddress << KASEIKYO_VENDOR_ID_PARITY_BITS) | tVendorParity; // set low nibble to parity
tSendValue.UBytes[4] = aCommand;
tSendValue.UBytes[5] = aCommand ^ tSendValue.UBytes[2] ^ tSendValue.UBytes[3]; // Parity
- sendPulseDistanceWidth_P(&KaseikyoProtocolConstants, tSendValue.ULongLong, KASEIKYO_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&KaseikyoProtocolConstants, tSendValue.ULongLong, KASEIKYO_BITS, aNumberOfRepeats);
#endif
}
@@ -208,12 +208,12 @@ bool IRrecv::decodeKaseikyo() {
return false;
}
- if (!checkHeader_P(&KaseikyoProtocolConstants)) {
+ if (!checkHeader(&KaseikyoProtocolConstants)) {
return false;
}
// decode first 16 Vendor ID bits
- if (!decodePulseDistanceWidthData_P(&KaseikyoProtocolConstants, KASEIKYO_VENDOR_ID_BITS)) {
+ if (!decodePulseDistanceWidthData(&KaseikyoProtocolConstants, KASEIKYO_VENDOR_ID_BITS)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("Kaseikyo: "));
Serial.println(F("Vendor ID decode failed"));
@@ -243,7 +243,7 @@ bool IRrecv::decodeKaseikyo() {
/*
* Decode next 32 bits, 8 VendorID parity parity + 12 address (device and subdevice) + 8 command + 8 parity
*/
- if (!decodePulseDistanceWidthData_P(&KaseikyoProtocolConstants,
+ if (!decodePulseDistanceWidthData(&KaseikyoProtocolConstants,
KASEIKYO_VENDOR_ID_PARITY_BITS + KASEIKYO_ADDRESS_BITS + KASEIKYO_COMMAND_BITS + KASEIKYO_PARITY_BITS,
3 + (2 * KASEIKYO_VENDOR_ID_BITS))) {
#if defined(LOCAL_DEBUG)
diff --git a/lib/IRremote/src/ir_LG.hpp b/lib/IRremote/src/ir_LG.hpp
index 0eacdb54..52df1dbd 100644
--- a/lib/IRremote/src/ir_LG.hpp
+++ b/lib/IRremote/src/ir_LG.hpp
@@ -8,7 +8,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2017-2025 Darryl Smith, Armin Joachimsmeyer
+ * Copyright (c) 2017-2024 Darryl Smith, Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@
#ifndef _IR_LG_HPP
#define _IR_LG_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -114,11 +114,11 @@
//#define LG_REPEAT_DURATION (LG_HEADER_MARK + LG_REPEAT_HEADER_SPACE + LG_BIT_MARK)
//#define LG_REPEAT_DISTANCE (LG_REPEAT_PERIOD - LG_AVERAGE_DURATION) // 52 ms
-struct PulseDistanceWidthProtocolConstants const LGProtocolConstants PROGMEM= {LG, LG_KHZ, LG_HEADER_MARK, LG_HEADER_SPACE, LG_BIT_MARK,
- LG_ONE_SPACE, LG_BIT_MARK, LG_ZERO_SPACE, PROTOCOL_IS_MSB_FIRST, (LG_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), &sendNECSpecialRepeat};
+struct PulseDistanceWidthProtocolConstants LGProtocolConstants = { LG, LG_KHZ, LG_HEADER_MARK, LG_HEADER_SPACE, LG_BIT_MARK,
+LG_ONE_SPACE, LG_BIT_MARK, LG_ZERO_SPACE, PROTOCOL_IS_MSB_FIRST, (LG_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), &sendNECSpecialRepeat };
-struct PulseDistanceWidthProtocolConstants const LG2ProtocolConstants PROGMEM = {LG2, LG_KHZ, LG2_HEADER_MARK, LG2_HEADER_SPACE, LG_BIT_MARK,
- LG_ONE_SPACE, LG_BIT_MARK, LG_ZERO_SPACE, PROTOCOL_IS_MSB_FIRST, (LG_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), &sendLG2SpecialRepeat};
+struct PulseDistanceWidthProtocolConstants LG2ProtocolConstants = { LG2, LG_KHZ, LG2_HEADER_MARK, LG2_HEADER_SPACE, LG_BIT_MARK,
+LG_ONE_SPACE, LG_BIT_MARK, LG_ZERO_SPACE, PROTOCOL_IS_MSB_FIRST, (LG_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), &sendLG2SpecialRepeat };
/************************************
* Start of send and decode functions
@@ -163,14 +163,14 @@ uint32_t IRsend::computeLGRawDataAndChecksum(uint8_t aAddress, uint16_t aCommand
* LG uses the NEC repeat.
*/
void IRsend::sendLG(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
- sendPulseDistanceWidth_P(&LGProtocolConstants, computeLGRawDataAndChecksum(aAddress, aCommand), LG_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&LGProtocolConstants, computeLGRawDataAndChecksum(aAddress, aCommand), LG_BITS, aNumberOfRepeats);
}
/**
* LG2 uses a special repeat.
*/
void IRsend::sendLG2(uint8_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
- sendPulseDistanceWidth_P(&LG2ProtocolConstants, computeLGRawDataAndChecksum(aAddress, aCommand), LG_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&LG2ProtocolConstants, computeLGRawDataAndChecksum(aAddress, aCommand), LG_BITS, aNumberOfRepeats);
}
bool IRrecv::decodeLG() {
@@ -232,7 +232,7 @@ bool IRrecv::decodeLG() {
return false;
}
- if (!decodePulseDistanceWidthData_P(&LGProtocolConstants, LG_BITS)) {
+ if (!decodePulseDistanceWidthData(&LGProtocolConstants, LG_BITS)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("LG: "));
Serial.println(F("Decode failed"));
@@ -284,7 +284,7 @@ bool IRrecv::decodeLG() {
* @param aNumberOfRepeats If < 0 then only a special repeat frame will be sent.
*/
void IRsend::sendLGRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats) {
- sendPulseDistanceWidth_P(&LGProtocolConstants, aRawData, LG_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&LGProtocolConstants, aRawData, LG_BITS, aNumberOfRepeats);
}
bool IRrecv::decodeLGMSB(decode_results *aResults) {
diff --git a/lib/IRremote/src/ir_Lego.hpp b/lib/IRremote/src/ir_Lego.hpp
index 156bf743..1885f3bf 100644
--- a/lib/IRremote/src/ir_Lego.hpp
+++ b/lib/IRremote/src/ir_Lego.hpp
@@ -83,9 +83,9 @@
#define LEGO_MODE_COMBO 1
#define LEGO_MODE_SINGLE 0x4 // here the 2 LSB have meanings like Output A / Output B
-struct PulseDistanceWidthProtocolConstants LegoProtocolConstants = { LEGO_PF, 38, LEGO_HEADER_MARK, LEGO_HEADER_SPACE,
-LEGO_BIT_MARK, LEGO_ONE_SPACE, LEGO_BIT_MARK, LEGO_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (LEGO_AUTO_REPEAT_PERIOD_MIN
- / MICROS_IN_ONE_MILLI), nullptr };
+struct PulseDistanceWidthProtocolConstants LegoProtocolConstants = { LEGO_PF, 38, LEGO_HEADER_MARK, LEGO_HEADER_SPACE, LEGO_BIT_MARK,
+LEGO_ONE_SPACE, LEGO_BIT_MARK, LEGO_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (LEGO_AUTO_REPEAT_PERIOD_MIN
+ / MICROS_IN_ONE_MILLI), NULL };
/************************************
* Start of send and decode functions
diff --git a/lib/IRremote/src/ir_MagiQuest.hpp b/lib/IRremote/src/ir_MagiQuest.hpp
index 73599526..291f8086 100644
--- a/lib/IRremote/src/ir_MagiQuest.hpp
+++ b/lib/IRremote/src/ir_MagiQuest.hpp
@@ -14,7 +14,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2017-2025 E. Stuart Hicks <[email protected]>, Armin Joachimsmeyer
+ * Copyright (c) 2017-2024 E. Stuart Hicks <[email protected]>, Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -38,7 +38,7 @@
#ifndef _IR_MAGIQUEST_HPP
#define _IR_MAGIQUEST_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -55,6 +55,7 @@
//==============================================================================
/*
* https://github.com/kitlaan/Arduino-IRremote/blob/master/ir_Magiquest.cpp
+ * https://github.com/Arduino-IRremote/Arduino-IRremote/discussions/1027#discussioncomment-3636857
* https://github.com/Arduino-IRremote/Arduino-IRremote/issues/1015#issuecomment-1222247231
Protocol=MagiQuest Address=0xFF00 Command=0x176 Raw-Data=0x6BCDFF00 56 bits MSB first
@@ -108,9 +109,9 @@
#define MAGIQUEST_ZERO_SPACE (3 * MAGIQUEST_UNIT) // 864
// assume 110 as repeat period
-struct PulseDistanceWidthProtocolConstants const MagiQuestProtocolConstants PROGMEM = { MAGIQUEST, 38, MAGIQUEST_ZERO_MARK, MAGIQUEST_ZERO_SPACE,
+struct PulseDistanceWidthProtocolConstants MagiQuestProtocolConstants = { MAGIQUEST, 38, MAGIQUEST_ZERO_MARK, MAGIQUEST_ZERO_SPACE,
MAGIQUEST_ONE_MARK, MAGIQUEST_ONE_SPACE, MAGIQUEST_ZERO_MARK, MAGIQUEST_ZERO_SPACE, PROTOCOL_IS_MSB_FIRST | SUPPRESS_STOP_BIT, 110,
-nullptr };
+ NULL };
//+=============================================================================
//
/**
@@ -130,11 +131,11 @@ void IRsend::sendMagiQuest(uint32_t aWandId, uint16_t aMagnitude) {
tChecksum = ~tChecksum + 1;
// 8 start bits
- sendPulseDistanceWidthData_P(&MagiQuestProtocolConstants, 0, 8);
+ sendPulseDistanceWidthData(&MagiQuestProtocolConstants, 0, 8);
// 48 bit data
- sendPulseDistanceWidthData_P(&MagiQuestProtocolConstants, aWandId, MAGIQUEST_WAND_ID_BITS); // send only 31 bit, do not send MSB here
- sendPulseDistanceWidthData_P(&MagiQuestProtocolConstants, aMagnitude, MAGIQUEST_MAGNITUDE_BITS);
- sendPulseDistanceWidthData_P(&MagiQuestProtocolConstants, tChecksum, MAGIQUEST_CHECKSUM_BITS);
+ sendPulseDistanceWidthData(&MagiQuestProtocolConstants, aWandId, MAGIQUEST_WAND_ID_BITS); // send only 31 bit, do not send MSB here
+ sendPulseDistanceWidthData(&MagiQuestProtocolConstants, aMagnitude, MAGIQUEST_MAGNITUDE_BITS);
+ sendPulseDistanceWidthData(&MagiQuestProtocolConstants, tChecksum, MAGIQUEST_CHECKSUM_BITS);
#if defined(LOCAL_DEBUG)
// must be after sending, in order not to destroy the send timing
Serial.print(F("MagiQuest checksum=0x"));
@@ -164,7 +165,7 @@ bool IRrecv::decodeMagiQuest() {
/*
* Check for 8 zero header bits
*/
- if (!decodePulseDistanceWidthData_P(&MagiQuestProtocolConstants, MAGIQUEST_START_BITS, 1)) {
+ if (!decodePulseDistanceWidthData(&MagiQuestProtocolConstants, MAGIQUEST_START_BITS, 1)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("MagiQuest: "));
Serial.println(F("Start bit decode failed"));
@@ -183,7 +184,7 @@ bool IRrecv::decodeMagiQuest() {
/*
* Decode the 31 bit ID
*/
- if (!decodePulseDistanceWidthData_P(&MagiQuestProtocolConstants, MAGIQUEST_WAND_ID_BITS, (MAGIQUEST_START_BITS * 2) + 1)) {
+ if (!decodePulseDistanceWidthData(&MagiQuestProtocolConstants, MAGIQUEST_WAND_ID_BITS, (MAGIQUEST_START_BITS * 2) + 1)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("MagiQuest: "));
Serial.println(F("ID decode failed"));
@@ -207,7 +208,7 @@ bool IRrecv::decodeMagiQuest() {
/*
* Decode the 9 bit Magnitude + 8 bit checksum
*/
- if (!decodePulseDistanceWidthData_P(&MagiQuestProtocolConstants, MAGIQUEST_MAGNITUDE_BITS + MAGIQUEST_CHECKSUM_BITS,
+ if (!decodePulseDistanceWidthData(&MagiQuestProtocolConstants, MAGIQUEST_MAGNITUDE_BITS + MAGIQUEST_CHECKSUM_BITS,
((MAGIQUEST_WAND_ID_BITS + MAGIQUEST_START_BITS) * 2) + 1)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("MagiQuest: "));
diff --git a/lib/IRremote/src/ir_NEC.hpp b/lib/IRremote/src/ir_NEC.hpp
index 6302b424..b02931cc 100644
--- a/lib/IRremote/src/ir_NEC.hpp
+++ b/lib/IRremote/src/ir_NEC.hpp
@@ -8,7 +8,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2020-2025 Armin Joachimsmeyer
+ * Copyright (c) 2020-2023 Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@
#ifndef _IR_NEC_HPP
#define _IR_NEC_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG // IR_DEBUG_PRINT is a real print function here. Add local debug output.
#else
//#define LOCAL_DEBUG // This enables debug output only for this file. IR_DEBUG_PRINT is still a void function here.
@@ -72,7 +72,7 @@
// http://www.hifi-remote.com/wiki/index.php/NEC
// https://www.sbprojects.net/knowledge/ir/nec.php
// NEC: LSB first, <start bit><address:16> (or <address:8><inverted address:8>) <command:16><command:8><inverted command:8><stop bit>.
-// ONKYO (sometimes called NECext): like NEC but force to 16 independent address and 16 bit command bits: <start bit><address:16><command:16><stop bit>
+// ONKYO: like NEC but force to 16 independent address and 16 bit command bits: <start bit><address:16><command:16><stop bit>
// Standard NEC sends a special fixed repeat frame.
// NEC2: like NEC, but for repeat, the same full frame is sent after the 110 ms. I have a DVD remote with NEC2.
// NEC and NEC 2 only differ in the repeat frames, so the protocol can only be detected correctly after the first repeat.
@@ -115,13 +115,14 @@
#define APPLE_ADDRESS 0x87EE
-struct PulseDistanceWidthProtocolConstants const NECProtocolConstants PROGMEM = {NEC, NEC_KHZ, NEC_HEADER_MARK, NEC_HEADER_SPACE, NEC_BIT_MARK,
- NEC_ONE_SPACE, NEC_BIT_MARK, NEC_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (NEC_REPEAT_PERIOD / MICROS_IN_ONE_MILLI),
- &sendNECSpecialRepeat};
+struct PulseDistanceWidthProtocolConstants NECProtocolConstants =
+ { NEC, NEC_KHZ, NEC_HEADER_MARK, NEC_HEADER_SPACE, NEC_BIT_MARK,
+ NEC_ONE_SPACE, NEC_BIT_MARK, NEC_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (NEC_REPEAT_PERIOD / MICROS_IN_ONE_MILLI),
+ &sendNECSpecialRepeat };
// Like NEC but repeats are full frames instead of special NEC repeats
-struct PulseDistanceWidthProtocolConstants const NEC2ProtocolConstants PROGMEM = {NEC2, NEC_KHZ, NEC_HEADER_MARK, NEC_HEADER_SPACE, NEC_BIT_MARK,
- NEC_ONE_SPACE, NEC_BIT_MARK, NEC_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (NEC_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), nullptr};
+struct PulseDistanceWidthProtocolConstants NEC2ProtocolConstants = { NEC2, NEC_KHZ, NEC_HEADER_MARK, NEC_HEADER_SPACE, NEC_BIT_MARK,
+NEC_ONE_SPACE, NEC_BIT_MARK, NEC_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (NEC_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), NULL };
/************************************
* Start of send and decode functions
@@ -180,7 +181,7 @@ uint32_t IRsend::computeNECRawDataAndChecksum(uint16_t aAddress, uint16_t aComma
* @param aNumberOfRepeats If < 0 then only a special NEC repeat frame will be sent by calling NECProtocolConstants.SpecialSendRepeatFunction().
*/
void IRsend::sendNEC(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
- sendPulseDistanceWidth_P(&NECProtocolConstants, computeNECRawDataAndChecksum(aAddress, aCommand), NEC_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&NECProtocolConstants, computeNECRawDataAndChecksum(aAddress, aCommand), NEC_BITS, aNumberOfRepeats);
}
/**
@@ -189,7 +190,7 @@ void IRsend::sendNEC(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOf
* will be sent by calling NECProtocolConstants.SpecialSendRepeatFunction().
*/
void IRsend::sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
- sendPulseDistanceWidth_P(&NECProtocolConstants, (uint32_t) aCommand << 16 | aAddress, NEC_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&NECProtocolConstants, (uint32_t) aCommand << 16 | aAddress, NEC_BITS, aNumberOfRepeats);
}
/**
@@ -198,7 +199,7 @@ void IRsend::sendOnkyo(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumber
* @param aNumberOfRepeats If < 0 then nothing is sent.
*/
void IRsend::sendNEC2(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
- sendPulseDistanceWidth_P(&NEC2ProtocolConstants, computeNECRawDataAndChecksum(aAddress, aCommand), NEC_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&NEC2ProtocolConstants, computeNECRawDataAndChecksum(aAddress, aCommand), NEC_BITS, aNumberOfRepeats);
}
/**
@@ -219,7 +220,7 @@ void IRsend::sendApple(uint8_t aDeviceId, uint8_t aCommand, int_fast8_t aNumberO
tRawData.UByte.MidHighByte = aCommand;
tRawData.UByte.HighByte = aDeviceId; // e.g. 0xD7
- sendPulseDistanceWidth_P(&NECProtocolConstants, tRawData.ULong, NEC_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&NECProtocolConstants, tRawData.ULong, NEC_BITS, aNumberOfRepeats);
}
/**
@@ -228,7 +229,7 @@ void IRsend::sendApple(uint8_t aDeviceId, uint8_t aCommand, int_fast8_t aNumberO
* will be sent by calling NECProtocolConstants.SpecialSendRepeatFunction().
*/
void IRsend::sendNECRaw(uint32_t aRawData, int_fast8_t aNumberOfRepeats) {
- sendPulseDistanceWidth_P(&NECProtocolConstants, aRawData, NEC_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&NECProtocolConstants, aRawData, NEC_BITS, aNumberOfRepeats);
}
/**
@@ -277,7 +278,7 @@ bool IRrecv::decodeNEC() {
}
// Try to decode as NEC protocol
- if (!decodePulseDistanceWidthData_P(&NECProtocolConstants, NEC_BITS)) {
+ if (!decodePulseDistanceWidthData(&NECProtocolConstants, NEC_BITS)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("NEC: "));
Serial.println(F("Decode failed"));
diff --git a/lib/IRremote/src/ir_Others.hpp b/lib/IRremote/src/ir_Others.hpp
index 20e4cc62..cc5291b0 100644
--- a/lib/IRremote/src/ir_Others.hpp
+++ b/lib/IRremote/src/ir_Others.hpp
@@ -58,11 +58,11 @@
#define DISH_ZERO_SPACE 2800
#define DISH_REPEAT_SPACE 6200 // really?
-struct PulseDistanceWidthProtocolConstants const DishProtocolConstants PROGMEM = { UNKNOWN, 56, DISH_HEADER_MARK, DISH_HEADER_SPACE,
-DISH_BIT_MARK, DISH_ONE_SPACE, DISH_BIT_MARK, DISH_ZERO_SPACE, PROTOCOL_IS_MSB_FIRST, 40, nullptr };
+struct PulseDistanceWidthProtocolConstants DishProtocolConstants = { UNKNOWN, 56, DISH_HEADER_MARK, DISH_HEADER_SPACE,
+DISH_BIT_MARK, DISH_ONE_SPACE, DISH_BIT_MARK, DISH_ZERO_SPACE, PROTOCOL_IS_MSB_FIRST, 40, NULL };
void IRsend::sendDish(uint16_t aData) {
- sendPulseDistanceWidth_P(&DishProtocolConstants, aData, DISH_BITS, 4);
+ sendPulseDistanceWidth(&DishProtocolConstants, aData, DISH_BITS, 4);
}
//==============================================================================
@@ -84,11 +84,11 @@ void IRsend::sendDish(uint16_t aData) {
#define WHYNTER_ONE_SPACE 2150
#define WHYNTER_ZERO_SPACE 750
-struct PulseDistanceWidthProtocolConstants const WhynterProtocolConstants PROGMEM = { WHYNTER, 38, WHYNTER_HEADER_MARK, WHYNTER_HEADER_SPACE,
-WHYNTER_BIT_MARK, WHYNTER_ONE_SPACE, WHYNTER_BIT_MARK, WHYNTER_ZERO_SPACE, PROTOCOL_IS_MSB_FIRST, 110, nullptr };
+struct PulseDistanceWidthProtocolConstants WhynterProtocolConstants = { WHYNTER, 38, WHYNTER_HEADER_MARK, WHYNTER_HEADER_SPACE,
+WHYNTER_BIT_MARK, WHYNTER_ONE_SPACE, WHYNTER_BIT_MARK, WHYNTER_ZERO_SPACE, PROTOCOL_IS_MSB_FIRST, 110, NULL };
void IRsend::sendWhynter(uint32_t aData, uint8_t aNumberOfBitsToSend) {
- sendPulseDistanceWidth_P(&WhynterProtocolConstants, aData, NEC_BITS, aNumberOfBitsToSend);
+ sendPulseDistanceWidth(&WhynterProtocolConstants, aData, NEC_BITS, aNumberOfBitsToSend);
}
bool IRrecv::decodeWhynter() {
@@ -96,10 +96,10 @@ bool IRrecv::decodeWhynter() {
if (decodedIRData.rawlen != (2 * WHYNTER_BITS) + 4) {
return false;
}
- if (!checkHeader_P(&WhynterProtocolConstants)) {
+ if (!checkHeader(&WhynterProtocolConstants)) {
return false;
}
- if (!decodePulseDistanceWidthData_P(&WhynterProtocolConstants, WHYNTER_BITS)) {
+ if (!decodePulseDistanceWidthData(&WhynterProtocolConstants, WHYNTER_BITS)) {
return false;
}
// Success
diff --git a/lib/IRremote/src/ir_Pronto.hpp b/lib/IRremote/src/ir_Pronto.hpp
index e07c0b50..b7b31d27 100644
--- a/lib/IRremote/src/ir_Pronto.hpp
+++ b/lib/IRremote/src/ir_Pronto.hpp
@@ -2,8 +2,6 @@
* @file ir_Pronto.hpp
* @brief In this file, the functions IRrecv::compensateAndPrintPronto and IRsend::sendPronto are defined.
*
- * Pronto is the standard for the professional audio and video hardware market.
- *
* See http://www.harctoolbox.org/Glossary.html#ProntoSemantics
* Pronto database http://www.remotecentral.com/search.htm
*
@@ -12,7 +10,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2020-2025 Bengt Martensson, Armin Joachimsmeyer
+ * Copyright (c) 2020 Bengt Martensson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -36,7 +34,7 @@
#ifndef _IR_PRONTO_HPP
#define _IR_PRONTO_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -101,7 +99,7 @@ void IRsend::sendPronto(const uint16_t *data, uint16_t length, int_fast8_t aNumb
uint16_t durations[intros + repeats];
for (uint16_t i = 0; i < intros + repeats; i++) {
uint32_t duration = ((uint32_t) data[i + numbersInPreamble]) * timebase;
- durations[i] = (uint16_t)((duration <= UINT16_MAX) ? duration : UINT16_MAX);
+ durations[i] = (uint16_t) ((duration <= UINT16_MAX) ? duration : UINT16_MAX);
}
/*
@@ -211,25 +209,24 @@ static uint16_t toFrequencyCode(uint16_t frequency) {
return referenceFrequency / effectiveFrequency(frequency);
}
-static char DigitToHex(uint8_t x) {
+static char hexDigit(uint16_t x) {
return (char) (x <= 9 ? ('0' + x) : ('A' + (x - 10)));
}
-static void dumpDigitHex(Print *aSerial, uint8_t number) {
- aSerial->print(DigitToHex(number));
+static void dumpDigit(Print *aSerial, uint16_t number) {
+ aSerial->print(hexDigit(number));
}
-static void dumpNumberHex(Print *aSerial, uint16_t number) {
- // Loop through all 4 nibbles
+static void dumpNumber(Print *aSerial, uint16_t number) {
for (uint16_t i = 0; i < digitsInProntoNumber; i++) {
uint16_t shifts = bitsInHexadecimal * (digitsInProntoNumber - 1 - i);
- dumpDigitHex(aSerial, (number >> shifts) & hexMask);
+ dumpDigit(aSerial, (number >> shifts) & hexMask);
}
aSerial->print(' ');
}
-static void dumpDurationHex(Print *aSerial, uint32_t duration, uint16_t timebase) {
- dumpNumberHex(aSerial, (duration + timebase / 2) / timebase);
+static void dumpDuration(Print *aSerial, uint32_t duration, uint16_t timebase) {
+ dumpNumber(aSerial, (duration + timebase / 2) / timebase);
}
/*
@@ -244,27 +241,26 @@ static void compensateAndDumpSequence(Print *aSerial, const volatile IRRawbufTyp
} else {
tDuration += getMarkExcessMicros();
}
- dumpDurationHex(aSerial, tDuration, timebase);
+ dumpDuration(aSerial, tDuration, timebase);
}
// append a gap
- dumpDurationHex(aSerial, PRONTO_DEFAULT_GAP, timebase);
+ dumpDuration(aSerial, PRONTO_DEFAULT_GAP, timebase);
}
/**
* Print the result (second argument) as Pronto Hex on the Print supplied as argument.
* Used in the ReceiveDump example.
- * Do not print repeat sequence data.
* @param aSerial The Print object on which to write, for Arduino you can use &Serial.
* @param aFrequencyHertz Modulation frequency in Hz. Often 38000Hz.
*/
void IRrecv::compensateAndPrintIRResultAsPronto(Print *aSerial, uint16_t aFrequencyHertz) {
- aSerial->println(F("Pronto Hex as string without repeat sequence"));
+ aSerial->println(F("Pronto Hex as string"));
aSerial->print(F("char prontoData[] = \""));
- dumpNumberHex(aSerial, aFrequencyHertz > 0 ? learnedToken : learnedNonModulatedToken);
- dumpNumberHex(aSerial, toFrequencyCode(aFrequencyHertz));
- dumpNumberHex(aSerial, (decodedIRData.rawlen + 1) / 2);
- dumpNumberHex(aSerial, 0); // no repeat data
+ dumpNumber(aSerial, aFrequencyHertz > 0 ? learnedToken : learnedNonModulatedToken);
+ dumpNumber(aSerial, toFrequencyCode(aFrequencyHertz));
+ dumpNumber(aSerial, (decodedIRData.rawlen + 1) / 2);
+ dumpNumber(aSerial, 0);
uint16_t timebase = toTimebase(aFrequencyHertz);
compensateAndDumpSequence(aSerial, &decodedIRData.rawDataPtr->rawbuf[1], decodedIRData.rawlen - 1, timebase); // skip leading space
aSerial->println(F("\";"));
@@ -275,18 +271,18 @@ void IRrecv::compensateAndPrintIRResultAsPronto(Print *aSerial, uint16_t aFreque
* and can lead to resource problems especially on small processors like AVR's
*/
-static bool dumpDigitHex(String *aString, uint8_t number) {
- aString->concat(DigitToHex(number));
+static bool dumpDigit(String *aString, uint16_t number) {
+ aString->concat(hexDigit(number));
return number;
}
-static size_t dumpNumberHex(String *aString, uint16_t number) {
+static size_t dumpNumber(String *aString, uint16_t number) {
size_t size = 0;
for (uint16_t i = 0; i < digitsInProntoNumber; i++) {
uint16_t shifts = bitsInHexadecimal * (digitsInProntoNumber - 1 - i);
- size += dumpDigitHex(aString, (number >> shifts) & hexMask);
+ size += dumpDigit(aString, (number >> shifts) & hexMask);
}
aString->concat(' ');
size++;
@@ -297,8 +293,8 @@ static size_t dumpNumberHex(String *aString, uint16_t number) {
/*
* Compensate received values by MARK_EXCESS_MICROS, like it is done for decoding!
*/
-static size_t dumpDurationHex(String *aString, uint32_t duration, uint16_t timebase) {
- return dumpNumberHex(aString, (duration + timebase / 2) / timebase);
+static size_t dumpDuration(String *aString, uint32_t duration, uint16_t timebase) {
+ return dumpNumber(aString, (duration + timebase / 2) / timebase);
}
static size_t compensateAndDumpSequence(String *aString, const volatile IRRawbufType *data, size_t length, uint16_t timebase) {
@@ -313,11 +309,11 @@ static size_t compensateAndDumpSequence(String *aString, const volatile IRRawbuf
} else {
tDuration += getMarkExcessMicros();
}
- size += dumpDurationHex(aString, tDuration, timebase);
+ size += dumpDuration(aString, tDuration, timebase);
}
// append minimum gap
- size += dumpDurationHex(aString, PRONTO_DEFAULT_GAP, timebase);
+ size += dumpDuration(aString, PRONTO_DEFAULT_GAP, timebase);
return size;
}
@@ -331,11 +327,12 @@ size_t IRrecv::compensateAndStorePronto(String *aString, uint16_t frequency) {
size_t size = 0;
uint16_t timebase = toTimebase(frequency);
- size += dumpNumberHex(aString, frequency > 0 ? learnedToken : learnedNonModulatedToken);
- size += dumpNumberHex(aString, toFrequencyCode(frequency));
- size += dumpNumberHex(aString, (decodedIRData.rawlen + 1) / 2);
- size += dumpNumberHex(aString, 0);
- size += compensateAndDumpSequence(aString, &decodedIRData.rawDataPtr->rawbuf[1], decodedIRData.rawlen - 1, timebase); // skip leading space
+ size += dumpNumber(aString, frequency > 0 ? learnedToken : learnedNonModulatedToken);
+ size += dumpNumber(aString, toFrequencyCode(frequency));
+ size += dumpNumber(aString, (decodedIRData.rawlen + 1) / 2);
+ size += dumpNumber(aString, 0);
+ size += compensateAndDumpSequence(aString, &decodedIRData.rawDataPtr->rawbuf[1], decodedIRData.rawlen - 1,
+ timebase); // skip leading space
return size;
}
diff --git a/lib/IRremote/src/ir_RC5_RC6.hpp b/lib/IRremote/src/ir_RC5_RC6.hpp
index d97f11b4..2cc8dd43 100644
--- a/lib/IRremote/src/ir_RC5_RC6.hpp
+++ b/lib/IRremote/src/ir_RC5_RC6.hpp
@@ -8,8 +8,6 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2020-2025 Armin Joachimsmeyer
- *
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@@ -32,7 +30,7 @@
#ifndef _IR_RC5_RC6_HPP
#define _IR_RC5_RC6_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -70,7 +68,6 @@ uint8_t sLastSendToggleValue = 1; // To start first command with toggle 0
//
// see: https://www.sbprojects.net/knowledge/ir/rc5.php
// https://en.wikipedia.org/wiki/Manchester_code
-// https://en.wikipedia.org/wiki/RC-5
// https://forum.arduino.cc/t/sending-rc-5-extended-code-using-irsender/1045841/10 - Protocol Maranz Extended
// mark->space => 0
// space->mark => 1
@@ -246,8 +243,8 @@ bool IRrecv::decodeRC5() {
+ 450
Sum: 23150
*/
-// Frame RC6: 1 start bit + 1 Bit "1" + 3 mode bits (000) + 1 toggle bit + 8 address + 8 command bits + 2666us pause - 22 bits incl. start bit
-// Frame RC6A: 1 start bit + 1 Bit "1" + 3 mode bits (110) + 1 toggle bit + "1" + 14 customer bits + 8 system bits + 8 command bits + 2666us pause - 37 bits incl. start bit
+// Frame RC6: 1 start bit + 1 Bit "1" + 3 mode bits (000) + 1 toggle bit + 8 address + 8 command bits + 2666us pause
+// Frame RC6A: 1 start bit + 1 Bit "1" + 3 mode bits (110) + 1 toggle bit + "1" + 14 customer bits + 8 system bits + 8 command bits (=31bits) + 2666us pause
// !!! toggle bit has another timing :-( !!!
// mark->space => 1
// space->mark => 0
@@ -264,10 +261,8 @@ bool IRrecv::decodeRC5() {
#define RC6_TOGGLE_BIT_INDEX RC6_MODE_BITS // fourth position, index = 3
#define RC6_ADDRESS_BITS 8
#define RC6_COMMAND_BITS 8
-#define RC6_CUSTOMER_BITS 14
#define RC6_BITS (RC6_LEADING_BIT + RC6_MODE_BITS + RC6_TOGGLE_BIT + RC6_ADDRESS_BITS + RC6_COMMAND_BITS) // 21
-#define RC6A_BITS (RC6_LEADING_BIT + RC6_MODE_BITS + RC6_TOGGLE_BIT + 1 + RC6_CUSTOMER_BITS + RC6_ADDRESS_BITS + RC6_COMMAND_BITS) // 36
#define RC6_UNIT 444 // 16 periods of 36 kHz (444.4444)
@@ -393,57 +388,6 @@ void IRsend::sendRC6(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRe
}
}
-/**
- * Assemble raw data for RC6 from parameters and toggle state and send
- * We do not wait for the minimal trailing space of 2666 us
- * @param aEnableAutomaticToggle Send toggle bit according to the state of the static sLastSendToggleValue variable.
- */
-void IRsend::sendRC6A(uint8_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint16_t aCustomer,
- bool aEnableAutomaticToggle) {
-
- LongUnion tIRRawData;
- tIRRawData.UByte.LowByte = aCommand;
- tIRRawData.UByte.MidLowByte = aAddress;
-
- tIRRawData.UWord.HighWord = aCustomer | 0x400; // bit 31 is always 1
-
- if (aEnableAutomaticToggle) {
- if (sLastSendToggleValue == 0) {
- sLastSendToggleValue = 1;
- // set toggled bit
- IR_DEBUG_PRINT(F("Set Toggle "));
- tIRRawData.UByte.HighByte |= 0x80; // toggle bit is bit 32
- } else {
- sLastSendToggleValue = 0;
- }
- }
-
- // Set mode bits
- uint64_t tRawData = tIRRawData.ULong + 0x0600000000;
-
-#if defined(LOCAL_DEBUG)
- Serial.print(F("RC6A: "));
- Serial.print(F("sLastSendToggleValue="));
- Serial.print (sLastSendToggleValue);
- Serial.print(F(" RawData="));
- Serial.println(tIRRawData.ULong, HEX);
-#endif
-
- uint_fast8_t tNumberOfCommands = aNumberOfRepeats + 1;
- while (tNumberOfCommands > 0) {
-
- // start and leading bits are sent by sendRC6
- sendRC6Raw(tRawData, RC6A_BITS - 1); // -1 since the leading bit is additionally sent by sendRC6
-
- tNumberOfCommands--;
- // skip last delay!
- if (tNumberOfCommands > 0) {
- // send repeated command in a fixed raster
- delay(RC6_REPEAT_DISTANCE / MICROS_IN_ONE_MILLI);
- }
- }
-}
-
/**
* Try to decode data as RC6 protocol
*/
@@ -538,7 +482,7 @@ bool IRrecv::decodeRC6() {
tValue.ULong = tDecodedRawData;
decodedIRData.decodedRawData = tDecodedRawData;
- if (tBitIndex < 35) {
+ if (tBitIndex < 36) {
// RC6 8 address bits, 8 command bits
decodedIRData.flags = IRDATA_FLAGS_IS_MSB_FIRST;
decodedIRData.command = tValue.UByte.LowByte;
@@ -550,23 +494,21 @@ bool IRrecv::decodeRC6() {
if (tBitIndex > 20) {
decodedIRData.flags |= IRDATA_FLAGS_EXTRA_INFO;
}
- decodedIRData.protocol = RC6;
-
} else {
- // RC6A
- decodedIRData.flags = IRDATA_FLAGS_IS_MSB_FIRST | IRDATA_FLAGS_EXTRA_INFO;
+ // RC6A - 32 bits
+ decodedIRData.flags = IRDATA_FLAGS_IS_MSB_FIRST;
+ if ((tValue.UByte.MidLowByte & 0x80) != 0) {
+ decodedIRData.flags = IRDATA_FLAGS_TOGGLE_BIT | IRDATA_FLAGS_IS_MSB_FIRST;
+ }
+ tValue.UByte.MidLowByte &= 0x87F; // mask toggle bit
decodedIRData.command = tValue.UByte.LowByte;
decodedIRData.address = tValue.UByte.MidLowByte;
- decodedIRData.extra = tValue.UWord.HighWord & 0x3FFF; // Mask to 14 bits, remove toggle and constant 1
- if ((tValue.UByte.HighByte & 0x80) != 0) {
- decodedIRData.flags |= IRDATA_FLAGS_TOGGLE_BIT;
- }
- decodedIRData.protocol = RC6A;
}
// check for repeat, do not check toggle bit yet
checkForRepeatSpaceTicksAndSetFlag(RC6_MAXIMUM_REPEAT_DISTANCE / MICROS_PER_TICK);
+ decodedIRData.protocol = RC6;
return true;
}
diff --git a/lib/IRremote/src/ir_Samsung.hpp b/lib/IRremote/src/ir_Samsung.hpp
index 58b285df..eaa6e921 100644
--- a/lib/IRremote/src/ir_Samsung.hpp
+++ b/lib/IRremote/src/ir_Samsung.hpp
@@ -8,7 +8,7 @@
************************************************************************************
* MIT License
*
- * Copyright (c) 2017-2025 Darryl Smith, Armin Joachimsmeyer
+ * Copyright (c) 2017-2024 Darryl Smith, Armin Joachimsmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@
#ifndef _IR_SAMSUNG_HPP
#define _IR_SAMSUNG_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -102,13 +102,13 @@
#define SAMSUNG_MAXIMUM_REPEAT_DISTANCE (SAMSUNG_REPEAT_PERIOD + (SAMSUNG_REPEAT_PERIOD / 4)) // 137000 - Just a guess
// 19 byte RAM
-struct PulseDistanceWidthProtocolConstants const SamsungProtocolConstants PROGMEM = {SAMSUNG, SAMSUNG_KHZ, SAMSUNG_HEADER_MARK,
- SAMSUNG_HEADER_SPACE, SAMSUNG_BIT_MARK, SAMSUNG_ONE_SPACE, SAMSUNG_BIT_MARK, SAMSUNG_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST,
- (SAMSUNG_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), nullptr};
+struct PulseDistanceWidthProtocolConstants SamsungProtocolConstants = { SAMSUNG, SAMSUNG_KHZ, SAMSUNG_HEADER_MARK,
+SAMSUNG_HEADER_SPACE, SAMSUNG_BIT_MARK, SAMSUNG_ONE_SPACE, SAMSUNG_BIT_MARK, SAMSUNG_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST,
+ (SAMSUNG_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), NULL };
-struct PulseDistanceWidthProtocolConstants const SamsungLGProtocolConstants PROGMEM = {SAMSUNGLG, SAMSUNG_KHZ, SAMSUNG_HEADER_MARK,
- SAMSUNG_HEADER_SPACE, SAMSUNG_BIT_MARK, SAMSUNG_ONE_SPACE, SAMSUNG_BIT_MARK, SAMSUNG_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST,
- (SAMSUNG_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), &sendSamsungLGSpecialRepeat};
+struct PulseDistanceWidthProtocolConstants SamsungLGProtocolConstants = { SAMSUNGLG, SAMSUNG_KHZ, SAMSUNG_HEADER_MARK,
+SAMSUNG_HEADER_SPACE, SAMSUNG_BIT_MARK, SAMSUNG_ONE_SPACE, SAMSUNG_BIT_MARK, SAMSUNG_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST,
+ (SAMSUNG_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), &sendSamsungLGSpecialRepeat };
/************************************
* Start of send and decode functions
************************************/
@@ -143,7 +143,6 @@ void sendSamsungLGSpecialRepeat() {
/*
* Sent e.g. by an LG 6711R1P071A remote
- * @param aAddress 16 bit address. If < 0x100, i.e. only 8 bit, then a (standard) 16 bit address <8_bit_address><8_bit_address> is generated.
* @param aNumberOfRepeats If < 0 then only a special repeat frame will be sent
*/
void IRsend::sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumberOfRepeats) {
@@ -155,13 +154,10 @@ void IRsend::sendSamsungLG(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNu
// send 16 bit address and 8 command bits and then 8 inverted command bits LSB first
LongUnion tRawData;
tRawData.UWord.LowWord = aAddress;
- if (aAddress < 0x100) { // This disables the sending of an (non standard?) 16 bit address with upper byte = 0 like 0x0014.
- tRawData.UByte.MidLowByte = aAddress; // here we have 8 bit address which must be duplicated
- }
tRawData.UByte.MidHighByte = aCommand;
tRawData.UByte.HighByte = ~aCommand;
- sendPulseDistanceWidth_P(&SamsungLGProtocolConstants, tRawData.ULong, SAMSUNG_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&SamsungLGProtocolConstants, tRawData.ULong, SAMSUNG_BITS, aNumberOfRepeats);
}
/**
@@ -195,7 +191,7 @@ void IRsend::sendSamsung(uint16_t aAddress, uint16_t aCommand, int_fast8_t aNumb
tSendValue.UWords[1] = aCommand;
}
- sendPulseDistanceWidth_P(&SamsungProtocolConstants, tSendValue.ULong, SAMSUNG_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&SamsungProtocolConstants, tSendValue.ULong, SAMSUNG_BITS, aNumberOfRepeats);
}
/**
@@ -212,7 +208,7 @@ void IRsend::sendSamsung16BitAddressAnd8BitCommand(uint16_t aAddress, uint8_t aC
tSendValue.UBytes[2] = aCommand;
tSendValue.UBytes[3] = ~aCommand;
- sendPulseDistanceWidth_P(&SamsungProtocolConstants, tSendValue.ULong, SAMSUNG_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&SamsungProtocolConstants, tSendValue.ULong, SAMSUNG_BITS, aNumberOfRepeats);
}
/**
@@ -228,7 +224,7 @@ void IRsend::sendSamsung16BitAddressAndCommand(uint16_t aAddress, uint16_t aComm
// Send 16 command bits
tSendValue.UWords[1] = aCommand;
- sendPulseDistanceWidth_P(&SamsungProtocolConstants, tSendValue.ULong, SAMSUNG_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&SamsungProtocolConstants, tSendValue.ULong, SAMSUNG_BITS, aNumberOfRepeats);
}
/**
* Here we send Samsung48
@@ -248,7 +244,7 @@ void IRsend::sendSamsung48(uint16_t aAddress, uint32_t aCommand, int_fast8_t aNu
tRawSamsungData[1] = tUpper8BitsOfCommand | (~tUpper8BitsOfCommand) << 8;
tRawSamsungData[0] = tSendValue.ULong;
- sendPulseDistanceWidthFromArray_P(&SamsungProtocolConstants, &tRawSamsungData[0], SAMSUNG48_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidthFromArray(&SamsungProtocolConstants, &tRawSamsungData[0], SAMSUNG48_BITS, aNumberOfRepeats);
#else
LongLongUnion tSendValue;
tSendValue.UWords[0] = aAddress;
@@ -261,7 +257,7 @@ void IRsend::sendSamsung48(uint16_t aAddress, uint32_t aCommand, int_fast8_t aNu
} else {
tSendValue.ULongLong = aAddress | aCommand << 16;
}
- sendPulseDistanceWidth_P(&SamsungProtocolConstants, tSendValue.ULongLong, SAMSUNG48_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&SamsungProtocolConstants, tSendValue.ULongLong, SAMSUNG48_BITS, aNumberOfRepeats);
#endif
}
@@ -282,7 +278,7 @@ bool IRrecv::decodeSamsung() {
return false;
}
- if (!checkHeader_P(&SamsungProtocolConstants)) {
+ if (!checkHeader(&SamsungProtocolConstants)) {
return false;
}
@@ -298,7 +294,7 @@ bool IRrecv::decodeSamsung() {
/*
* Decode first 32 bits
*/
- if (!decodePulseDistanceWidthData_P(&SamsungProtocolConstants, SAMSUNG_BITS, 3)) {
+ if (!decodePulseDistanceWidthData(&SamsungProtocolConstants, SAMSUNG_BITS, 3)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("Samsung: "));
Serial.println(F("Decode failed"));
@@ -314,7 +310,7 @@ bool IRrecv::decodeSamsung() {
* Samsung48
*/
// decode additional 16 bit
- if (!decodePulseDistanceWidthData_P(&SamsungProtocolConstants, (SAMSUNG_COMMAND32_BITS - SAMSUNG_COMMAND16_BITS),
+ if (!decodePulseDistanceWidthData(&SamsungProtocolConstants, (SAMSUNG_COMMAND32_BITS - SAMSUNG_COMMAND16_BITS),
3 + (2 * SAMSUNG_BITS))) {
#if defined(LOCAL_DEBUG)
Serial.print(F("Samsung: "));
@@ -353,15 +349,11 @@ bool IRrecv::decodeSamsung() {
if (tValue.UByte.MidHighByte == (uint8_t)(~tValue.UByte.HighByte)) {
// 8 bit command protocol -> assume 8 bit address
decodedIRData.command = tValue.UByte.MidHighByte; // first 8 bit
- }
-
- if (tValue.UByte.MidLowByte == tValue.UByte.LowByte) {
- decodedIRData.address = tValue.UByte.LowByte; // assume LowByte == MidLowByte as seen for a LG HX906 A/V Receive E8172C2C
+ decodedIRData.address = tValue.UByte.LowByte; // assume LowByte == MidLowByte
} else {
// 16 bit command protocol, address is filled above with the 16 bit value
decodedIRData.command = tValue.UWord.HighWord; // first 16 bit
}
-
decodedIRData.numberOfBits = SAMSUNG_BITS;
decodedIRData.protocol = SAMSUNG;
}
diff --git a/lib/IRremote/src/ir_Sony.hpp b/lib/IRremote/src/ir_Sony.hpp
index bcb9eb9d..59b7a8f7 100644
--- a/lib/IRremote/src/ir_Sony.hpp
+++ b/lib/IRremote/src/ir_Sony.hpp
@@ -30,7 +30,7 @@
#ifndef _IR_SONY_HPP
#define _IR_SONY_HPP
-#if defined(DEBUG)
+#if defined(DEBUG) && !defined(LOCAL_DEBUG)
#define LOCAL_DEBUG
#else
//#define LOCAL_DEBUG // This enables debug output only for this file
@@ -90,8 +90,8 @@
#define SONY_REPEAT_PERIOD 45000 // Commands are repeated every 45 ms (measured from start to start) for as long as the key on the remote control is held down.
#define SONY_MAXIMUM_REPEAT_DISTANCE (SONY_REPEAT_PERIOD - SONY_AVERAGE_DURATION_MIN) // 24 ms
-struct PulseDistanceWidthProtocolConstants const SonyProtocolConstants PROGMEM = { SONY, SONY_KHZ, SONY_HEADER_MARK, SONY_SPACE, SONY_ONE_MARK,
-SONY_SPACE, SONY_ZERO_MARK, SONY_SPACE, PROTOCOL_IS_LSB_FIRST, (SONY_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), nullptr };
+struct PulseDistanceWidthProtocolConstants SonyProtocolConstants = { SONY, SONY_KHZ, SONY_HEADER_MARK, SONY_SPACE, SONY_ONE_MARK,
+SONY_SPACE, SONY_ZERO_MARK, SONY_SPACE, PROTOCOL_IS_LSB_FIRST, (SONY_REPEAT_PERIOD / MICROS_IN_ONE_MILLI), NULL };
/************************************
* Start of send and decode functions
@@ -103,12 +103,12 @@ SONY_SPACE, SONY_ZERO_MARK, SONY_SPACE, PROTOCOL_IS_LSB_FIRST, (SONY_REPEAT_PERI
void IRsend::sendSony(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats, uint8_t numberOfBits) {
uint32_t tData = (uint32_t) aAddress << 7 | (aCommand & 0x7F);
// send 5, 8, 13 address bits LSB first
- sendPulseDistanceWidth_P(&SonyProtocolConstants, tData, numberOfBits, aNumberOfRepeats);
+ sendPulseDistanceWidth(&SonyProtocolConstants, tData, numberOfBits, aNumberOfRepeats);
}
bool IRrecv::decodeSony() {
- if (!checkHeader_P(&SonyProtocolConstants)) {
+ if (!checkHeader(&SonyProtocolConstants)) {
return false;
}
@@ -122,7 +122,7 @@ bool IRrecv::decodeSony() {
return false;
}
- if (!decodePulseDistanceWidthData_P(&SonyProtocolConstants, (decodedIRData.rawlen - 1) / 2, 3)) {
+ if (!decodePulseDistanceWidthData(&SonyProtocolConstants, (decodedIRData.rawlen - 1) / 2, 3)) {
#if defined(LOCAL_DEBUG)
Serial.print(F("Sony: "));
Serial.println(F("Decode failed"));
diff --git a/lib/IRremote/src/ir_Template.hpp b/lib/IRremote/src/ir_Template.hpp
index ce1dab06..9855f51a 100644
--- a/lib/IRremote/src/ir_Template.hpp
+++ b/lib/IRremote/src/ir_Template.hpp
@@ -123,9 +123,9 @@
#define SHUZU_OTHER 1234 // Other things you may need to define
// use BOSEWAVE, we have no SHUZU code
-struct PulseDistanceWidthProtocolConstants const ShuzuProtocolConstants PROGMEM = {BOSEWAVE, 38, SHUZU_HEADER_MARK, SHUZU_HEADER_SPACE,
- SHUZU_BIT_MARK, SHUZU_ONE_SPACE, SHUZU_BIT_MARK, SHUZU_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (SHUZU_REPEAT_PERIOD
- / MICROS_IN_ONE_MILLI), nullptr};
+struct PulseDistanceWidthProtocolConstants ShuzuProtocolConstants = { BOSEWAVE, 38, SHUZU_HEADER_MARK, SHUZU_HEADER_SPACE,
+SHUZU_BIT_MARK, SHUZU_ONE_SPACE, SHUZU_BIT_MARK, SHUZU_ZERO_SPACE, PROTOCOL_IS_LSB_FIRST, (SHUZU_REPEAT_PERIOD
+ / MICROS_IN_ONE_MILLI), NULL };
/************************************
* Start of send and decode functions
@@ -133,7 +133,7 @@ struct PulseDistanceWidthProtocolConstants const ShuzuProtocolConstants PROGMEM
void IRsend::sendShuzu(uint16_t aAddress, uint8_t aCommand, int_fast8_t aNumberOfRepeats) {
- sendPulseDistanceWidth_P(&ShuzuProtocolConstants, (uint32_t) aCommand << 8 | aCommand, SHUZU_BITS, aNumberOfRepeats);
+ sendPulseDistanceWidth(&ShuzuProtocolConstants, (uint32_t) aCommand << 8 | aCommand, SHUZU_BITS, aNumberOfRepeats);
}
bool IRrecv::decodeShuzu() {
@@ -149,12 +149,12 @@ bool IRrecv::decodeShuzu() {
}
// Check header
- if (!checkHeader_P(&ShuzuProtocolConstants)) {
+ if (!checkHeader(&ShuzuProtocolConstants)) {
return false;
}
// Decode
- if (!decodePulseDistanceData_P(&ShuzuProtocolConstants, SHUZU_BITS)) {
+ if (!decodePulseDistanceData(&ShuzuProtocolConstants, SHUZU_BITS)) {
IR_DEBUG_PRINT(F("Shuzu: "));
IR_DEBUG_PRINTLN(F("Decode failed"));
return false;
diff --git a/lib/IRremote/src/private/IRTimer.hpp b/lib/IRremote/src/private/IRTimer.hpp
index be3c50c4..acb1b97c 100644
--- a/lib/IRremote/src/private/IRTimer.hpp
+++ b/lib/IRremote/src/private/IRTimer.hpp
@@ -44,17 +44,15 @@
/*
* Functions declared here
*/
-void timerConfigForReceive(); // Initialization of 50 us timer, interrupts are still disabled
-void timerEnableReceiveInterrupt(); // Enable interrupts of an initialized timer
-void timerDisableReceiveInterrupt(); // Disable interrupts of an initialized timer
-void timerResetInterruptPending(); // ISR helper function for some architectures, which require a manual reset
-// of the pending interrupt (TIMER_REQUIRES_RESET_INTR_PENDING is defined). Otherwise empty.
-
-void timerConfigForSend(uint16_t aFrequencyKHz); // Initialization of timer hardware generated PWM, if defined(SEND_PWM_BY_TIMER)
-void enableSendPWMByTimer(); // Switch on PWM generation
-void disableSendPWMByTimer(); // Switch off PWM generation
-
-// SEND_PWM_BY_TIMER for different architectures is enabled / defined at IRremote.hpp line 195.
+void timerResetInterruptPending();
+void timerEnableReceiveInterrupt();
+void timerDisableReceiveInterrupt();
+void timerConfigForReceive();
+void enableSendPWMByTimer();
+void disableSendPWMByTimer();
+void timerConfigForSend(uint16_t aFrequencyKHz);
+
+// SEND_PWM_BY_TIMER is defined in IRremote.hpp line 195.
#if defined(SEND_PWM_BY_TIMER) && ( (defined(ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(PARTICLE)) || defined(ARDUINO_ARCH_MBED) )
#define SEND_PWM_DOES_NOT_USE_RECEIVE_TIMER // Receive timer and send generation timer are independent here.
#endif
@@ -63,13 +61,6 @@ void disableSendPWMByTimer(); // Switch off PWM generation
#undef IR_SEND_PIN // To avoid "warning: "IR_SEND_PIN" redefined". The user warning is done at IRremote.hpp line 202.
#endif
-#if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-// Use the inverse value, so same code should work for active Low output
-#define IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH (100 - IR_SEND_DUTY_CYCLE_PERCENT)
-#else
-#define IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH IR_SEND_DUTY_CYCLE_PERCENT
-#endif
-
// Macros for enabling timers for development
//#define SEND_PWM_BY_TIMER
//#define IR_USE_AVR_TIMER1
@@ -126,7 +117,7 @@ void timerDisableReceiveInterrupt() {
/**
* IF PWM should be generated not by software, but by a timer, this function sets output pin mode,
- * configures the timer for generating a PWM with HIGH output level of duty cycle of IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH
+ * configures the timer for generating a PWM with duty cycle of IR_SEND_DUTY_CYCLE_PERCENT
* and disables the receive interrupt if it uses the same resource.
* For most architectures, the pin number(s) which can be used for output is determined by the timer used!
* The output of the PWM signal is controlled by enableSendPWMByTimer() and disableSendPWMByTimer().
@@ -203,7 +194,7 @@ void disableSendPWMByTimer() {
// ATtiny84
#elif defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny88__)
# if !defined(IR_USE_AVR_TIMER1)
-#define IR_USE_AVR_TIMER1 // send pin = pin 6, no tone() available when using ATTinyCore
+#define IR_USE_AVR_TIMER1 // send pin = pin 6
# endif
#elif defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__)
@@ -346,7 +337,6 @@ void timerConfigForReceive() {
}
# if defined(SEND_PWM_BY_TIMER)
-// Set IR_SEND_PIN depending on CPU
# if defined(CORE_OC1A_PIN)
#define IR_SEND_PIN CORE_OC1A_PIN // Teensy
@@ -387,9 +377,9 @@ void timerConfigForReceive() {
//#define IR_SEND_PIN PIN_PB6 // OC1AX / PB6 / Pin14 at ATTinyCore
# endif
-# else // defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__)
+# else
#define IR_SEND_PIN 9 // OC1A Arduino Duemilanove, Diecimila, LilyPad, Sparkfun Pro Micro, Leonardo, MH-ET Tiny88 etc.
-# endif // Set IR_SEND_PIN depending on CPU
+# endif // defined(CORE_OC1A_PIN)
# if defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__)
// Clear OC1A/OC1B on Compare Match when up-counting. Set OC1A/OC1B on Compare Match when down counting.
@@ -403,31 +393,20 @@ void enableSendPWMByTimer() {
//TCNT1 = 0; TCCR1A |= _BV(COM1B1); TCCR1D |= _BV(OC1BX); // + enable OC1BX as output
}
# else
-void enableSendPWMByTimer() {
+void disableSendPWMByTimer() {
TCNT1 = 0;
TCCR1A |= _BV(COM1A1);
- TCCR1D |= _BV(OC1AU); // + enable OC1AU as output
+ TCCR1D |= _BV(OC1AU); // + enable OC1BU as output
//TCNT1 = 0; TCCR1A |= _BV(COM1A1); TCCR1D |= _BV(OC1AV); // + enable OC1BV as output
//TCNT1 = 0; TCCR1A |= _BV(COM1A1); TCCR1D |= _BV(OC1AW); // + enable OC1BW as output
//TCNT1 = 0; TCCR1A |= _BV(COM1A1); TCCR1D |= _BV(OC1AX); // + enable OC1BX as output
}
-# endif // defined(USE_TIMER_CHANNEL_B)
+# endif
void disableSendPWMByTimer() {
TCCR1D = 0;
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
-# else // defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__)
+# else
# if defined(USE_TIMER_CHANNEL_B)
void enableSendPWMByTimer() {
TCNT1 = 0;
@@ -435,40 +414,17 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
TCCR1A &= ~(_BV(COM1B1));
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
-# else // defined(USE_TIMER_CHANNEL_B)
+# else
void enableSendPWMByTimer() {
TCNT1 = 0;
TCCR1A |= _BV(COM1A1); // Clear OC1A/OC1B on Compare Match when up-counting. Set OC1A/OC1B on Compare Match when downcounting.
}
void disableSendPWMByTimer() {
TCCR1A &= ~(_BV(COM1A1));
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
-# endif // defined(USE_TIMER_CHANNEL_B)
-
-# endif // defined(__AVR_ATtiny87__) || defined(__AVR_ATtiny167__)
+# endif
+# endif
/*
* timerConfigForSend() is used exclusively by IRsend::enableIROut()
@@ -477,31 +433,31 @@ void disableSendPWMByTimer() {
void timerConfigForSend(uint16_t aFrequencyKHz) {
timerDisableReceiveInterrupt();
-# if (((F_CPU / 2000) / 38) < 256)
+# if (((F_CPU / 2000) / 38) < 256)
const uint16_t tPWMWrapValue = (F_CPU / 2000) / (aFrequencyKHz); // 210,52 for 38 kHz @16 MHz clock, 2000 instead of 1000 because of Phase Correct PWM
TCCR1A = _BV(WGM11); // PWM, Phase Correct, Top is ICR1
TCCR1B = _BV(WGM13) | _BV(CS10); // CS10 -> no prescaling
ICR1 = tPWMWrapValue - 1;
-# if defined(USE_TIMER_CHANNEL_B)
- OCR1B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
-# else
- OCR1A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
-# endif
- TCNT1 = 0; // not really required, since we have an 8 bit counter, but makes the signal more reproducible
+# if defined(USE_TIMER_CHANNEL_B)
+ OCR1B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
# else
+ OCR1A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
+# endif
+ TCNT1 = 0; // not really required, since we have an 8 bit counter, but makes the signal more reproducible
+# else
const uint16_t tPWMWrapValue = ((F_CPU / 8) / 2000) / (aFrequencyKHz); // 2000 instead of 1000 because of Phase Correct PWM
TCCR1A = _BV(WGM11);// PWM, Phase Correct, Top is ICR1
TCCR1B = _BV(WGM13) | _BV(CS11);// CS11 -> Prescaling by 8
ICR1 = tPWMWrapValue - 1;
-# if defined(USE_TIMER_CHANNEL_B)
- OCR1A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
-# else
- OCR1A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
-# endif
+# if defined(USE_TIMER_CHANNEL_B)
+ OCR1A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
+# else
+ OCR1A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
+# endif
TCNT1 = 0; // not really required, since we have an 8 bit counter, but makes the signal more reproducible
-# endif // if (((F_CPU / 2000) / 38) < 256)
+# endif
}
-# endif // defined(SEND_PWM_BY_TIMER) - Timer1
+# endif // defined(SEND_PWM_BY_TIMER)
/*
* AVR Timer2 (8 bits) // Tone timer on Uno
@@ -515,6 +471,7 @@ void timerDisableReceiveInterrupt() {
TIMSK2 = 0;
}
#define TIMER_INTR_NAME TIMER2_COMPB_vect // We use TIMER2_COMPB_vect to be compatible with tone() library
+
#define TIMER_COUNT_TOP (F_CPU * MICROS_PER_TICK / MICROS_IN_ONE_SECOND)
void timerConfigForReceive() {
@@ -534,7 +491,6 @@ void timerConfigForReceive() {
}
# if defined(SEND_PWM_BY_TIMER)
-// Set IR_SEND_PIN depending on CPU
# if defined(CORE_OC2B_PIN)
#define IR_SEND_PIN CORE_OC2B_PIN // Teensy
@@ -549,13 +505,8 @@ void timerConfigForReceive() {
#define IR_SEND_PIN 14 // MightyCore, MegaCore
# else
-/*
- * Using pin 11 / PB3 / OC2A for this purpose is NOT possible, since we need a PWM with a selectable frequency.
- * This is only possible by using Phase Correct with Top as OCR2A.
- * Thus the OCR2A register cannot be used for comparing for channel A and TOP with OCR2B is not supported by Hardware :-(.
- */
-#define IR_SEND_PIN 3 // Arduino Uno Pin PD3, Duemilanove, Diecimila, LilyPad, etc
-# endif // Set IR_SEND_PIN depending on CPU
+#define IR_SEND_PIN 3 // Arduino Duemilanove, Diecimila, LilyPad, etc
+# endif // defined(CORE_OC2B_PIN)
void enableSendPWMByTimer() {
TCNT2 = 0;
@@ -563,17 +514,6 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
TCCR2A &= ~(_BV(COM2B1)); // Normal port operation, OC2B disconnected.
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
/*
@@ -593,14 +533,14 @@ void timerConfigForSend(uint16_t aFrequencyKHz) {
TCCR2A = _BV(WGM20); // PWM, Phase Correct, Top is OCR2A
TCCR2B = _BV(WGM22) | _BV(CS20); // CS20 -> no prescaling
OCR2A = tPWMWrapValue - 1; // The top value for the timer. The modulation frequency will be F_CPU / 2 / (OCR2A + 1).
- OCR2B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
+ OCR2B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
TCNT2 = 0; // not really required, since we have an 8 bit counter, but makes the signal more reproducible
# else
const uint16_t tPWMWrapValue = ((F_CPU / 8) / 2000) / (aFrequencyKHz); // 2000 instead of 1000 because of Phase Correct PWM
TCCR2A = _BV(WGM20);// PWM, Phase Correct, Top is OCR2A
TCCR2B = _BV(WGM22) | _BV(CS21);// CS21 -> Prescaling by 8
OCR2A = tPWMWrapValue - 1;
- OCR2B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
+ OCR2B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
TCNT2 = 0;// not really required, since we have an 8 bit counter, but makes the signal more reproducible
# endif
}
@@ -628,7 +568,6 @@ void timerConfigForReceive() {
}
# if defined(SEND_PWM_BY_TIMER)
-// Set IR_SEND_PIN depending on CPU
# if defined(CORE_OC3A_PIN)
#define IR_SEND_PIN CORE_OC3A_PIN // Teensy
@@ -641,7 +580,7 @@ void timerConfigForReceive() {
# else
#error Please add OC3A pin number here
-# endif // Set IR_SEND_PIN depending on CPU
+# endif
void enableSendPWMByTimer() {
TCNT3 = 0;
@@ -649,17 +588,6 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
TCCR3A &= ~(_BV(COM3A1));
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
/*
@@ -667,16 +595,16 @@ void disableSendPWMByTimer() {
* Set output pin mode and disable receive interrupt if it uses the same resource
*/
void timerConfigForSend(uint16_t aFrequencyKHz) {
-# if F_CPU > 16000000
+#if F_CPU > 16000000
#error "Creating timer PWM with timer 3 is not supported for F_CPU > 16 MHz"
-# endif
+#endif
timerDisableReceiveInterrupt();
const uint16_t tPWMWrapValue = (F_CPU / 2000) / (aFrequencyKHz); // 210,52 for 38 kHz @16 MHz clock, 2000 instead of 1000 because of Phase Correct PWM
TCCR3A = _BV(WGM31);
TCCR3B = _BV(WGM33) | _BV(CS30); // PWM, Phase Correct, ICRn as TOP, complete period is double of tPWMWrapValue
ICR3 = tPWMWrapValue - 1;
- OCR3A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
+ OCR3A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
TCNT3 = 0; // required, since we have an 16 bit counter
}
# endif // defined(SEND_PWM_BY_TIMER)
@@ -701,7 +629,6 @@ void timerConfigForReceive() {
}
# if defined(SEND_PWM_BY_TIMER)
-// Set IR_SEND_PIN depending on CPU
# if defined(CORE_OC4A_PIN)
#define IR_SEND_PIN CORE_OC4A_PIN
# elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
@@ -716,29 +643,18 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
TCCR4A &= ~(_BV(COM4A1));
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
void timerConfigForSend(uint16_t aFrequencyKHz) {
-# if F_CPU > 16000000
+#if F_CPU > 16000000
#error "Creating timer PWM with timer 4 is not supported for F_CPU > 16 MHz"
-# endif
+#endif
timerDisableReceiveInterrupt();
const uint16_t tPWMWrapValue = (F_CPU / 2000) / (aFrequencyKHz); // 210,52 for 38 kHz @16 MHz clock, 2000 instead of 1000 because of Phase Correct PWM
TCCR4A = _BV(WGM41);
TCCR4B = _BV(WGM43) | _BV(CS40);
ICR4 = tPWMWrapValue - 1;
- OCR4A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
+ OCR4A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
TCNT4 = 0; // required, since we have an 16 bit counter
}
# endif // defined(SEND_PWM_BY_TIMER)
@@ -786,17 +702,6 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
TCCR4A &= ~(_BV(COM4A0)); // (Pro Micro does not map PC7 (32/ICP3/CLK0/OC4A)
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
// of ATmega32U4 )
# else
@@ -807,17 +712,6 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
TCCR4A &= ~(_BV(COM4A1));
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
# endif
@@ -839,8 +733,8 @@ void timerConfigForSend(uint16_t aFrequencyKHz) {
TCCR4E = 0;
TC4H = tPWMWrapValue >> 8;
OCR4C = tPWMWrapValue;
- TC4H = (tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH / 100) >> 8;
- OCR4A = (tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH / 100) & 255;
+ TC4H = (tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT / 100) >> 8;
+ OCR4A = (tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT / 100) & 255;
TCNT4 = 0; // not really required, since we have an 8 bit counter, but makes the signal more reproducible
}
# endif // defined(SEND_PWM_BY_TIMER)
@@ -880,17 +774,6 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
TCCR5A &= ~(_BV(COM5A1));
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
/*
@@ -907,7 +790,7 @@ void timerConfigForSend(uint16_t aFrequencyKHz) {
TCCR5A = _BV(WGM51);
TCCR5B = _BV(WGM53) | _BV(CS50);
ICR5 = tPWMWrapValue - 1;
- OCR5A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
+ OCR5A = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
TCNT5 = 0; // required, since we have an 16 bit counter
}
# endif // defined(SEND_PWM_BY_TIMER)
@@ -950,17 +833,6 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
TCCR0A &= ~(_BV(COM0B1));
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
/*
@@ -968,16 +840,16 @@ void disableSendPWMByTimer() {
* Set output pin mode and disable receive interrupt if it uses the same resource
*/
void timerConfigForSend(uint16_t aFrequencyKHz) {
-# if F_CPU > 16000000
+#if F_CPU > 16000000
#error "Creating timer PWM with timer TINY0 is not supported for F_CPU > 16 MHz"
-# endif
+#endif
timerDisableReceiveInterrupt();
const uint16_t tPWMWrapValue = (F_CPU / 2000) / (aFrequencyKHz); // 210,52 for 38 kHz @16 MHz clock, 2000 instead of 1000 because of Phase Correct PWM
TCCR0A = _BV(WGM00); // PWM, Phase Correct, Top is OCR0A
TCCR0B = _BV(WGM02) | _BV(CS00); // CS00 -> no prescaling
OCR0A = tPWMWrapValue - 1;
- OCR0B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
+ OCR0B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
TCNT0 = 0; // not really required, since we have an 8 bit counter, but makes the signal more reproducible
}
# endif // defined(SEND_PWM_BY_TIMER)
@@ -1020,17 +892,6 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
GTCCR &= ~(_BV(PWM1B) | _BV(COM1B0));
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
/*
@@ -1044,14 +905,14 @@ void timerConfigForSend(uint16_t aFrequencyKHz) {
const uint16_t tPWMWrapValue = (F_CPU / 1000) / (aFrequencyKHz); // 421 @16 MHz, 26 @1 MHz and 38 kHz
TCCR1 = _BV(CTC1) | _BV(CS10);// CTC1 = 1: TOP value set to OCR1C, CS10 No Prescaling
OCR1C = tPWMWrapValue - 1;
- OCR1B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
+ OCR1B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
TCNT1 = 0;// not really required, since we have an 8 bit counter, but makes the signal more reproducible
GTCCR = _BV(PWM1B) | _BV(COM1B0);// PWM1B = 1: Enable PWM for OCR1B, COM1B0 Clear on compare match
# else
const uint16_t tPWMWrapValue = ((F_CPU / 2) / 1000) / (aFrequencyKHz); // 210 for 16 MHz and 38 kHz
TCCR1 = _BV(CTC1) | _BV(CS11); // CTC1 = 1: TOP value set to OCR1C, CS11 Prescaling by 2
OCR1C = tPWMWrapValue - 1;
- OCR1B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1;
+ OCR1B = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1;
TCNT1 = 0; // not really required, since we have an 8 bit counter, but makes the signal more reproducible
GTCCR = _BV(PWM1B) | _BV(COM1B0); // PWM1B = 1: Enable PWM for OCR1B, COM1B0 Clear on compare match
# endif
@@ -1127,17 +988,6 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
TCB0.CTRLB &= ~(TCB_CCMPEN_bm);
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
/*
@@ -1154,7 +1004,7 @@ void timerConfigForSend(uint16_t aFrequencyKHz) {
const uint16_t tPWMWrapValue = (F_CPU / 2000) / (aFrequencyKHz); // 210,52 for 38 kHz @16 MHz clock, 2000 instead of 1000 because of using CLK / 2
TCB0.CTRLB = TCB_CNTMODE_PWM8_gc; // 8 bit PWM mode
TCB0.CCMPL = tPWMWrapValue - 1; // Period of 8 bit PWM
- TCB0.CCMPH = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1; // Duty cycle of waveform of 8 bit PWM
+ TCB0.CCMPH = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1; // Duty cycle of waveform of 8 bit PWM
TCB0.CTRLA = (TCB_CLKSEL_CLKDIV2_gc) | (TCB_ENABLE_bm); // use CLK / 2
TCB0.CNT = 0; // not really required, since we have an 8 bit counter, but makes the signal more reproducible
}
@@ -1207,17 +1057,6 @@ void enableSendPWMByTimer() {
}
void disableSendPWMByTimer() {
TCD0.CTRLA = 0; // do not disable output, disable complete timer
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
-# if defined(IR_SEND_PIN)
- digitalWriteFast(IR_SEND_PIN, HIGH);
-# else
- if (__builtin_constant_p(sendPin)) {
- digitalWriteFast(sendPin, HIGH);
- } else {
- digitalWrite(sendPin, HIGH);
- }
-# endif // defined(IR_SEND_PIN)
-# endif // defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
}
/*
@@ -1238,7 +1077,7 @@ void timerConfigForSend(uint16_t aFrequencyKHz) {
// Generate duty cycle signal for debugging etc.
TCD0.CMPASET = 0;
- TCD0.CMPACLR = (tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH / 100) - 1; // duty cycle for WOA
+ TCD0.CMPACLR = (tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT / 100) - 1; // duty cycle for WOA
TCD0.INTFLAGS = TCD_OVF_bm; // reset interrupt flags
TCD0.INTCTRL = TCD_OVF_bm; // overflow interrupt
@@ -1596,36 +1435,34 @@ void timerConfigForReceive() {
**********************************************************/
#elif defined(ESP32)
# if !defined(ESP_ARDUINO_VERSION)
-#define ESP_ARDUINO_VERSION 0x010101 // Version 1.1.1
+#define ESP_ARDUINO_VERSION 0
+# endif
+# if !defined(ESP_ARDUINO_VERSION_VAL)
+#define ESP_ARDUINO_VERSION_VAL(major, minor, patch) 202
# endif
// Variables specific to the ESP32.
// the ledc functions behave like hardware timers for us :-), so we do not require our own soft PWM generation code.
-hw_timer_t *s50usTimer = nullptr; // set by timerConfigForReceive()
-#define _IRREMOTE_ESP32_LEDC_RESOLUTION 8
-#define _IRREMOTE_ESP32_LEDC_RESOLUTION_MAX_PWM_VALUE 255
+hw_timer_t *s50usTimer = NULL; // set by timerConfigForReceive()
-//# if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(3, 0, 0) && !defined(SEND_LEDC_CHANNEL)
-# if ESP_ARDUINO_VERSION < (3 << 16 + 0 >> 8 + 0) && !defined(SEND_LEDC_CHANNEL)
+# if !defined(SEND_LEDC_CHANNEL)
#define SEND_LEDC_CHANNEL 0 // The channel used for PWM 0 to 7 are high speed PWM channels
# endif
void timerEnableReceiveInterrupt() {
-//# if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
-# if ESP_ARDUINO_VERSION >= (3 << 16 + 0 >> 8 + 0)
+# if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0) // timerAlarm() enables it automatically
timerStart(s50usTimer);
# else
timerAlarmEnable(s50usTimer);
# endif
}
-//# if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(2, 0, 2)
-# if ESP_ARDUINO_VERSION < (2 << 16 + 0 >> 8 + 2)
+# if ESP_ARDUINO_VERSION < ESP_ARDUINO_VERSION_VAL(2, 0, 2)
/*
* Special support for ESP core < 202
*/
void timerDisableReceiveInterrupt() {
- if (s50usTimer != nullptr) {
+ if (s50usTimer != NULL) {
timerDetachInterrupt(s50usTimer);
timerEnd(s50usTimer);
}
@@ -1633,9 +1470,8 @@ void timerDisableReceiveInterrupt() {
# else
void timerDisableReceiveInterrupt() {
- if (s50usTimer != nullptr) {
-//# if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
-# if ESP_ARDUINO_VERSION >= (3 << 16 + 0 >> 8 + 0)
+ if (s50usTimer != NULL) {
+# if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
timerStop(s50usTimer);
# else
timerAlarmDisable(s50usTimer);
@@ -1649,15 +1485,14 @@ void timerDisableReceiveInterrupt() {
#undef ISR
# endif
-# if !defined(DISABLE_CODE_FOR_RECEIVER) // Otherwise the &IRReceiveTimerInterruptHandler is referenced, but not available
+# if !defined(DISABLE_CODE_FOR_RECEIVER) // &IRReceiveTimerInterruptHandler is referenced, but not available
void timerConfigForReceive() {
// ESP32 has a proper API to setup timers, no weird chip macros needed
// simply call the readable API versions :)
// 3 timers, choose #1, 80 divider for microsecond precision @80MHz clock, count_up = true
- if (s50usTimer == nullptr) {
+ if(s50usTimer == NULL) {
# if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
- s50usTimer = timerBegin(1000000); // Only 1 parameter is required. 1000000 corresponds to 1 MHz / 1 uSec. After successful setup the timer will automatically start.
- timerStop(s50usTimer); // Stop it here, to avoid "error E (3447) gptimer: gptimer_start(348): timer is not enabled yet" at timerEnableReceiveInterrupt()
+ s50usTimer = timerBegin(1000000); // Only 1 parameter is required. 1000000 corresponds to 1 MHz / 1 uSec
timerAttachInterrupt(s50usTimer, &IRReceiveTimerInterruptHandler);
timerAlarm(s50usTimer, MICROS_PER_TICK, true, 0); // 0 in the last parameter is repeat forever
# else
@@ -1670,35 +1505,29 @@ void timerConfigForReceive() {
}
# endif
-uint8_t sLastSendPin = 0; // Avoid multiple attach() or if pin changes, detach before attach
+# if !defined(IR_SEND_PIN)
+uint8_t sLastSendPin = 0; // To detach before attach, if already attached
+# endif
# if defined(SEND_PWM_BY_TIMER)
void enableSendPWMByTimer() {
# if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
# if defined(IR_SEND_PIN)
- ledcWrite(IR_SEND_PIN, (IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH * _IRREMOTE_ESP32_LEDC_RESOLUTION_MAX_PWM_VALUE) / 100); // 3.x API
+ ledcWrite(IR_SEND_PIN, (IR_SEND_DUTY_CYCLE_PERCENT * 256) / 100); // 3.x API
# else
- ledcWrite(IrSender.sendPin, (IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH * _IRREMOTE_ESP32_LEDC_RESOLUTION_MAX_PWM_VALUE) / 100); // 3.x API
+ ledcWrite(IrSender.sendPin, (IR_SEND_DUTY_CYCLE_PERCENT * 256) / 100); // 3.x API
# endif
# else
// ESP version < 3.0
- ledcWrite(SEND_LEDC_CHANNEL, (IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH * _IRREMOTE_ESP32_LEDC_RESOLUTION_MAX_PWM_VALUE) / 100); // * 256 since we have 8 bit resolution
+ ledcWrite(SEND_LEDC_CHANNEL, (IR_SEND_DUTY_CYCLE_PERCENT * 256) / 100); // * 256 since we have 8 bit resolution
# endif
}
void disableSendPWMByTimer() {
# if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
# if defined(IR_SEND_PIN)
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
- ledcWrite(IR_SEND_PIN, _IRREMOTE_ESP32_LEDC_RESOLUTION_MAX_PWM_VALUE); // 3.x API
-# else
ledcWrite(IR_SEND_PIN, 0); // 3.x API
-# endif
# else
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
- ledcWrite(IrSender.sendPin, _IRREMOTE_ESP32_LEDC_RESOLUTION_MAX_PWM_VALUE); // 3.x API
-# else
ledcWrite(IrSender.sendPin, 0); // 3.x API
-# endif
# endif
# else
// ESP version < 3.0
@@ -1713,20 +1542,17 @@ void disableSendPWMByTimer() {
void timerConfigForSend(uint16_t aFrequencyKHz) {
# if ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(3, 0, 0)
# if defined(IR_SEND_PIN)
- if(sLastSendPin == 0){
- ledcAttach(IR_SEND_PIN, aFrequencyKHz * 1000, _IRREMOTE_ESP32_LEDC_RESOLUTION); // 3.x API
- sLastSendPin = IR_SEND_PIN;
- }
+ ledcAttach(IR_SEND_PIN, aFrequencyKHz * 1000, 8); // 3.x API
# else
if(sLastSendPin != 0 && sLastSendPin != IrSender.sendPin){
ledcDetach(IrSender.sendPin); // detach pin before new attaching see #1194
}
- ledcAttach(IrSender.sendPin, aFrequencyKHz * 1000, _IRREMOTE_ESP32_LEDC_RESOLUTION); // 3.x API
+ ledcAttach(IrSender.sendPin, aFrequencyKHz * 1000, 8); // 3.x API
sLastSendPin = IrSender.sendPin;
# endif
# else
// ESP version < 3.0
- ledcSetup(SEND_LEDC_CHANNEL, aFrequencyKHz * 1000, _IRREMOTE_ESP32_LEDC_RESOLUTION); // 8 bit PWM resolution
+ ledcSetup(SEND_LEDC_CHANNEL, aFrequencyKHz * 1000, 8); // 8 bit PWM resolution
# if defined(IR_SEND_PIN)
ledcAttachPin(IR_SEND_PIN, SEND_LEDC_CHANNEL); // attach pin to channel
# else
@@ -1750,13 +1576,8 @@ void timerConfigForSend(uint16_t aFrequencyKHz) {
# if !defined(IR_SAMD_TIMER)
# if defined(__SAMD51__)
-# if defined(TC5)
#define IR_SAMD_TIMER TC5
#define IR_SAMD_TIMER_IRQ TC5_IRQn
-# else
-#define IR_SAMD_TIMER TC3
-#define IR_SAMD_TIMER_IRQ TC3_IRQn
-# endif
# else
// SAMD21
#define IR_SAMD_TIMER TC3
@@ -1791,11 +1612,7 @@ void timerConfigForReceive() {
# if defined(__SAMD51__)
// Enable the TC5 clock, use generic clock generator 0 (F_CPU) for TC5
-# if defined(TC5_GCLK_ID)
GCLK->PCHCTRL[TC5_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK0_Val | (1 << GCLK_PCHCTRL_CHEN_Pos);
-# else
- GCLK->PCHCTRL[TC3_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK0_Val | (1 << GCLK_PCHCTRL_CHEN_Pos);
-# endif
// The TC should be disabled before the TC is reset in order to avoid undefined behavior.
TC->CTRLA.reg &= ~TC_CTRLA_ENABLE; // Disable the Timer
@@ -1852,12 +1669,18 @@ void timerConfigForReceive() {
}
# if !defined(DISABLE_CODE_FOR_RECEIVER)
-# if defined(__SAMD51__) && defined(TC5)
-void TC5_Handler(void)
+# if defined(__SAMD51__)
+void TC5_Handler(void) {
+ TcCount16 *TC = (TcCount16*) IR_SAMD_TIMER;
+ // Check for right interrupt bit
+ if (TC->INTFLAG.bit.MC0 == 1) {
+ // reset bit for next turn
+ TC->INTFLAG.bit.MC0 = 1;
+ IRReceiveTimerInterruptHandler();
+ }
+}
# else
-void TC3_Handler(void)
-# endif // defined(__SAMD51__)
-{
+void TC3_Handler(void) {
TcCount16 *TC = (TcCount16*) IR_SAMD_TIMER;
// Check for right interrupt bit
if (TC->INTFLAG.bit.MC0 == 1) {
@@ -1866,6 +1689,7 @@ void TC3_Handler(void)
IRReceiveTimerInterruptHandler();
}
}
+# endif // defined(__SAMD51__)
# endif // !defined(DISABLE_CODE_FOR_RECEIVER)
/***************************************
@@ -1900,7 +1724,6 @@ mbed::PwmOut sPwmOutForSendPWM(digitalPinToPinName(IR_SEND_PIN));
mbed::PwmOut sPwmOutForSendPWM(digitalPinToPinName(IrSender.sendPin));
# endif
uint8_t sIROutPuseWidth;
-uint8_t sIROutPuseWidthForHigh; // for setting level to 1
void enableSendPWMByTimer() {
sPwmOutForSendPWM.pulsewidth_us(sIROutPuseWidth);
@@ -1909,11 +1732,7 @@ void enableSendPWMByTimer() {
//void disableSendPWMByTimer() { sPwmOutForSendPWM.suspend();} // this kills pulsewidth_us value and does not set output level to LOW
void disableSendPWMByTimer() {
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
- sPwmOutForSendPWM.pulsewidth_us(sIROutPuseWidthForHigh); // this also sets output level to HIGH :-)
-# else
sPwmOutForSendPWM.pulsewidth_us(0); // this also sets output level to LOW :-)
-# endif
}
/*
@@ -1921,9 +1740,8 @@ void disableSendPWMByTimer() {
* Set output pin mode and disable receive interrupt if it uses the same resource
*/
void timerConfigForSend(uint16_t aFrequencyKHz) {
- sIROutPuseWidthForHigh = 1000 / aFrequencyKHz;
- sPwmOutForSendPWM.period_us(sIROutPuseWidthForHigh); // 26.315 for 38 kHz
- sIROutPuseWidth = (1000 * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / (aFrequencyKHz * 100);
+ sPwmOutForSendPWM.period_us(1000 / aFrequencyKHz); // 26.315 for 38 kHz
+ sIROutPuseWidth = (1000 * IR_SEND_DUTY_CYCLE_PERCENT) / (aFrequencyKHz * 100);
}
# endif // defined(SEND_PWM_BY_TIMER)
@@ -1950,7 +1768,7 @@ bool IRTimerInterruptHandlerHelper(repeating_timer_t*) {
}
void timerEnableReceiveInterrupt() {
- add_repeating_timer_us(-(MICROS_PER_TICK), IRTimerInterruptHandlerHelper, nullptr, &s50usTimer);
+ add_repeating_timer_us(-(MICROS_PER_TICK), IRTimerInterruptHandlerHelper, NULL, &s50usTimer);
}
void timerDisableReceiveInterrupt() {
cancel_repeating_timer(&s50usTimer);
@@ -1959,60 +1777,23 @@ void timerDisableReceiveInterrupt() {
void timerConfigForReceive() {
// no need for initializing timer at setup()
}
-#define SEND_PWM_BY_TIMER // Disable carrier PWM generation in software and use (restricted) hardware PWM.
# if defined(SEND_PWM_BY_TIMER)
#include "hardware/pwm.h"
-#define USE_RP2040_NATIVE_COMMANDS
-# if defined(USE_RP2040_NATIVE_COMMANDS)
uint sSliceNumberForSendPWM;
uint sChannelNumberForSendPWM;
uint sIROutPuseWidth;
-uint16_t sIROutPuseWidthForHigh; // for setting level to 1
-# else
-uint sFrequency;
-# endif
/*
* If we just disable the PWM, the counter stops and the output stays at the state is currently has
*/
void enableSendPWMByTimer() {
-# if defined(USE_RP2040_NATIVE_COMMANDS)
pwm_set_counter(sSliceNumberForSendPWM, 0);
pwm_set_chan_level(sSliceNumberForSendPWM, sChannelNumberForSendPWM, sIROutPuseWidth);
-# else
- analogWriteFreq(sFrequency);
-# if defined(IR_SEND_PIN)
- analogWrite(IR_SEND_PIN, (uint8_t) (IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH * 255 / 100)); // Calculate duty as 0-255 value (analogWrite uses 8-bit resolution)
-# else
- analogWrite(IrSender.sendPin, (uint8_t) (IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH * 255 / 100)); // Calculate duty as 0-255 value (analogWrite uses 8-bit resolution)
-# endif
-# endif
}
-
void disableSendPWMByTimer() {
-# if defined(USE_RP2040_NATIVE_COMMANDS)
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
- pwm_set_chan_level(sSliceNumberForSendPWM, sChannelNumberForSendPWM, sIROutPuseWidthForHigh); // this sets output also to HIGH
-# else
pwm_set_chan_level(sSliceNumberForSendPWM, sChannelNumberForSendPWM, 0); // this sets output also to LOW
-# endif
-# else
-# if defined(IR_SEND_PIN)
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
- analogWrite(IR_SEND_PIN, 255); // analogWrite(0) disables PWM and sets pin HIGH
-# else
- analogWrite(IR_SEND_PIN, 0); // analogWrite(0) disables PWM and sets pin LOW
-# endif
-# else
-# if defined(USE_ACTIVE_LOW_OUTPUT_FOR_SEND_PIN)
- analogWrite(IrSender.sendPin, 255); // analogWrite(0) disables PWM and sets pin HIGH
-# else
- analogWrite(IrSender.sendPin, 0); // analogWrite(0) disables PWM and sets pin LOW
-# endif
-# endif
-# endif
}
/*
@@ -2020,37 +1801,25 @@ void disableSendPWMByTimer() {
* Set output pin mode and disable receive interrupt if it uses the same resource
*/
void timerConfigForSend(uint16_t aFrequencyKHz) {
-# if defined(USE_RP2040_NATIVE_COMMANDS)
-# if defined(IR_SEND_PIN)
+# if defined(IR_SEND_PIN)
gpio_set_function(IR_SEND_PIN, GPIO_FUNC_PWM);
// Find out which PWM slice is connected to IR_SEND_PIN
sSliceNumberForSendPWM = pwm_gpio_to_slice_num(IR_SEND_PIN);
sChannelNumberForSendPWM = pwm_gpio_to_channel(IR_SEND_PIN);
-# else
+# else
gpio_set_function(IrSender.sendPin, GPIO_FUNC_PWM);
// Find out which PWM slice is connected to IR_SEND_PIN
sSliceNumberForSendPWM = pwm_gpio_to_slice_num(IrSender.sendPin);
sChannelNumberForSendPWM = pwm_gpio_to_channel(IrSender.sendPin);
-# endif
-# else
-# if defined(IR_SEND_PIN)
- pinMode(IR_SEND_PIN, OUTPUT); // Set the pin to output mode initially
-# else
- pinMode(IrSender.sendPin, OUTPUT); // Set the pin to output mode initially
-# endif
# endif
-# if defined(USE_RP2040_NATIVE_COMMANDS)
uint16_t tPWMWrapValue = (clock_get_hz(clk_sys)) / (aFrequencyKHz * 1000); // 3289.473 for 38 kHz @125 MHz clock. We have a 16 bit counter and use system clock (125 MHz)
+
pwm_config tPWMConfig = pwm_get_default_config();
- sIROutPuseWidthForHigh = tPWMWrapValue;
pwm_config_set_wrap(&tPWMConfig, tPWMWrapValue - 1);
pwm_init(sSliceNumberForSendPWM, &tPWMConfig, false); // we do not want to send now
- sIROutPuseWidth = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH) / 100) - 1; // 985.84 for 38 kHz
+ sIROutPuseWidth = ((tPWMWrapValue * IR_SEND_DUTY_CYCLE_PERCENT) / 100) - 1; // 985.84 for 38 kHz
pwm_set_chan_level(sSliceNumberForSendPWM, sChannelNumberForSendPWM, 0);
pwm_set_enabled(sSliceNumberForSendPWM, true);
-# else
- sFrequency = aFrequencyKHz * 1000;
-# endif
}
# endif // defined(SEND_PWM_BY_TIMER)
@@ -2214,14 +1983,14 @@ void timerConfigForReceive() {
# if defined(SEND_PWM_BY_TIMER)
# if defined(IR_SEND_PIN)
void enableSendPWMByTimer() {
- analogWrite(IR_SEND_PIN, ((255L * 100) / IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH)), ir_out_kHz*1000);
+ analogWrite(IR_SEND_PIN, ((256L * 100) / IR_SEND_DUTY_CYCLE_PERCENT)), ir_out_kHz*1000);
}
void disableSendPWMByTimer() {
analogWrite(IR_SEND_PIN, 0, ir_out_kHz*1000);
}
# else
void enableSendPWMByTimer() {
- analogWrite(IrSender.sendPin, ((255L * 100) / IR_SEND_DUTY_CYCLE_PERCENT_FOR_LEVEL_HIGH), ir_out_kHz * 1000);
+ analogWrite(IrSender.sendPin, ((256L * 100) / IR_SEND_DUTY_CYCLE_PERCENT), ir_out_kHz * 1000);
}
void disableSendPWMByTimer() {
analogWrite(IrSender.sendPin, 0, ir_out_kHz * 1000);
diff --git a/platformio.ini b/platformio.ini
index 8eab4f89..19521c2d 100644
--- a/platformio.ini
+++ b/platformio.ini
@@ -23,8 +23,6 @@ build_flags =
-D CONFIG_TINYUSB_CDC_ENABLED=1
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
- -std=c++17
- -DSEND_LEDC_CHANNEL=0
-DDEVICE_CARDPUTER
; --- Builtin LED ---
@@ -58,7 +56,6 @@ build_flags =
-DIR_RX_PIN=1
-
[env:m5stick]
platform = espressif32
board = m5stick-c
@@ -73,8 +70,6 @@ lib_deps =
paulstoffregen/OneWire@^2.3.8
esp32ping
build_flags =
- -std=c++17
- -DSEND_LEDC_CHANNEL=0
-DDEVICE_M5STICK
; --- Builtin LED ---
@@ -105,4 +100,4 @@ build_flags =
; --- Infrared ---
-DIR_TX_PIN=19
- -DIR_RX_PIN=0
\ No newline at end of file
+ -DIR_RX_PIN=33
\ No newline at end of file
diff --git a/src/States/GlobalState.h b/src/States/GlobalState.h
index f969e119..4b85c3a2 100644
--- a/src/States/GlobalState.h
+++ b/src/States/GlobalState.h
@@ -243,6 +243,12 @@ public:
#ifdef I2C_FREQ
i2cFrequency = I2C_FREQ;
#endif
+ #ifdef IR_TX_PIN
+ infraredPin = IR_TX_PIN;
+ #endif
+ #ifdef IR_RX_PIN
+ infraredRxPin = IR_RX_PIN;
+ #endif
}
};