Skip to content

Commit

Permalink
https://github.com/andreika-git/hellen-one/issues/364
Browse files Browse the repository at this point in the history
megamodule: OUT_IO4 vs IO4 similar naming is a bit evil
  • Loading branch information
rusefillc committed Feb 8, 2024
1 parent f3d11ec commit b13fc93
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ static void setupEtb() {
// PWM pin
engineConfiguration->etbIo[0].controlPin = Gpio::H144_OUT_PWM2;
// DIR pin
engineConfiguration->etbIo[0].directionPin1 = H144_GP1;
engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_GP_IO1;
// Disable pin
engineConfiguration->etbIo[0].disablePin = H144_GP2;
engineConfiguration->etbIo[0].disablePin = Gpio::H144_GP_IO2;

// we only have pwm/dir, no dira/dirb
engineConfiguration->etb_use_two_wires = false;
Expand Down Expand Up @@ -102,7 +102,7 @@ void boardInitHardware() {
alphaD3PullDown.initPin("a-d3-legacy", Gpio::H144_LS_6);
} else {
alphaD2PullDown.initPin("a_d2", Gpio::H144_OUT_IO13);
alphaCamPullDown.initPin("a_cam", H144_GP4);
alphaCamPullDown.initPin("a_cam", Gpio::H144_GP_IO4);
alphaD3PullDown.initPin("a_d3", Gpio::H144_OUT_IO8);
}

Expand Down Expand Up @@ -164,7 +164,7 @@ void setBoardDefaultConfiguration() {
} else {
engineConfiguration->vvtPins[0] = Gpio::H144_IGN_7;
engineConfiguration->vvtPins[1] = Gpio::H144_IGN_8;
engineConfiguration->tachOutputPin = Gpio::H144_GP3;
engineConfiguration->tachOutputPin = Gpio::H144_GP_IO3;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gpio GENERATED_OUTPUTS = {
Gpio::H144_OUT_PWM7, // Aux9 - High1 legacy F2
Gpio::H144_OUT_PWM8, // Aux10 - High2 legacy F4
Gpio::H144_OUT_IO13, // A4 - Tachometer legacy up to rev F
Gpio::H144_GP3, // A4 - Tachometer
Gpio::H144_GP_IO3, // A4 - Tachometer
Gpio::H144_IGN_1, // A6 - Ignition 1
Gpio::H144_IGN_2, // A7 - Ignition 2
Gpio::H144_OUT_PWM3, // D2 - Out Boost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ static void setupEtb() {
// PWM pin
engineConfiguration->etbIo[0].controlPin = Gpio::H144_OUT_PWM2;
// DIR pin
engineConfiguration->etbIo[0].directionPin1 = H144_GP1;
engineConfiguration->etbIo[0].directionPin1 = Gpio::H144_GP_IO1;
// Disable pin
engineConfiguration->etbIo[0].disablePin = H144_GP5;
engineConfiguration->etbIo[0].disablePin = Gpio::H144_GP_IO5;

// PWM pin
engineConfiguration->etbIo[1].controlPin = H144_GP4;
engineConfiguration->etbIo[1].controlPin = Gpio::H144_GP_IO4;
// DIR pin
engineConfiguration->etbIo[1].directionPin1 = Gpio::H144_GP3;
engineConfiguration->etbIo[1].directionPin1 = Gpio::H144_GP_IO3;
// Disable pin
engineConfiguration->etbIo[1].disablePin = Gpio::Unassigned;
// we only have pwm/dir, no dira/dirb
Expand Down
10 changes: 5 additions & 5 deletions firmware/config/boards/hellen_meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ void detectHellenBoardType();


// also IO1/IO5 on rev 0.6
#define H144_GP1 Gpio::D4
#define H144_GP_IO1 Gpio::D4
// also IO2/IO5 on rev 0.6
#define H144_GP2 Gpio::D7
#define H144_GP3 G10
#define H144_GP4 Gpio::G9
#define H144_GP5 Gpio::G15
#define H144_GP_IO2 D7
#define H144_GP_IO3 G10
#define H144_GP_IO4 G9
#define H144_GP_IO5 G15
#define H144_GP6 Gpio::D8
#define H144_GP7 Gpio::F15
#define H144_GP8 Gpio::E10
Expand Down
8 changes: 4 additions & 4 deletions firmware/config/engines/gm_sbc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ void setStepperHw() {
#if HW_HELLEN
setPPSInputs(EFI_ADC_NONE, EFI_ADC_NONE);
// using 8chan pinout for DC1: A26 (OUT_DC1+ AH pin "D") and A27 (OUT_DC1- AL pin "C")
engineConfiguration->stepperDcIo[0].controlPin = H144_GP4; // DC1_PWM
engineConfiguration->stepperDcIo[0].directionPin1 = Gpio::H144_GP3; // DC1_DIR
engineConfiguration->stepperDcIo[0].controlPin = Gpio::H144_GP_IO4; // DC1_PWM
engineConfiguration->stepperDcIo[0].directionPin1 = Gpio::H144_GP_IO3; // DC1_DIR
engineConfiguration->stepperDcIo[0].directionPin2 = Gpio::Unassigned;
engineConfiguration->stepperDcIo[0].disablePin = H144_GP5; // ETB_DIS
engineConfiguration->stepperDcIo[0].disablePin = Gpio::H144_GP_IO5; // ETB_DIS
// using 8chan pinout for DC2: A28 (OUT_DC2+ BL pin "A") and A29 (OUT_DC2- BH pin "B")
engineConfiguration->stepperDcIo[1].controlPin = H144_UART1_TX; // DC2_PWM
engineConfiguration->stepperDcIo[1].directionPin1 = H_SPI3_CS; // DC2_DIR
engineConfiguration->stepperDcIo[1].directionPin2 = Gpio::Unassigned;
// open question if we need custom logic to handle shared disable pin? engineConfiguration->stepperDcIo[1].disablePin = H144_GP5; // ETB_DIS
// open question if we need custom logic to handle shared disable pin? engineConfiguration->stepperDcIo[1].disablePin = Gpio::H144_GP_IO5; // ETB_DIS
#endif // HW_HELLEN

#if HW_PROTEUS
Expand Down

0 comments on commit b13fc93

Please sign in to comment.