Skip to content

Commit a252f54

Browse files
authored
Ensure PIN_ENABLE_CHARGE is high when undocked to allow regen (#113)
1 parent 7b26a74 commit a252f54

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Firmware/LowLevel/src/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,12 @@ bool checkShouldCharge() {
690690
}
691691

692692
void updateChargingEnabled() {
693+
// Always enable for regen when not docked
694+
if (status_message.v_charge < 3.0f) {
695+
digitalWrite(PIN_ENABLE_CHARGE, HIGH);
696+
charging_allowed = false; // For high level status
697+
return;
698+
}
693699
if (charging_allowed) {
694700
if (!checkShouldCharge()) {
695701
digitalWrite(PIN_ENABLE_CHARGE, LOW);

0 commit comments

Comments
 (0)