Skip to content

Commit 8558db8

Browse files
committed
ESP32-C3 modifications
1 parent 29564e8 commit 8558db8

File tree

37 files changed

+231
-137
lines changed

37 files changed

+231
-137
lines changed

.github/workflows/LibraryBuild.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
# - megaTinyCore:megaavr:atxy7:chip=3217,clock=16internal # https://github.com/SpenceKonde/megaTinyCore/issues/935
7070
- esp8266:esp8266:d1_mini:eesz=4M3M,xtal=80
7171
- esp32:esp32:featheresp32:FlashFreq=80
72+
- esp32:esp32:esp32c3
7273
- STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8
7374
- STMicroelectronics:stm32:GenL0:pnum=THUNDERPACK_L072
7475
- stm32duino:STM32F1:genericSTM32F103C
@@ -242,6 +243,13 @@ jobs:
242243
IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=500 -Wno-error=maybe-uninitialized
243244
All: -DRAW_BUFFER_LENGTH=300 -Wno-error=maybe-uninitialized # https://github.com/espressif/arduino-esp32/issues/7024
244245

246+
- arduino-boards-fqbn: esp32:esp32:esp32c3
247+
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
248+
sketches-exclude: TinyReceiver # undefined reference to `TwoWire::onReceive(void (*)(int))'
249+
build-properties: # the flags were put in compiler.cpp.extra_flags. SEND_PWM_BY_TIMER is always enabled!
250+
IRremoteExtensionTest: -DRAW_BUFFER_LENGTH=500 -Wno-error=maybe-uninitialized
251+
All: -DRAW_BUFFER_LENGTH=300 -Wno-error=maybe-uninitialized # https://github.com/espressif/arduino-esp32/issues/7024
252+
245253
#
246254
# STM
247255
#

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Protocols can be switched off and on by defining macros before the line `#includ
107107
- Allows receiving and sending of **raw timing data**.
108108

109109
## New features with version 4.x
110+
- **Since 4.3 `IrSender.begin(DISABLE_LED_FEEDBACK)` will no longer work**, use `IrSender.begin(DISABLE_LED_FEEDBACK, 0)` instead.
110111
- New universal **Pulse Distance / Pulse Width decoder** added, which covers many previous unknown protocols.
111112
- Printout of code how to send received command by `IrReceiver.printIRSendUsage(&Serial)`.
112113
- RawData type is now 64 bit for 32 bit platforms and therefore `decodedIRData.decodedRawData` can contain complete frame information for more protocols than with 32 bit as before.
@@ -120,7 +121,7 @@ Protocols can be switched off and on by defining macros before the line `#includ
120121
- The parameter `bool hasStopBit` is not longer required and removed e.g. for function `sendPulseDistanceWidth()`.
121122

122123
## New features with version 3.x
123-
- **Any pin** can be used for sending -if `SEND_PWM_BY_TIMER` is not defined- and receiving.
124+
- **Any pin** can be used for receiving and if `SEND_PWM_BY_TIMER` is not defined also for sending.
124125
- Feedback LED can be activated for sending / receiving.
125126
- 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).
126127
- Protocol values comply to **protocol standards**.<br/>
@@ -147,7 +148,7 @@ If you use an (old) Arduino core that does not use the `-flto` flag for compile,
147148
- Since the decoded values are now in `IrReceiver.decodedIRData` and not in `results` any more, remove the line `decode_results results` or similar.
148149
- 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)
149150
or `IrReceiver.begin(IR_RECEIVE_PIN, DISABLE_LED_FEEDBACK)` instead of the `IrReceiver.enableIRIn()` or `irrecv.enableIRIn()` in setup().<br/>
150-
For sending, call `IrSender.begin();` or `IrSender.begin(DISABLE_LED_FEEDBACK);` in setup().<br/>
151+
For sending, call `IrSender.begin();` in setup().<br/>
151152
If IR_SEND_PIN is not defined (before the line `#include <IRremote.hpp>`) you must use e.g. `IrSender.begin(3, ENABLE_LED_FEEDBACK, USE_DEFAULT_FEEDBACK_LED_PIN);`
152153
- Old `decode(decode_results *aResults)` function is replaced by simple `decode()`. So if you have a statement `if(irrecv.decode(&results))` replace it with `if (IrReceiver.decode())`.
153154
- The decoded result is now in in `IrReceiver.decodedIRData` and not in `results` any more, therefore replace any occurrences of `results.value` and `results.decode_type` (and similar) to
@@ -292,6 +293,8 @@ The following macros will definitely be overridden with default values otherwise
292293
<br/>
293294

294295
# Receiving IR codes
296+
![IRReceiver Pinout](https://github.com/Arduino-IRremote/Arduino-IRremote/blob/master/pictures/IRReceiverPinout.jpg)
297+
295298
Check for a **completly received IR frame** with:<br/>
296299
`if (IrReceiver.decode()) {}`<br/>
297300
This also decodes the received data.<br/>
@@ -711,7 +714,7 @@ Modify them by enabling / disabling them, or change the values if applicable.
711714
| `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. |
712715
| `IR_SEND_DUTY_CYCLE_PERCENT` | 30 | Duty cycle of IR send signal. |
713716
| `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! |
714-
| `DISABLE_CODE_FOR_RECEIVER` | disabled | Saves up to 450 bytes program memory and 269 bytes RAM if receiving functionality is not required. |
717+
| `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. |
715718
| `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. |
716719
| `FEEDBACK_LED_IS_ACTIVE_LOW` | disabled | Required on some boards (like my BluePill and my ESP8266 board), where the feedback LED is active low. |
717720
| `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. |

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ The latest version may not be released!
33
See also the commit log at github: https://github.com/Arduino-IRremote/Arduino-IRremote/commits/master
44

55
# 4.3.0
6+
- Removed default value USE_DEFAULT_FEEDBACK_LED_PIN for last parameter of IRsend::begin(bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin).
7+
Therefore IrSender.begin(DISABLE_LED_FEEDBACK) will not longer work!
68
- Added convenience function isIRReceiverAttachedForTinyReceiver().
79
- Added Extended NEC Protocol macro to TinyIR by Buzzerb.
810
- Fixed sendSamsung() / sendSamsungLG() bug.
911
- Added functions stopTimer(), restartTimer() and restartTimerWithTicksToAdd().
1012
- Added rawlen and initialGap to IRData.
1113
- Added ReceiveAndSendHobToHood example.
12-
- Removed default value USE_DEFAULT_FEEDBACK_LED_PIN for last parameter of IRsend::begin(bool aEnableLEDFeedback, uint_fast8_t aFeedbackLEDPin).
1314

1415
# 4.2.1
1516
- Fix wrong type of tEnableLEDFeedback in IRSend.hpp and IRReceive.hpp.

examples/AllProtocolsOnLCD/PinDefinitionsAndMore.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* SAMD21 3 4 5
4343
* ESP8266 14|D5 12|D6 %
4444
* ESP32 15 4 27
45+
* ESP32-C3 6 7
4546
* BluePill PA6 PA7 PA3
4647
* APOLLO3 11 12 5
4748
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -173,11 +174,12 @@
173174
#define noTone(a) void()
174175
#define TONE_PIN 42 // Dummy for examples using it
175176

176-
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
177-
#define IR_RECEIVE_PIN 8
178-
#define IR_SEND_PIN 9
179-
#define TONE_PIN 10 // ADC2_0
180-
#define APPLICATION_PIN 11
177+
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
178+
#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...
179+
#define IR_RECEIVE_PIN 6
180+
#define IR_SEND_PIN 7
181+
#define TONE_PIN 10
182+
#define APPLICATION_PIN 18
181183

182184
#elif defined(ESP32)
183185
#include <Arduino.h>

examples/ControlRelay/PinDefinitionsAndMore.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* SAMD21 3 4 5
4343
* ESP8266 14|D5 12|D6 %
4444
* ESP32 15 4 27
45+
* ESP32-C3 6 7
4546
* BluePill PA6 PA7 PA3
4647
* APOLLO3 11 12 5
4748
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -173,11 +174,12 @@
173174
#define noTone(a) void()
174175
#define TONE_PIN 42 // Dummy for examples using it
175176

176-
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
177-
#define IR_RECEIVE_PIN 8
178-
#define IR_SEND_PIN 9
179-
#define TONE_PIN 10 // ADC2_0
180-
#define APPLICATION_PIN 11
177+
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
178+
#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...
179+
#define IR_RECEIVE_PIN 6
180+
#define IR_SEND_PIN 7
181+
#define TONE_PIN 10
182+
#define APPLICATION_PIN 18
181183

182184
#elif defined(ESP32)
183185
#include <Arduino.h>

examples/IRDispatcherDemo/PinDefinitionsAndMore.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* SAMD21 3 4 5
4343
* ESP8266 14|D5 12|D6 %
4444
* ESP32 15 4 27
45+
* ESP32-C3 6 7
4546
* BluePill PA6 PA7 PA3
4647
* APOLLO3 11 12 5
4748
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -173,11 +174,12 @@
173174
#define noTone(a) void()
174175
#define TONE_PIN 42 // Dummy for examples using it
175176

176-
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
177-
#define IR_RECEIVE_PIN 8
178-
#define IR_SEND_PIN 9
179-
#define TONE_PIN 10 // ADC2_0
180-
#define APPLICATION_PIN 11
177+
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
178+
#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...
179+
#define IR_RECEIVE_PIN 6
180+
#define IR_SEND_PIN 7
181+
#define TONE_PIN 10
182+
#define APPLICATION_PIN 18
181183

182184
#elif defined(ESP32)
183185
#include <Arduino.h>

examples/IRremoteExtensionTest/PinDefinitionsAndMore.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* SAMD21 3 4 5
4343
* ESP8266 14|D5 12|D6 %
4444
* ESP32 15 4 27
45+
* ESP32-C3 6 7
4546
* BluePill PA6 PA7 PA3
4647
* APOLLO3 11 12 5
4748
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -173,11 +174,12 @@
173174
#define noTone(a) void()
174175
#define TONE_PIN 42 // Dummy for examples using it
175176

176-
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
177-
#define IR_RECEIVE_PIN 8
178-
#define IR_SEND_PIN 9
179-
#define TONE_PIN 10 // ADC2_0
180-
#define APPLICATION_PIN 11
177+
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
178+
#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...
179+
#define IR_RECEIVE_PIN 6
180+
#define IR_SEND_PIN 7
181+
#define TONE_PIN 10
182+
#define APPLICATION_PIN 18
181183

182184
#elif defined(ESP32)
183185
#include <Arduino.h>

examples/MicroGirs/PinDefinitionsAndMore.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* SAMD21 3 4 5
4343
* ESP8266 14|D5 12|D6 %
4444
* ESP32 15 4 27
45+
* ESP32-C3 6 7
4546
* BluePill PA6 PA7 PA3
4647
* APOLLO3 11 12 5
4748
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -173,11 +174,12 @@
173174
#define noTone(a) void()
174175
#define TONE_PIN 42 // Dummy for examples using it
175176

176-
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
177-
#define IR_RECEIVE_PIN 8
178-
#define IR_SEND_PIN 9
179-
#define TONE_PIN 10 // ADC2_0
180-
#define APPLICATION_PIN 11
177+
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
178+
#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...
179+
#define IR_RECEIVE_PIN 6
180+
#define IR_SEND_PIN 7
181+
#define TONE_PIN 10
182+
#define APPLICATION_PIN 18
181183

182184
#elif defined(ESP32)
183185
#include <Arduino.h>

examples/ReceiveAndSend/PinDefinitionsAndMore.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* SAMD21 3 4 5
4343
* ESP8266 14|D5 12|D6 %
4444
* ESP32 15 4 27
45+
* ESP32-C3 6 7
4546
* BluePill PA6 PA7 PA3
4647
* APOLLO3 11 12 5
4748
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -173,11 +174,12 @@
173174
#define noTone(a) void()
174175
#define TONE_PIN 42 // Dummy for examples using it
175176

176-
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
177-
#define IR_RECEIVE_PIN 8
178-
#define IR_SEND_PIN 9
179-
#define TONE_PIN 10 // ADC2_0
180-
#define APPLICATION_PIN 11
177+
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
178+
#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...
179+
#define IR_RECEIVE_PIN 6
180+
#define IR_SEND_PIN 7
181+
#define TONE_PIN 10
182+
#define APPLICATION_PIN 18
181183

182184
#elif defined(ESP32)
183185
#include <Arduino.h>

examples/ReceiveAndSendDistanceWidth/PinDefinitionsAndMore.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* SAMD21 3 4 5
4343
* ESP8266 14|D5 12|D6 %
4444
* ESP32 15 4 27
45+
* ESP32-C3 6 7
4546
* BluePill PA6 PA7 PA3
4647
* APOLLO3 11 12 5
4748
* RP2040 3|GPIO15 4|GPIO16 5|GPIO17
@@ -173,11 +174,12 @@
173174
#define noTone(a) void()
174175
#define TONE_PIN 42 // Dummy for examples using it
175176

176-
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
177-
#define IR_RECEIVE_PIN 8
178-
#define IR_SEND_PIN 9
179-
#define TONE_PIN 10 // ADC2_0
180-
#define APPLICATION_PIN 11
177+
#elif defined(CONFIG_IDF_TARGET_ESP32C3) || defined(ARDUINO_ESP32C3_DEV)
178+
#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...
179+
#define IR_RECEIVE_PIN 6
180+
#define IR_SEND_PIN 7
181+
#define TONE_PIN 10
182+
#define APPLICATION_PIN 18
181183

182184
#elif defined(ESP32)
183185
#include <Arduino.h>

0 commit comments

Comments
 (0)