From 279ec3eb35c37e0fc4c7bc61df3dbd82a1cc5373 Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Mon, 23 May 2022 11:38:19 +0700 Subject: [PATCH] i2c: fix 'comparision is always true' warning --- components/hal/esp32/include/hal/i2c_ll.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/hal/esp32/include/hal/i2c_ll.h b/components/hal/esp32/include/hal/i2c_ll.h index be0640b24f..9a99341c59 100644 --- a/components/hal/esp32/include/hal/i2c_ll.h +++ b/components/hal/esp32/include/hal/i2c_ll.h @@ -131,10 +131,9 @@ static inline void i2c_ll_set_bus_timing(i2c_dev_t *hw, i2c_clk_cal_t *bus_cfg) if (hw->scl_filter_cfg.en) { if (hw->scl_filter_cfg.thres <= 2) { scl_high -= 8; - } else if (hw->scl_filter_cfg.thres <= 7) { - scl_high -= hw->scl_filter_cfg.thres + 6; } else { - assert(false); + assert(hw->scl_filter_cfg.thres <= 7); + scl_high -= hw->scl_filter_cfg.thres + 6; } } else { scl_high -= 7;