From 7849f31d8e580833fd0863d6dcb38eedd27cda83 Mon Sep 17 00:00:00 2001 From: "H. Utku Maden" Date: Sat, 21 Aug 2021 23:49:58 +0300 Subject: [PATCH] Fix small order of operations issue. --- source/driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/driver.c b/source/driver.c index c220ff5..c5d1679 100644 --- a/source/driver.c +++ b/source/driver.c @@ -113,8 +113,8 @@ DS3231_API int ds3231_setInterrupt(ds3231_t driver, int alarm1, int alarm2) uint8_t control = DS3231_CONTROL_INTCN | - alarm1 ? DS3231_CONTROL_A1IE : 0 | - alarm2 ? DS3231_CONTROL_A2IE : 0; + (alarm1 ? DS3231_CONTROL_A1IE : 0) | + (alarm2 ? DS3231_CONTROL_A2IE : 0); if (ds3231_io_write(driver->port, DS3231_REGISTER_CONTROL, &control, sizeof control)) {