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

drivers/enc28j60: Allow sending with empty chunks

This commit allows `netdev_driver_t::send()` of `enc28j60` to be passed an
`iolist_t` containing one or more empty elements.
This commit is contained in:
Marian Buschsieweke 2019-03-20 09:57:45 +01:00
parent c99c0f61ab
commit f5cd25bdab
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -217,12 +217,14 @@ static void cmd_rbm(enc28j60_t *dev, uint8_t *data, size_t len)
static void cmd_wbm(enc28j60_t *dev, uint8_t *data, size_t len)
{
/* start transaction */
spi_acquire(SPI_BUS, CS_PIN, SPI_MODE_0, SPI_CLK);
/* transfer data */
spi_transfer_regs(SPI_BUS, CS_PIN, CMD_WBM, data, NULL, len);
/* finish SPI transaction */
spi_release(SPI_BUS);
if (len) {
/* start transaction */
spi_acquire(SPI_BUS, CS_PIN, SPI_MODE_0, SPI_CLK);
/* transfer data */
spi_transfer_regs(SPI_BUS, CS_PIN, CMD_WBM, data, NULL, len);
/* finish SPI transaction */
spi_release(SPI_BUS);
}
}
static void mac_get(enc28j60_t *dev, uint8_t *mac)