diff --git a/bdk/power/regulator_5v.c b/bdk/power/regulator_5v.c index 31d32f6..64fd7d7 100644 --- a/bdk/power/regulator_5v.c +++ b/bdk/power/regulator_5v.c @@ -81,7 +81,13 @@ bool regulator_5v_get_dev_enabled(u8 dev) void regulator_5v_batt_src_enable(bool enable) { if (enable && !batt_src) + { gpio_write(GPIO_PORT_A, GPIO_PIN_5, GPIO_HIGH); + batt_src = true; + } else if (!enable && batt_src) + { gpio_write(GPIO_PORT_A, GPIO_PIN_5, GPIO_LOW); + batt_src = false; + } }