summaryrefslogtreecommitdiff
path: root/platforms/chibios/drivers
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2022-07-28 03:02:10 +0200
committerGitHub <noreply@github.com>2022-07-28 02:02:10 +0100
commit157ea964117de382b52229db87a55340830839c9 (patch)
treeed28381c4a55985f13ffd72fbd0622d9e225d185 /platforms/chibios/drivers
parent476d709fa5182e2e01628cb26a379a371930ac47 (diff)
ChibiOS: use correct status codes in i2c_master.c (#17808)
msg_t is MSG_OK in the success case and either MSG_RESET or MSG_TIMEOUT in case of errors. So actually use them in the comparison.
Diffstat (limited to 'platforms/chibios/drivers')
-rw-r--r--platforms/chibios/drivers/i2c_master.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/platforms/chibios/drivers/i2c_master.c b/platforms/chibios/drivers/i2c_master.c
index bf8f1ee236..4c7a5daa17 100644
--- a/platforms/chibios/drivers/i2c_master.c
+++ b/platforms/chibios/drivers/i2c_master.c
@@ -116,7 +116,7 @@ static const I2CConfig i2cconfig = {
* @return i2c_status_t QMK specific I2C status code
*/
static i2c_status_t i2c_epilogue(const msg_t status) {
- if (status == I2C_NO_ERROR) {
+ if (status == MSG_OK) {
return I2C_STATUS_SUCCESS;
}
@@ -125,7 +125,7 @@ static i2c_status_t i2c_epilogue(const msg_t status) {
// hard stop in case of any error.
i2c_stop();
- return status == I2C_TIMEOUT ? I2C_STATUS_TIMEOUT : I2C_STATUS_ERROR;
+ return status == MSG_TIMEOUT ? I2C_STATUS_TIMEOUT : I2C_STATUS_ERROR;
}
__attribute__((weak)) void i2c_init(void) {