From 8ece18d43c2e04fd76542f872888a4be262221e7 Mon Sep 17 00:00:00 2001 From: Chris Kline Date: Sun, 7 Jul 2024 18:40:17 -0500 Subject: [PATCH] ds3502 set function check for max value has wrong comparison should be less than max value, not greater than. In its current state it rejects all valid messages. --- components/ds3502/ds3502.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/ds3502/ds3502.c b/components/ds3502/ds3502.c index 2475654a..1bb64764 100644 --- a/components/ds3502/ds3502.c +++ b/components/ds3502/ds3502.c @@ -96,7 +96,7 @@ esp_err_t ds3502_get(i2c_dev_t *dev, uint8_t *pos) esp_err_t ds3502_set(i2c_dev_t *dev, uint8_t pos, bool save) { - CHECK_ARG(dev && pos >= DS3502_MAX); + CHECK_ARG(dev && pos <= DS3502_MAX); I2C_DEV_TAKE_MUTEX(dev); if (save)