From 66e77df74e75d603a2baa8687ab504e6bce59fb3 Mon Sep 17 00:00:00 2001 From: Selective031 Date: Mon, 5 Jul 2021 18:34:27 +0200 Subject: [PATCH] change charger delays --- RazorBoard/Core/Src/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/RazorBoard/Core/Src/main.c b/RazorBoard/Core/Src/main.c index 6594acb..942234e 100644 --- a/RazorBoard/Core/Src/main.c +++ b/RazorBoard/Core/Src/main.c @@ -911,7 +911,8 @@ void unDock(void) { } void ChargerConnected(void) { - // Is the charger connected? + + // Is the charger connected? if (ChargerConnect == 0) { // We are not charging, reset charger start timer Charger_start_Timer = HAL_GetTick(); @@ -935,19 +936,19 @@ void ChargerConnected(void) { } if (HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_8) == GPIO_PIN_SET) { // Read Volt sense pin - HAL_Delay(settings.HoldChargeDetection); // Wait for a while so a proper connection is made + HAL_Delay(settings.HoldChargeDetection); // Wait for a while so a proper connection is made Force_Active = 0; MotorBrake(); cutterHardBreak(); add_error_event("Charger connect"); Serial_Console("Charger Connected\r\n"); - HAL_Delay(10000); - HAL_GPIO_WritePin(GPIOD, GPIO_PIN_0, GPIO_PIN_SET); // Main Power switch + HAL_Delay(2000); + HAL_GPIO_WritePin(GPIOD, GPIO_PIN_0, GPIO_PIN_SET); // Main Power switch Serial_Console("Changing Main Power\r\n"); ChargerConnect = 1; Docked = 1; - HAL_Delay(5000); - HAL_GPIO_WritePin(GPIOC, GPIO_PIN_10, GPIO_PIN_SET); // Charger Switch + HAL_Delay(2000); + HAL_GPIO_WritePin(GPIOC, GPIO_PIN_10, GPIO_PIN_SET); // Charger Switch add_error_event("Charging active"); Serial_Console("Charging activated\r\n");