1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/w5100: make use of spi_transfer_u16_be()

This also fixes a bug, as the free coded byte swap code was incorrect.
This commit is contained in:
Marian Buschsieweke 2024-01-30 11:14:24 +01:00
parent 87abafb13f
commit 47280b3a9b
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6

View File

@ -47,13 +47,7 @@ static const netdev_driver_t netdev_driver_w5100;
static inline void send_addr(w5100_t *dev, uint16_t addr)
{
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
spi_transfer_byte(dev->p.spi, dev->p.cs, true, (addr >> 8));
spi_transfer_byte(dev->p.spi, dev->p.cs, true, (addr & 0xff));
#else
spi_transfer_byte(dev->p.spi, dev->p.cs, true, (addr & 0xff));
spi_transfer_byte(dev->p.spi, dev->p.cs, true, (addr >> 8));
#endif
spi_transfer_u16_be(dev->p.spi, dev->p.cs, true, addr);
}
static uint8_t rreg(w5100_t *dev, uint16_t reg)