From 063dd4e1fd7d1438b83726319dfd70a01c71ecb6 Mon Sep 17 00:00:00 2001 From: fruchti Date: Thu, 14 Nov 2019 17:46:04 +0100 Subject: [PATCH] Adjust pulse timing for 7.4 V battery --- src/ltp1245.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ltp1245.c b/src/ltp1245.c index c3692bf..9d373f5 100644 --- a/src/ltp1245.c +++ b/src/ltp1245.c @@ -493,7 +493,7 @@ void ADC1_2_IRQHandler(void) // Use the formula from section 3.6, adjusted for integer arithmetic and // a pulse with in microseconds PulseWidth = (285 * 178 - (int)(1000 * 178 * 0.003135) * (temp - 25)) - / (int)((5 * 1.4 - 2.9) * (5 * 1.4 - 2.9)); + / (int)((7.4 * 1.2 - 1.8) * (7.4 * 1.2 - 1.8)); average_counter = 0; average = 0;