From bf39df99f2c32cdb9fd923c2542e1c4ed08ddefe Mon Sep 17 00:00:00 2001 From: Andrew55529 Date: Thu, 26 Sep 2024 04:24:13 +0300 Subject: [PATCH] lib: st25r3911b: Correction of errors in voltage calculation In official documentation on st 25r3911 when we measure voltage, one LSB represents 23.438 mV. When calculating, we multiply the fractional part by a three-digit number. When restoring, we divide it by 100, not by 1000. This is an error. Signed-off-by: Andrew55529 --- lib/st25r3911b/st25r3911b_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/st25r3911b/st25r3911b_common.c b/lib/st25r3911b/st25r3911b_common.c index 5fe099e1c853..4dce97059fcf 100644 --- a/lib/st25r3911b/st25r3911b_common.c +++ b/lib/st25r3911b/st25r3911b_common.c @@ -31,7 +31,7 @@ LOG_MODULE_DECLARE(st25r3911b); #define POWER_SUPP_5V_STEP 120 #define POWER_SUPP_MEAS_INTEGER 23 #define POWER_SUPP_MEAS_FRACTION 438 -#define POWER_SUPP_MEAS_FRACTION_DIVISOR 100 +#define POWER_SUPP_MEAS_FRACTION_DIVISOR 1000 #define REGULATOR_INIT_REG_VALUE 5 #define FIELD_THRESHOLD_TRG_DEFAULT 0x30