1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

drivers/w5100/w5100.c: fix TX_WR register's value

This commit is contained in:
= 2021-05-15 14:34:55 +08:00
parent 67dfbe8d48
commit 6d51ac8622

View File

@ -201,7 +201,8 @@ static int send(netdev_t *netdev, const iolist_t *iolist)
/* get access to the SPI bus for the duration of this function */
spi_acquire(dev->p.spi, dev->p.cs, SPI_CONF, dev->p.clk);
uint16_t pos = raddr(dev, S0_TX_WR0, S0_TX_WR1);
uint16_t tx_wr = raddr(dev, S0_TX_WR0, S0_TX_WR1);
uint16_t pos = (tx_wr & S0_MASK) + S0_TX_BASE;
/* the register is only set correctly after the first send pkt, so we need
* this fix here */
@ -215,7 +216,7 @@ static int send(netdev_t *netdev, const iolist_t *iolist)
sum += len;
}
waddr(dev, S0_TX_WR0, S0_TX_WR1, pos);
waddr(dev, S0_TX_WR0, S0_TX_WR1, tx_wr + sum);
/* trigger the sending process */
wreg(dev, S0_CR, CR_SEND_MAC);