Skip to content

Commit

Permalink
Revert "Fix unwanted flush in the SPI slave driver"
Browse files Browse the repository at this point in the history
because if priv->rx_length is zero , need to call SPIS_CTRLR_QPOLL to
receive new data from lower half and update priv->rx_length.

This reverts commit 6cb649e.
  • Loading branch information
Donny9 committed Sep 9, 2024
1 parent 9d5b9b7 commit 7f82cb1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/spi/spi_slave_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ static ssize_t spi_slave_read(FAR struct file *filep, FAR char *buffer,
return -ENOBUFS;
}

priv->rx_length = MIN(buflen, sizeof(priv->rx_buffer));
ret = nxmutex_lock(&priv->lock);
if (ret < 0)
{
Expand Down Expand Up @@ -692,7 +691,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, priv->rx_length);
size_t recv_bytes = MIN(len, sizeof(priv->rx_buffer));

memcpy(priv->rx_buffer, data, recv_bytes);

Expand Down

0 comments on commit 7f82cb1

Please sign in to comment.