gimble: configure the PPVAR_SYS depend on AC or AC+battery
set to 9.2 V if battery is present.
set to 13.2 V if battery is not present.
BRANCH=none
TEST=make -j BOARD=gimble
#include "common.h"
#include "compile_time_macros.h"
#include "console.h"
+#include "driver/charger/bq25710.h"
#include "gpio.h"
#include "gpio_signal.h"
#include "hooks.h"
@@ -114,6 +115,17 @@ enum battery_present battery_hw_present(void)
return gpio_get_level(batt_pres) ? BP_NO : BP_YES;
}
+static void board_init(void)
+{
+ /* The PPVAR_SYS must same as battery voltage(3 cells * 4.4V) */
+ if (extpower_is_present() && battery_hw_present()) {
+ bq25710_set_min_system_voltage(CHARGER_SOLO, 9200);
+ } else {
+ bq25710_set_min_system_voltage(CHARGER_SOLO, 13200);
+ }
+}
+DECLARE_HOOK(HOOK_SECOND, board_init, HOOK_PRIO_DEFAULT);
+
__override void board_set_charge_limit(int port, int supplier, int charge_ma,
int max_ma, int charge_mv)
{
