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

driver, w5100: fix sign-compare and add spi as required feature

This commit is contained in:
smlng 2017-11-28 23:09:05 +01:00
parent eb2c0e29ab
commit 4492396923
2 changed files with 4 additions and 3 deletions

View File

@ -262,6 +262,7 @@ ifneq (,$(filter veml6070,$(USEMODULE)))
endif
ifneq (,$(filter w5100,$(USEMODULE)))
FEATURES_REQUIRED += periph_spi
USEMODULE += netdev_eth
USEMODULE += luid
endif

View File

@ -235,7 +235,7 @@ static int recv(netdev_t *netdev, void *buf, size_t len, void *info)
(void)info;
w5100_t *dev = (w5100_t *)netdev;
uint8_t *in_buf = (uint8_t *)buf;
int n = 0;
unsigned n = 0;
/* 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);
@ -255,7 +255,7 @@ static int recv(netdev_t *netdev, void *buf, size_t len, void *info)
if (in_buf != NULL) {
uint16_t pos = rp + 2;
len = (n <= len) ? n : len;
for (int i = 0; i < (int)len; i++) {
for (unsigned i = 0; i < len; i++) {
in_buf[i] = rreg(dev, (S0_RX_BASE + ((pos++) & S0_MASK)));
}
@ -276,7 +276,7 @@ static int recv(netdev_t *netdev, void *buf, size_t len, void *info)
/* release the SPI bus again */
spi_release(dev->p.spi);
return n;
return (int)n;
}
static void isr(netdev_t *netdev)