Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Make sure all variables are initialized
  • Loading branch information
me-no-dev authored Dec 22, 2021
commit 87b281b7443c6990155d114e80a7d223c38925b5
7 changes: 3 additions & 4 deletions cores/esp32/esp32-hal-rmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,9 @@ float rmtSetTick(rmt_obj_t* rmt, float tick)
rmt_obj_t* rmtInit(int pin, bool tx_not_rx, rmt_reserve_memsize_t memsize)
{
int buffers = memsize;
rmt_obj_t* rmt;
size_t i;
size_t j;
rmt_obj_t* rmt = NULL;
size_t i = 0;
size_t j = 0;

// create common block mutex for protecting allocs from multiple threads
if (!g_rmt_block_lock) {
Expand All @@ -536,7 +536,6 @@ rmt_obj_t* rmtInit(int pin, bool tx_not_rx, rmt_reserve_memsize_t memsize)
ch_end = RMT_RX_CH_END;
}
for (i=ch_start; i<=ch_end; i++) {
j = 0; // fixes compiling option -Werror=maybe-uninitialized
for (j=0; j<buffers && i+j <= ch_end; j++) {
// if the space is ocupied break and continue on other channel
if (g_rmt_objects[i+j].allocated) {
Expand Down