Skip to content

Commit

Permalink
HT32: SPI: fix data transmission
Browse files Browse the repository at this point in the history
Data transmission should occur when SPI shift register and TX buffer
are empty. This is done by checking TXE flag instead of TXBE flag.
Not sure why, but this fixes transmission issues on HT32F1654.
  • Loading branch information
hansemro committed Dec 22, 2022
1 parent b3fc9f7 commit 149fd60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion os/hal/ports/HT32/LLD/SPIv1/hal_spi_lld.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void spi_lld_tx(SPIDriver * const spip) {

while (spip->txcnt) {
sr = spip->SPI->SR;
if ((sr & SPI_SR_TXBE) == 0)
if ((sr & SPI_SR_TXE) == 0)
return;
if (spip->txptr) {
fd = *spip->txptr++;
Expand Down

0 comments on commit 149fd60

Please sign in to comment.