spi: Fix SPI Slave TX/RX bitlen configuring wrong registers

The maximum input length for the SPI Slave should be applied to the read
buffer configuration, not for the write buffer. Similarly, the output
configuration should also target the write buffer.
This commit is contained in:
Gustavo Henrique Nihei 2021-05-24 10:34:41 -03:00 committed by bot
parent 74f010ddfd
commit 6fb126657a

View File

@ -746,7 +746,7 @@ static inline void spi_ll_set_mosi_bitlen(spi_dev_t *hw, size_t bitlen)
*/
static inline void spi_ll_slave_set_rx_bitlen(spi_dev_t *hw, size_t bitlen)
{
hw->slv_wrbuf_dlen.bit_len = bitlen - 1;
hw->slv_rdbuf_dlen.bit_len = bitlen - 1;
}
/**
@ -757,7 +757,7 @@ static inline void spi_ll_slave_set_rx_bitlen(spi_dev_t *hw, size_t bitlen)
*/
static inline void spi_ll_slave_set_tx_bitlen(spi_dev_t *hw, size_t bitlen)
{
hw->slv_rdbuf_dlen.bit_len = bitlen - 1;
hw->slv_wrbuf_dlen.bit_len = bitlen - 1;
}
/**