Skip to content

Commit aa7901c

Browse files
sylvioalvesdkalowsk
authored andcommitted
drivers: spi: esp32c6: fix struct type zeroing
Fix regression caused by memset() replacement to zero volatile struct. ESP32-C6 data_buf struct differs from other SoCs and needs custom handling. Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
1 parent 8fd0b70 commit aa7901c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/spi/spi_esp32_spim.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,13 @@ static int IRAM_ATTR spi_esp32_transfer(const struct device *dev)
9999

100100
/* clean up and prepare SPI hal */
101101
for (size_t i = 0; i < ARRAY_SIZE(hal->hw->data_buf); ++i) {
102+
#ifdef CONFIG_SOC_SERIES_ESP32C6
103+
hal->hw->data_buf[i].val = 0;
104+
#else
102105
hal->hw->data_buf[i] = 0;
106+
#endif
103107
}
108+
104109
hal_trans->send_buffer = tx_temp ? tx_temp : (uint8_t *)ctx->tx_buf;
105110
hal_trans->rcv_buffer = rx_temp ? rx_temp : ctx->rx_buf;
106111
hal_trans->tx_bitlen = bit_len;

0 commit comments

Comments
 (0)