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:
parent
87abafb13f
commit
47280b3a9b
@ -47,13 +47,7 @@ static const netdev_driver_t netdev_driver_w5100;
|
|||||||
|
|
||||||
static inline void send_addr(w5100_t *dev, uint16_t addr)
|
static inline void send_addr(w5100_t *dev, uint16_t addr)
|
||||||
{
|
{
|
||||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
spi_transfer_u16_be(dev->p.spi, dev->p.cs, true, addr);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t rreg(w5100_t *dev, uint16_t reg)
|
static uint8_t rreg(w5100_t *dev, uint16_t reg)
|
||||||
|
Loading…
Reference in New Issue
Block a user