From c6ff3c49234002e5fda11377f9fd4a738cb22eb5 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Sat, 8 Aug 2020 16:53:48 +0200 Subject: [PATCH] fw: Add proper battery level thresholds --- firmware/batmon.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/firmware/batmon.h b/firmware/batmon.h index 7acc2b5..99fdb97 100644 --- a/firmware/batmon.h +++ b/firmware/batmon.h @@ -6,8 +6,9 @@ #define PORT_ADCC(t) t##D #define PIN_ADCC (1 << 1) -#define BAT_THRES_POWER_ON 60 // TODO: Minimum ADC value to allow turning the device on -#define BAT_THRES_POWER_OFF 50 // TODO: ADC value to (hard) power off the device. +// Nominal 3.7V: 195; Full 4.2V: 220 +#define BAT_THRES_POWER_ON 175 // TODO: Minimum ADC value to allow turning the device on (3.3V) +#define BAT_THRES_POWER_OFF 165 // TODO: ADC value to (hard) power off the device. (3.1V) void batmon_init(); uint8_t batmon_get_voltage();