From 3e309b4e0dc99db36655a396765ac32fae1fc97f Mon Sep 17 00:00:00 2001 From: Richard Li Date: Mon, 15 Jul 2024 15:39:47 +0800 Subject: [PATCH] Update battery divider for NB4+ --- radio/src/targets/pl18/board.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/radio/src/targets/pl18/board.h b/radio/src/targets/pl18/board.h index 5280c3151..3723ffbe2 100644 --- a/radio/src/targets/pl18/board.h +++ b/radio/src/targets/pl18/board.h @@ -94,7 +94,12 @@ extern "C" void SDRAM_Init(); #define BATTERY_WARN 37 // 3.7V #define BATTERY_MIN 35 // 3.4V #define BATTERY_MAX 43 // 4.3V -#define BATTERY_DIVIDER 962 + +#if defined(RADIO_NB4P) + #define BATTERY_DIVIDER 3102 // = 2047 * (10k / 10k + 10k) * 10 / 3.3V +#else + #define BATTERY_DIVIDER 962 // = 2047 * (22k / 120k + 22k) * 10 / 3.3V +#endif #if defined(__cplusplus) && !defined(SIMU) extern "C" {