Skip to content

Commit

Permalink
small chademo can3 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
damienmaguire committed Feb 23, 2023
1 parent ec55cae commit f48649c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/param_prj.h
Expand Up @@ -126,7 +126,7 @@
VALUE_ENTRY(shunt_can, CAN_DEV, 2073 ) \
VALUE_ENTRY(lim_can, CAN_DEV, 2074 ) \
VALUE_ENTRY(charger_can, CAN_DEV, 2075 ) \
VALUE_ENTRY(can3Speed, CAN3Spd, 2080 ) \
VALUE_ENTRY(can3Set, CAN3Spd, 2080 ) \
VALUE_ENTRY(TRANS, TRNMODES, 2081 ) \
VALUE_ENTRY(Charger, CHGMODS, 2027 ) \
VALUE_ENTRY(tmphs, "°C", 2028 ) \
Expand Down
4 changes: 2 additions & 2 deletions src/CANSPI.cpp
Expand Up @@ -141,14 +141,14 @@ void CANSPI_Initialize(void)
MCP2515_Write_ByteSequence(MCP2515_RXF5SIDH, MCP2515_RXF5EID0, &(RXF5reg.RXF5SIDH));

// Initialize CAN Timings
if(Param::GetInt(Param::can3Speed)==1)
if(Param::GetInt(Param::CAN3Speed)==1)
{
MCP2515_Write_Byte(MCP2515_CNF1, 0x40);//500kbps at 16HMz xtal.
MCP2515_Write_Byte(MCP2515_CNF2, 0xe5);
MCP2515_Write_Byte(MCP2515_CNF3, 0x83);
}

if(Param::GetInt(Param::can3Speed)==0)
if(Param::GetInt(Param::CAN3Speed)==0)
{
MCP2515_Write_Byte(MCP2515_CNF1, 0x4E);//33kbps at 16HMz xtal.
MCP2515_Write_Byte(MCP2515_CNF2, 0xe5);
Expand Down
2 changes: 1 addition & 1 deletion src/stm32_vcu.cpp
Expand Up @@ -715,7 +715,7 @@ void Param::Change(Param::PARAM_NUM paramNum)
can->SetBaudrate((Can::baudrates)Param::GetInt(Param::canspeed));
can2->SetBaudrate((Can::baudrates)Param::GetInt(Param::canspeed));
case Param::CAN3Speed:
Param::SetInt(Param::can3Speed,Param::GetInt(Param::CAN3Speed));
Param::SetInt(Param::can3Set,Param::GetInt(Param::CAN3Speed));
CANSPI_Initialize();// init the MCP25625 on CAN3
CANSPI_ENRx_IRQ(); //init CAN3 Rx IRQ
break;
Expand Down

0 comments on commit f48649c

Please sign in to comment.