Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions transports/libhoth_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ static libhoth_status spi_nor_busy_wait(const int fd, uint32_t timeout_us,
return LIBHOTH_ERR_FAIL;
}
while (true) {
struct spi_ioc_transfer xfer = {0};
struct spi_ioc_transfer xfer[1] = {0};
tx_buf[0] = SPI_NOR_OPCODE_READ_STATUS;
xfer.tx_buf = (uint64_t)tx_buf;
xfer.rx_buf = (uint64_t)rx_buf;
xfer.len = sizeof(rx_buf);
xfer.tx_nbits = SPI_NBITS_SINGLE;
xfer.rx_nbits = SPI_NBITS_SINGLE;
xfer[0] = (struct spi_ioc_transfer){
.tx_buf = (unsigned long)tx_buf,
.rx_buf = (unsigned long)rx_buf,
.len = sizeof(rx_buf),
.tx_nbits = SPI_NBITS_SINGLE,
.rx_nbits = SPI_NBITS_SINGLE,
};
const int status = ioctl(fd, SPI_IOC_MESSAGE(1), xfer);
if (status < 0) {
return LIBHOTH_ERR_FAIL;
Expand Down
Loading