mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(rmt): correct the condition for warnings in loop mode
This commit is contained in:
committed by
Chen Ji Chang
parent
93603cd3a3
commit
02b6df3653
@@ -652,20 +652,22 @@ size_t rmt_encode_check_result(rmt_tx_channel_t *tx_chan, rmt_tx_trans_desc_t *t
|
||||
rmt_encode_state_t encode_state = RMT_ENCODING_RESET;
|
||||
rmt_encoder_handle_t encoder = t->encoder;
|
||||
size_t encoded_symbols = encoder->encode(encoder, &tx_chan->base, t->payload, t->payload_bytes, &encode_state);
|
||||
bool is_mem_full = encode_state & RMT_ENCODING_MEM_FULL;
|
||||
bool need_eof_mark = (encode_state & RMT_ENCODING_WITH_EOF) == 0;
|
||||
|
||||
if (encode_state & RMT_ENCODING_COMPLETE) {
|
||||
bool need_eof_mark = (encode_state & RMT_ENCODING_WITH_EOF) == 0;
|
||||
// inserting EOF symbol if there's extra space
|
||||
if (!(encode_state & RMT_ENCODING_MEM_FULL)) {
|
||||
if (!is_mem_full) {
|
||||
encoded_symbols += rmt_tx_mark_eof(tx_chan, need_eof_mark);
|
||||
}
|
||||
t->flags.encoding_done = true;
|
||||
t->flags.need_eof_mark = need_eof_mark;
|
||||
}
|
||||
|
||||
// for loop transaction, the memory block should accommodate all encoded RMT symbols
|
||||
// for loop transaction, the memory block should accommodate all encoded RMT symbols and an extra EOF symbol
|
||||
if (t->loop_count != 0) {
|
||||
if (unlikely(encoded_symbols > tx_chan->base.mem_block_num * SOC_RMT_MEM_WORDS_PER_CHANNEL)) {
|
||||
size_t limit_symbols = tx_chan->base.mem_block_num * SOC_RMT_MEM_WORDS_PER_CHANNEL;
|
||||
if (unlikely(encoded_symbols > limit_symbols || (encoded_symbols == limit_symbols && is_mem_full && need_eof_mark))) {
|
||||
ESP_DRAM_LOGE(TAG, "encoding artifacts can't exceed hw memory block for loop transmission");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user