Skip to content

Commit aafec49

Browse files
authored
Merge pull request adafruit#7539 from DavePutz/issue_7419
Correct assignment of RMT channels on ESP32C3
2 parents e207db7 + 750535d commit aafec49

File tree

1 file changed

+8
-0
lines changed
  • ports/espressif/peripherals

1 file changed

+8
-0
lines changed

ports/espressif/peripherals/rmt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ void peripherals_rmt_reset(void) {
4040
rmt_channel_t peripherals_find_and_reserve_rmt(bool mode) {
4141
size_t start_channel = 0;
4242
size_t end_channel = RMT_CHANNEL_MAX;
43+
// ESP32C3 can only send on channels 0-1 and receive on channels 2-3
44+
#if defined(CONFIG_IDF_TARGET_ESP32C3)
45+
if (mode == RECEIVE_MODE) {
46+
start_channel = 2;
47+
} else {
48+
end_channel = 2;
49+
}
50+
#endif // ESP32C3
4351
#if SOC_RMT_CHANNELS_PER_GROUP > 4
4452
if (mode == RECEIVE_MODE) {
4553
start_channel = 4;

0 commit comments

Comments
 (0)