Merge pull request #7539 from DavePutz/issue_7419

Correct assignment of RMT channels on ESP32C3
This commit is contained in:
Dan Halbert 2023-02-02 17:35:37 -05:00 committed by GitHub
commit aafec496c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,6 +40,14 @@ void peripherals_rmt_reset(void) {
rmt_channel_t peripherals_find_and_reserve_rmt(bool mode) {
size_t start_channel = 0;
size_t end_channel = RMT_CHANNEL_MAX;
// ESP32C3 can only send on channels 0-1 and receive on channels 2-3
#if defined(CONFIG_IDF_TARGET_ESP32C3)
if (mode == RECEIVE_MODE) {
start_channel = 2;
} else {
end_channel = 2;
}
#endif // ESP32C3
#if SOC_RMT_CHANNELS_PER_GROUP > 4
if (mode == RECEIVE_MODE) {
start_channel = 4;