From 65695c6ec9712ffdb7f8c2ff521a7155cd723db4 Mon Sep 17 00:00:00 2001 From: Blake Freer <59676067+BlakeFreer@users.noreply.github.com> Date: Tue, 16 Jul 2024 00:32:33 -0400 Subject: [PATCH] Freerb/lv comp gpio (#139) * disables gpio and adds delays to help debug * updates inverted pin states * lv debugging - works as expected in this commit * removes debug delays --- firmware/projects/LVController/inc/app.h | 2 ++ firmware/projects/LVController/main.cc | 13 +++++++++---- .../platforms/stm32f767/cubemx/board_config.ioc | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/firmware/projects/LVController/inc/app.h b/firmware/projects/LVController/inc/app.h index 8851b46cd..51f466137 100644 --- a/firmware/projects/LVController/inc/app.h +++ b/firmware/projects/LVController/inc/app.h @@ -3,6 +3,8 @@ #include +#include "bindings.h" +#include "can_messages.h" #include "shared/comms/can/can_bus.h" #include "shared/os/mutex.h" #include "shared/periph/gpio.h" diff --git a/firmware/projects/LVController/main.cc b/firmware/projects/LVController/main.cc index 3431ca56d..24652fbc6 100644 --- a/firmware/projects/LVController/main.cc +++ b/firmware/projects/LVController/main.cc @@ -35,8 +35,11 @@ Subsystem imu_gps{bindings::imu_gps_en}; Subsystem shutdown_circuit{bindings::shutdown_circuit_en}; Subsystem inverter{bindings::inverter_switch_en}; +auto dcdc_en_inverted = + shared::periph::InvertedDigitalOutput(bindings::dcdc_en); + DCDC dcdc{ - bindings::dcdc_en, + dcdc_en_inverted, bindings::dcdc_valid, bindings::dcdc_led_en, }; @@ -65,7 +68,7 @@ void DoPowerupSequence() { bindings::DelayMS(50); - raspberry_pi.Enable(); + // raspberry_pi.Enable(); state_tx.UpdateState(LvControllerState::RaspiEnabled); bindings::DelayMS(50); @@ -75,7 +78,7 @@ void DoPowerupSequence() { bindings::DelayMS(100); - speedgoat.Enable(); + // speedgoat.Enable(); state_tx.UpdateState(LvControllerState::SpeedgoatEnabled); bindings::DelayMS(100); @@ -95,7 +98,7 @@ void DoPowerupSequence() { bindings::DelayMS(50); - imu_gps.Enable(); + // imu_gps.Enable(); state_tx.UpdateState(LvControllerState::ImuGpsEnabled); } @@ -187,6 +190,8 @@ int main(void) { // Powerup sequence DoPowerupSequence(); + while (true) continue; // stop after fc enable debug + do { state_tx.UpdateState(LvControllerState::WaitingForOpenContactors); bindings::DelayMS(50); diff --git a/firmware/projects/LVController/platforms/stm32f767/cubemx/board_config.ioc b/firmware/projects/LVController/platforms/stm32f767/cubemx/board_config.ioc index 790563095..6a2da2f13 100644 --- a/firmware/projects/LVController/platforms/stm32f767/cubemx/board_config.ioc +++ b/firmware/projects/LVController/platforms/stm32f767/cubemx/board_config.ioc @@ -227,7 +227,7 @@ PG6.Signal=GPIO_Output PG7.GPIOParameters=PinState,GPIO_Label PG7.GPIO_Label=MOTOR_CONTROLLER_PRECHARGE_EN PG7.Locked=true -PG7.PinState=GPIO_PIN_SET +PG7.PinState=GPIO_PIN_RESET PG7.Signal=GPIO_Output PG8.GPIOParameters=PinState,GPIO_Label PG8.GPIO_Label=DCDC_EN