Skip to content

Commit

Permalink
Freerb/lv comp gpio (#139)
Browse files Browse the repository at this point in the history
* disables gpio and adds delays to help debug

* updates inverted pin states

* lv debugging - works as expected in this commit

* removes debug delays
  • Loading branch information
BlakeFreer authored Jul 16, 2024
1 parent 95fa36d commit 65695c6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions firmware/projects/LVController/inc/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <cmath>

#include "bindings.h"
#include "can_messages.h"
#include "shared/comms/can/can_bus.h"
#include "shared/os/mutex.h"
#include "shared/periph/gpio.h"
Expand Down
13 changes: 9 additions & 4 deletions firmware/projects/LVController/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -65,7 +68,7 @@ void DoPowerupSequence() {

bindings::DelayMS(50);

raspberry_pi.Enable();
// raspberry_pi.Enable();
state_tx.UpdateState(LvControllerState::RaspiEnabled);

bindings::DelayMS(50);
Expand All @@ -75,7 +78,7 @@ void DoPowerupSequence() {

bindings::DelayMS(100);

speedgoat.Enable();
// speedgoat.Enable();
state_tx.UpdateState(LvControllerState::SpeedgoatEnabled);

bindings::DelayMS(100);
Expand All @@ -95,7 +98,7 @@ void DoPowerupSequence() {

bindings::DelayMS(50);

imu_gps.Enable();
// imu_gps.Enable();
state_tx.UpdateState(LvControllerState::ImuGpsEnabled);
}

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 65695c6

Please sign in to comment.