turn on CDP when ignition switches on
@@ -720,6 +720,7 @@ int main(void) {
#endif
#ifdef EON
+ bool ignition_prev = false;
// have to save power
if (hw_type == HW_TYPE_WHITE_PANDA) {
current_board->set_esp_gps_mode(ESP_GPS_DISABLED);
@@ -747,6 +748,13 @@ int main(void) {
uint64_t cnt = 0;
for (cnt=0;;cnt++) {
+ #ifdef EON
+ // set CDP mode on rising edge of ignition to start charging EON again in case we turned charging off
+ if (current_board->check_ignition() && !ignition_prev) {
+ current_board->set_usb_power_mode(USB_POWER_CDP);
+ }
+ ignition_prev = current_board->check_ignition();
+ #endif
if (power_save_status == POWER_SAVE_STATUS_DISABLED) {
int div_mode = ((usb_power_mode == USB_POWER_DCP) ? 4 : 1);
