diff options
Diffstat (limited to 'keyboards/cannonkeys/satisfaction75/i2c_master.c')
-rw-r--r-- | keyboards/cannonkeys/satisfaction75/i2c_master.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/keyboards/cannonkeys/satisfaction75/i2c_master.c b/keyboards/cannonkeys/satisfaction75/i2c_master.c index ce0e0a7ba..56e810d32 100644 --- a/keyboards/cannonkeys/satisfaction75/i2c_master.c +++ b/keyboards/cannonkeys/satisfaction75/i2c_master.c @@ -42,8 +42,8 @@ static const I2CConfig i2cconfig = { 0 }; -static i2c_status_t chibios_to_qmk(const msg_t* status) { - switch (*status) { +static i2c_status_t chibios_to_qmk(const msg_t status) { + switch (status) { case I2C_NO_ERROR: return I2C_STATUS_SUCCESS; case I2C_TIMEOUT: @@ -83,7 +83,7 @@ i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, i2cAcquireBus(&I2C_DRIVER); msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); i2cReleaseBus(&I2C_DRIVER); - return chibios_to_qmk(&status); + return chibios_to_qmk(status); } i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) @@ -91,7 +91,7 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16 i2c_address = address; i2cStart(&I2C_DRIVER, &i2cconfig); msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); - return chibios_to_qmk(&status); + return chibios_to_qmk(status); } i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) @@ -107,7 +107,7 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, complete_packet[0] = regaddr; msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); - return chibios_to_qmk(&status); + return chibios_to_qmk(status); } i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout) @@ -115,7 +115,7 @@ i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint1 i2c_address = devaddr; i2cStart(&I2C_DRIVER, &i2cconfig); msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout)); - return chibios_to_qmk(&status); + return chibios_to_qmk(status); } void i2c_stop(void) |