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:
parent
8d8bd82437
commit
e407460243
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user