Skip to content

Commit a4f3e63

Browse files
authored
feat(rmt): guarding SOC_RMT_SUPPORT_TX_LOOP_COUNT
1 parent eedf368 commit a4f3e63

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cores/esp32/esp32-hal-rmt.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,15 +431,19 @@ bool rmtWriteLooping(int pin, rmt_data_t *data, size_t num_rmt_symbols) {
431431
// loop_count == 0 is invalid (no transmission); loop_count >= 1 means transmit that many times.
432432
bool rmtWriteRepeated(int pin, rmt_data_t *data, size_t num_rmt_symbols, uint32_t loop_count) {
433433
if (loop_count == 0) {
434-
log_w("rmtWriteRepeated: Invalid loop_count (%u). Must be at least 1.", loop_count);
434+
log_e("RMT TX GPIO %d - rmtWriteRepeated: Invalid loop_count (%u). Must be at least 1.", pin, loop_count);
435435
return false;
436436
}
437437
if (loop_count == 1) {
438438
// send the RMT symbols once using non-blocking write (single non-looping transmission)
439439
return _rmtWrite(pin, data, num_rmt_symbols, false /*blocks*/, 0 /*looping*/, 0 /*N/A*/);
440440
} else {
441441
// write the RMT symbols for loop_count times
442+
#if SOC_RMT_SUPPORT_TX_LOOP_COUNT
442443
return _rmtWrite(pin, data, num_rmt_symbols, false /*blocks*/, loop_count /*looping*/, 0 /*N/A*/);
444+
#else
445+
log_e("RMT TX GPIO %d - rmtWriteRepeated: Loop Count is not supported. Writing failed.", pin);
446+
#endif
443447
}
444448
}
445449

0 commit comments

Comments
 (0)