Skip to content

Commit

Permalink
drivers: spi: sifive: Fix bug with checking if tx fifo is full
Browse files Browse the repository at this point in the history
The check of the SF_TXDATA_FULL flag is only done on the register
address and not on the actual register content.

Signed-off-by: Tobias Svehagen <[email protected]>
  • Loading branch information
tsvehagen authored and carlescufi committed Apr 23, 2020
1 parent 1a4cd71 commit 688f506
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi_sifive.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int spi_config(struct device *dev, u32_t frequency, u16_t operation)

void spi_sifive_send(struct device *dev, u16_t frame)
{
while (SPI_REG(dev, REG_TXDATA) & SF_TXDATA_FULL) {
while (sys_read32(SPI_REG(dev, REG_TXDATA)) & SF_TXDATA_FULL) {
}

sys_write32((u32_t) frame, SPI_REG(dev, REG_TXDATA));
Expand Down

0 comments on commit 688f506

Please sign in to comment.