From ac16144dac35a46f483d2136a969ac03bdb51899 Mon Sep 17 00:00:00 2001 From: jsphuebner Date: Tue, 16 Nov 2021 14:53:33 +0100 Subject: [PATCH] Removed unused hardware variants --- include/hwdefs.h | 2 +- include/param_prj.h | 4 ++-- src/hwinit.cpp | 2 -- src/pwmgeneration.cpp | 2 +- src/stm32_sine.cpp | 4 ---- src/vehiclecontrol.cpp | 3 +-- 6 files changed, 5 insertions(+), 12 deletions(-) diff --git a/include/hwdefs.h b/include/hwdefs.h index 95f4917..aa3f9fc 100644 --- a/include/hwdefs.h +++ b/include/hwdefs.h @@ -43,7 +43,7 @@ typedef enum { - HW_REV1, HW_REV2, HW_REV3, HW_TESLA, HW_TESLAM3, HW_BLUEPILL, HW_PRIUS, HW_PRIUSMG1 + HW_REV1, HW_REV2, HW_REV3, HW_TESLA, HW_BLUEPILL, HW_PRIUS } HWREV; extern HWREV hwRev; diff --git a/include/param_prj.h b/include/param_prj.h index eea14d0..5bea790 100644 --- a/include/param_prj.h +++ b/include/param_prj.h @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -#define VER 5.13.R +#define VER 5.14.R /* Entries must be ordered as follows: 1. Saveable parameters (id != 0) @@ -257,7 +257,7 @@ #define CANSPEEDS "0=250k, 1=500k, 2=800k, 3=1M" #define CANIOS "1=Cruise, 2=Start, 4=Brake, 8=Fwd, 16=Rev, 32=Bms" #define CANPERIODS "0=100ms, 1=10ms" -#define HWREVS "0=Rev1, 1=Rev2, 2=Rev3, 3=Tesla, 4=TeslaM3, 5=BluePill, 6=Prius, 7=PriusMG1" +#define HWREVS "0=Rev1, 1=Rev2, 2=Rev3, 3=Tesla, 4=BluePill, 5=Prius" #define SWAPS "0=None, 1=Currents12, 2=SinCos, 4=PWMOutput13, 8=PWMOutput23" #define STATUS "0=None, 1=UdcLow, 2=UdcHigh, 4=UdcBelowUdcSw, 8=UdcLim, 16=EmcyStop, 32=MProt, 64=PotPressed, 128=TmpHs, 256=WaitStart" #define CAT_MOTOR "Motor" diff --git a/src/hwinit.cpp b/src/hwinit.cpp index 9c2e6e2..b5dbcf9 100644 --- a/src/hwinit.cpp +++ b/src/hwinit.cpp @@ -147,8 +147,6 @@ HWREV io_setup() break; case HW_REV2: case HW_REV3: - case HW_PRIUSMG1: - case HW_TESLAM3: break; case HW_PRIUS: DigIo::emcystop_in.Configure(GPIOC, GPIO7, PinMode::INPUT_PU); diff --git a/src/pwmgeneration.cpp b/src/pwmgeneration.cpp index cb37879..124a40c 100644 --- a/src/pwmgeneration.cpp +++ b/src/pwmgeneration.cpp @@ -392,7 +392,7 @@ uint16_t PwmGeneration::TimerSetup(uint16_t deadtime, bool activeLow) timer_disable_break_automatic_output(PWM_TIMER); - if (hwRev == HW_BLUEPILL || hwRev == HW_PRIUS || hwRev == HW_TESLAM3) + if (hwRev == HW_BLUEPILL || hwRev == HW_PRIUS) timer_set_break_polarity_low(PWM_TIMER); else timer_set_break_polarity_high(PWM_TIMER); diff --git a/src/stm32_sine.cpp b/src/stm32_sine.cpp index 874b4ac..5bbf05d 100644 --- a/src/stm32_sine.cpp +++ b/src/stm32_sine.cpp @@ -212,15 +212,11 @@ static void Ms10Task(void) PwmGeneration::SetOpmode(opmode); DigIo::err_out.Clear(); DigIo::prec_out.Clear(); - if (hwRev == HW_TESLAM3) - DigIo::vtg_out.Clear(); initWait = -1; } else if (initWait == 10) { PwmGeneration::SetCurrentOffset(AnaIn::il1.Get(), AnaIn::il2.Get()); - if (hwRev == HW_TESLAM3) - DigIo::vtg_out.Set(); initWait--; } else if (initWait > 0) diff --git a/src/vehiclecontrol.cpp b/src/vehiclecontrol.cpp index 5bd6bfc..068888c 100644 --- a/src/vehiclecontrol.cpp +++ b/src/vehiclecontrol.cpp @@ -317,9 +317,8 @@ float VehicleControl::ProcessUdc() udcFiltered = IIRFILTER(udcFiltered, udcRaw, 2); udcfp = (udcFiltered - udcofs) / udcgain; - //On M3 pin is used for gate drive enable //On i3 pin is used as SPI_MOSI - if (hwRev != HW_TESLAM3 && snshs != TempMeas::TEMP_BMWI3HS) + if (snshs != TempMeas::TEMP_BMWI3HS) { if (udcfp < udcmin || udcfp > udcmax) DigIo::vtg_out.Set();