Skip to content

Commit 67736e9

Browse files
Add automatic single-core ESP32 support (ESP32-C3, ESP32-S2) (#196)
* Initial plan * Add ESP32-C3 single-core support with automatic core detection - Modified signalDecoder.cpp to check CONFIG_FREERTOS_UNICORE - Single-core ESP32 variants (ESP32-C3, ESP32-S2) run decoder on core 0 with priority 3 - Multi-core ESP32 variants run decoder on core 1 with priority 2 - Added documentation in README.md explaining the automatic detection Co-authored-by: NorthernMan54 <19808920+NorthernMan54@users.noreply.github.com> * Final verification complete - ESP32-C3 support ready Co-authored-by: NorthernMan54 <19808920+NorthernMan54@users.noreply.github.com> * Remove temporary codeql symlink --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NorthernMan54 <19808920+NorthernMan54@users.noreply.github.com>
1 parent e824427 commit 67736e9

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,19 @@ Wiring for ESP32 DOIT DevKit V1 and AI-Thinker R01 - SX1278
332332

333333
![image](https://github.com/diepeterpan/rtl_433_ESP/blob/master/docs/Ai-Thinker-Ra-01-Schematic-Diagram.png)
334334

335+
## ESP32 Platform Support
336+
337+
### Single-Core ESP32 Variants (ESP32-C3, ESP32-S2)
338+
339+
The library automatically detects and supports single-core ESP32 variants such as the ESP32-C3 and ESP32-S2. The decoder task's CPU core assignment and priority are automatically adjusted based on the `CONFIG_FREERTOS_UNICORE` configuration:
340+
341+
* **Single-core processors** (ESP32-C3, ESP32-S2): Decoder task runs on core 0 with priority 3
342+
* **Multi-core processors** (ESP32, ESP32-S3): Decoder task runs on core 1 with priority 2
343+
344+
This configuration ensures compatibility with single-core ESP32 variants that only have core 0 available, preventing boot crashes that would occur if the task were pinned to the non-existent core 1.
345+
346+
The `CONFIG_FREERTOS_UNICORE` flag is automatically set by the ESP-IDF/Arduino framework when compiling for single-core ESP32 variants, so no manual configuration is required.
347+
335348
## Wiring and Building the Example
336349

337350
Details are [here](example/OOK_Receiver/README.md)

src/signalDecoder.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@
4141
# endif
4242
#endif
4343

44-
#define rtl_433_Decoder_Priority 2
45-
#define rtl_433_Decoder_Core 1
44+
#ifdef CONFIG_FREERTOS_UNICORE
45+
# define rtl_433_Decoder_Core 0
46+
# define rtl_433_Decoder_Priority 3
47+
#else
48+
# define rtl_433_Decoder_Core 1
49+
# define rtl_433_Decoder_Priority 2
50+
#endif
4651

4752
/*----------------------------- rtl_433_ESP Internals -----------------------------*/
4853

0 commit comments

Comments
 (0)