Fix unwanted flush in the SPI slave driver
This commit is contained in:
parent
1f54c024da
commit
6cb649ecf6
@ -299,6 +299,7 @@ static ssize_t spi_slave_read(FAR struct file *filep, FAR char *buffer,
|
||||
return -ENOBUFS;
|
||||
}
|
||||
|
||||
priv->rx_length = MIN(buflen, sizeof(priv->rx_buffer));
|
||||
remaining_words = SPIS_CTRLR_QPOLL(priv->ctrlr);
|
||||
if (remaining_words == 0)
|
||||
{
|
||||
@ -542,7 +543,7 @@ static size_t spi_slave_receive(FAR struct spi_slave_dev_s *dev,
|
||||
FAR const void *data, size_t len)
|
||||
{
|
||||
FAR struct spi_slave_driver_s *priv = (FAR struct spi_slave_driver_s *)dev;
|
||||
size_t recv_bytes = MIN(len, sizeof(priv->rx_buffer));
|
||||
size_t recv_bytes = MIN(len, priv->rx_length);
|
||||
|
||||
memcpy(priv->rx_buffer, data, recv_bytes);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user