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

cpu/nrf51: fix periph_i2c driver

The `i2c_read_bytes()` and `i2c_write_bytes()` function return the
number of bytes written / read, instead of `0` as the API contract
says. This fixes the issue.
This commit is contained in:
Marian Buschsieweke 2023-11-24 10:03:07 +01:00
parent 8d8bd82437
commit e407460243
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6

View File

@ -103,7 +103,7 @@ static int write(i2c_t dev, uint16_t addr, const void *data, int len,
}
}
return len;
return 0;
}
void i2c_init(i2c_t dev)
@ -198,7 +198,7 @@ int i2c_read_bytes(i2c_t dev, uint16_t address, void *data, size_t length,
while (i2c(dev)->EVENTS_STOPPED == 0) {}
NRF_PPI->CHENCLR = (1 << i2c_config[dev].ppi);
return length;
return 0;
}
int i2c_read_regs(i2c_t dev, uint16_t address, uint16_t reg,