mirror of
https://github.com/qmk/qmk_firmware
synced 2024-11-19 03:36:28 +00:00
Fix return value of i2c_readReg and i2c_receive (#5410)
This commit is contained in:
parent
b85e2eef9a
commit
e0a03bfa6c
1 changed files with 2 additions and 2 deletions
|
@ -140,7 +140,7 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16
|
|||
|
||||
i2c_stop();
|
||||
|
||||
return status;
|
||||
return (status < 0) ? status : I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) {
|
||||
|
@ -188,7 +188,7 @@ i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16
|
|||
error:
|
||||
i2c_stop();
|
||||
|
||||
return status;
|
||||
return (status < 0) ? status : I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void i2c_stop(void) {
|
||||
|
|
Loading…
Reference in a new issue