Skip to content

Commit

Permalink
updates on veh trans
Browse files Browse the repository at this point in the history
  • Loading branch information
damienmaguire committed Nov 26, 2022
1 parent 7087393 commit d90ba30
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
9 changes: 6 additions & 3 deletions include/param_prj.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
2. Temporary parameters (id = 0)
3. Display values
*/
//Next param id (increase when adding new parameter!): 78
//Next param id (increase when adding new parameter!): 79
/* category name unit min max default id */
#define PARAM_LIST \
PARAM_ENTRY(CAT_SETUP, Inverter, INVMODES, 0, 6, 0, 5 ) \
PARAM_ENTRY(CAT_SETUP, Vehicle, VEHMODES, 0, 6, 0, 6 ) \
PARAM_ENTRY(CAT_SETUP, Transmission, TRNMODES, 0, 1, 0, 78 ) \
PARAM_ENTRY(CAT_SETUP, Inverter_CAN, CAN_DEV, 0, 1, 0, 70 ) \
PARAM_ENTRY(CAT_SETUP, Vehicle_CAN, CAN_DEV, 0, 1, 1, 71 ) \
PARAM_ENTRY(CAT_SETUP, Shunt_CAN, CAN_DEV, 0, 1, 0, 72 ) \
PARAM_ENTRY(CAT_SETUP, LIM_CAN, CAN_DEV, 0, 1, 0, 73 ) \
PARAM_ENTRY(CAT_SETUP, Charger_CAN, CAN_DEV, 0, 1, 1, 74 ) \
PARAM_ENTRY(CAT_SETUP, CAN3Speed, CAN3Spd, 0, 1, 0, 77 ) \
PARAM_ENTRY(CAT_THROTTLE, potmin, "dig", 0, 4095, 0, 7 ) \
PARAM_ENTRY(CAT_THROTTLE, potmax, "dig", 0, 4095, 4095, 8 ) \
PARAM_ENTRY(CAT_THROTTLE, pot2min, "dig", 0, 4095, 4095, 9 ) \
Expand Down Expand Up @@ -69,6 +69,7 @@
PARAM_ENTRY(CAT_CONTACT, errlights, ERRLIGHTS, 0, 255, 0, 34 ) \
PARAM_ENTRY(CAT_COMM, canspeed, CANSPEEDS, 0, 3, 1, 35 ) \
PARAM_ENTRY(CAT_COMM, canperiod, CANPERIODS,0, 1, 1, 36 ) \
PARAM_ENTRY(CAT_COMM, CAN3Speed, CAN3Spd, 0, 1, 0, 77 ) \
PARAM_ENTRY(CAT_CHARGER, chargemodes, CHGMODS, 0, 4, 0, 37 ) \
PARAM_ENTRY(CAT_CHARGER, BattCap, "kWh", 0.1, 250, 22, 38 ) \
PARAM_ENTRY(CAT_CHARGER, interface, CHGINT, 0, 3, 0, 39 ) \
Expand Down Expand Up @@ -125,6 +126,7 @@
VALUE_ENTRY(lim_can, CAN_DEV, 2074 ) \
VALUE_ENTRY(charger_can, CAN_DEV, 2075 ) \
VALUE_ENTRY(can3Speed, CAN3Spd, 2080 ) \
VALUE_ENTRY(TRANS, TRNMODES, 2081 ) \
VALUE_ENTRY(Charger, CHGMODS, 2027 ) \
VALUE_ENTRY(tmphs, "°C", 2028 ) \
VALUE_ENTRY(tmpm, "°C", 2029 ) \
Expand Down Expand Up @@ -175,7 +177,7 @@
VALUE_ENTRY(cpuload, "%", 2063 ) \


//Next value Id: 2081
//Next value Id: 2082

#define VERSTR STRINGIFY(4=VER)
#define DMODES "0=CLOSED, 1=OPEN, 2=ERROR, 3=INVALID"
Expand Down Expand Up @@ -206,6 +208,7 @@
#define CHGCTRL "0=Enable, 1=Disable, 2=Timer"
#define CHGINT "0=Unused, 1=i3LIM, 2=Chademo, 3=Leaf_PDM"
#define CAN3Spd "0=k33.3, 1=k500"
#define TRNMODES "0=MAN, 1=AUT"
#define CAN_DEV "0=CAN1, 1=CAN2"
#define CAT_THROTTLE "Throttle"
#define CAT_POWER "Power Limit"
Expand Down
13 changes: 9 additions & 4 deletions src/stm32_vcu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,11 @@ static void Ms10Task(void)
//Messages required for E39
Can_E39::Msg316(speed);//send rpm to e39 dash
Can_E39::Msg329(tempGauge);//send heatsink temp to E39 dash temp gauge
Can_E39::Msg43B();
if(Param::GetInt(Param::TRANS)==1)
{
Can_E39::Msg43B();//only send auto egs msgs if an auto is selected.
Can_E39::Msg43F(Param::GetInt(Param::dir));//set the gear indicator on the dash
}
Can_E39::Msg545();
}
else if (targetVehicle == vehicles::BMW_E46)
Expand All @@ -528,8 +531,10 @@ static void Ms10Task(void)
//Messages required for E46
Can_E46::Msg316(speed);//send rpm to e46 dash
Can_E46::Msg329(tempGauge);//send heatsink temp to E64 dash temp gauge
// Can_E46::Msg43F(Param::GetInt(Param::dir));//set the gear indicator on the dash
//TODO add manual auto option for bmw vehicles.
if(Param::GetInt(Param::TRANS)==1)
{
Can_E46::Msg43F(Param::GetInt(Param::dir));//set the gear indicator on the dash
}
Can_E46::Msg545();
}
else if (targetVehicle == vehicles::BMW_E65)
Expand Down Expand Up @@ -722,7 +727,7 @@ void Param::Change(Param::PARAM_NUM paramNum)
Param::SetInt(Param::shunt_can,Param::GetInt(Param::Shunt_CAN));
Param::SetInt(Param::lim_can,Param::GetInt(Param::LIM_CAN));
Param::SetInt(Param::charger_can,Param::GetInt(Param::Charger_CAN));

Param::SetInt(Param::TRANS,Param::GetInt(Param::Transmission));

Throttle::potmin[0] = Param::GetInt(Param::potmin);
Throttle::potmax[0] = Param::GetInt(Param::potmax);
Expand Down

0 comments on commit d90ba30

Please sign in to comment.