diff options
author | Andrew Kannan <andrew.kannan@gmail.com> | 2019-04-27 23:35:31 -0400 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-04-27 20:35:31 -0700 |
commit | b23c3b0fd61c311b429fb1b3391248bf9df2e25d (patch) | |
tree | 270025b6cd716797d2aea173c104008a62f9e27d /keyboards/cannonkeys/satisfaction75/i2c_master.c | |
parent | 53c51f1d16b40fdd3e68a6afc5844917d3d58640 (diff) | |
download | qmk_firmware-b23c3b0fd61c311b429fb1b3391248bf9df2e25d.tar.gz |
[Keyboard] Satisfaction75 i2c fix and VIA layout (#5726)
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) |