Commit 296942f1 authored by 何锐's avatar 何锐

🐞 fix:修改指示灯问题

parent 34473e0e
...@@ -117,23 +117,19 @@ void Can_Set_Buff_042(uint8_t CopyData []) ...@@ -117,23 +117,19 @@ void Can_Set_Buff_042(uint8_t CopyData [])
pCANMsg->Msg [ i ] = 0u; pCANMsg->Msg [ i ] = 0u;
} }
} }
if(Tcs == 1)/**/ if(Tcs == 1)/*TCS指示灯开启*/
{ {
pCANMsg->Sig.TCS = 1; pCANMsg->Sig.TCS = 0;
pCANMsg->Sig.Tcs_mode = 0; pCANMsg->Sig.Tcs_mode = 1;
pCANMsg->Sig.Tcs_Control = 0;
} }
else if(Tcs == 2)/**/ else if(Tcs == 2)/*禁止TCS指示灯开启*/
{ {
pCANMsg->Sig.TCS = 0;//
pCANMsg->Sig.Tcs_mode = 0; pCANMsg->Sig.Tcs_mode = 0;
pCANMsg->Sig.Tcs_Control = 0;
} }
else else/*熄灭*/
{ {
pCANMsg->Sig.TCS = 0; pCANMsg->Sig.TCS = 1;
pCANMsg->Sig.Tcs_mode = 0; pCANMsg->Sig.Tcs_mode = 1;
pCANMsg->Sig.Tcs_Control = 0;
} }
pCANMsg->Msg[7] = 0xff; pCANMsg->Msg[7] = 0xff;
} }
...@@ -202,10 +198,10 @@ void Can_Set_Buff_280(uint8_t CopyData []) ...@@ -202,10 +198,10 @@ void Can_Set_Buff_280(uint8_t CopyData [])
; ;
} }
if(Tcs == 1) // if(Tcs == 1)
{ // {
pCANMsg->Sig.Tcs_Status = 1; // pCANMsg->Sig.Tcs_Status = 1;
} // }
if(Side_bracket == 1) if(Side_bracket == 1)
{ {
pCANMsg->Sig.Side_bracket280 = 1; pCANMsg->Sig.Side_bracket280 = 1;
...@@ -302,11 +298,14 @@ void Can_Set_Buff_001(uint8_t CopyData []) ...@@ -302,11 +298,14 @@ void Can_Set_Buff_001(uint8_t CopyData [])
{ {
pCANMsg->Sig.Motor_hert = 1; pCANMsg->Sig.Motor_hert = 1;
} }
if( Energy_recovery== 2)/*能量回收*/ if(( Energy_recovery== 2) || ( Energy_recovery== 1) || ( Energy_recovery== 3))/*能量回收*/
{ {
pCANMsg->Sig.Msg_0x001_2b3t = 1; pCANMsg->Sig.Msg_0x001_2b3t = 1;
} }
if(motor_hot == 1)
{
pCANMsg->Sig.Msg_0x001_2b4t = 1;
}
} }
void Can_Set_Buff_021(uint8_t CopyData []) void Can_Set_Buff_021(uint8_t CopyData [])
...@@ -663,18 +662,19 @@ void Can_Set_Buff_207(uint8_t CopyData []) ...@@ -663,18 +662,19 @@ void Can_Set_Buff_207(uint8_t CopyData [])
pCANMsg->Msg [ i ] = 0u; pCANMsg->Msg [ i ] = 0u;
} }
} }
if(Tcs == 1) if(Tcs == 1) //TCS
{ {
pCANMsg->Sig.Tcs_mode = 1; pCANMsg->Sig.Tcs_mode = 1;
pCANMsg->Sig.Tcs_Control = 1; pCANMsg->Sig.Tcs_Control = 0;
} }
else if(Tcs == 2) else if(Tcs == 2) //禁止TCS
{ {
pCANMsg->Sig.Tcs_Control = 1; pCANMsg->Sig.Tcs_mode = 0;
} }
else else //熄灭
{ {
; pCANMsg->Sig.Tcs_mode = 1;
pCANMsg->Sig.Tcs_Control = 1;
} }
} }
......
...@@ -164,7 +164,8 @@ typedef union ...@@ -164,7 +164,8 @@ typedef union
//uint64_t :8;/*2byte*/ //uint64_t :8;/*2byte*/
uint64_t :3; uint64_t :3;
uint64_t Msg_0x001_2b3t:1; uint64_t Msg_0x001_2b3t:1;
uint64_t :4; uint64_t Msg_0x001_2b4t:1;
uint64_t :3;
uint64_t :8; uint64_t :8;
uint64_t :8; uint64_t :8;
...@@ -246,6 +247,8 @@ typedef union ...@@ -246,6 +247,8 @@ typedef union
{ {
uint64_t :8; uint64_t :8;
uint64_t :8; uint64_t :8;
uint64_t :8;
uint64_t :8;
uint64_t TCS:4; uint64_t TCS:4;
uint64_t :2; uint64_t :2;
...@@ -255,8 +258,6 @@ typedef union ...@@ -255,8 +258,6 @@ typedef union
uint64_t :8; uint64_t :8;
uint64_t :8; uint64_t :8;
uint64_t :8; uint64_t :8;
uint64_t :8;
uint64_t :8;
} Sig; } Sig;
} CANMsg207Union; } CANMsg207Union;
......
...@@ -123,6 +123,7 @@ extern uint16_t Eletricity; ...@@ -123,6 +123,7 @@ extern uint16_t Eletricity;
extern uint8_t Hour; extern uint8_t Hour;
extern uint8_t Tcs; extern uint8_t Tcs;
extern uint8_t Energy_recovery; extern uint8_t Energy_recovery;
extern uint8_t motor_hot;
extern uint8_t Gear; extern uint8_t Gear;
extern uint8_t Ready; extern uint8_t Ready;
extern uint8_t Cruiste; extern uint8_t Cruiste;
......
...@@ -20,6 +20,7 @@ uint16_t Eletricity = 0; ...@@ -20,6 +20,7 @@ uint16_t Eletricity = 0;
uint8_t Hour = 0; uint8_t Hour = 0;
uint8_t Tcs = 0; uint8_t Tcs = 0;
uint8_t Energy_recovery = 0; uint8_t Energy_recovery = 0;
uint8_t motor_hot = 0;
uint8_t Gear = 0; uint8_t Gear = 0;
uint8_t Ready = 0; uint8_t Ready = 0;
uint8_t Cruiste = 0; uint8_t Cruiste = 0;
...@@ -483,6 +484,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -483,6 +484,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Hour = 0; Hour = 0;
Tcs = 0; Tcs = 0;
Energy_recovery = 0; Energy_recovery = 0;
motor_hot = 0;
Gear = 0; Gear = 0;
Ready = 0; Ready = 0;
Cruiste = 0; Cruiste = 0;
...@@ -492,6 +494,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -492,6 +494,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 0; Left_Led = 0;
Right_Led = 0; Right_Led = 0;
Headlights_Led = 0; Headlights_Led = 0;
LINE_OUT_NEG_05 = 1;
NFC_C_card = 0; NFC_C_card = 0;
...@@ -503,8 +506,9 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -503,8 +506,9 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Signal_GPS = 0; Signal_GPS = 0;
Eletricity = 0; Eletricity = 0;
Hour = 2; Hour = 2;
Tcs = 1; Tcs = 0;
Energy_recovery = 0; Energy_recovery = 0;
motor_hot = 0;
Gear = 1; Gear = 1;
Ready = 0; Ready = 0;
Cruiste = 0; Cruiste = 0;
...@@ -514,6 +518,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -514,6 +518,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 1; Left_Led = 1;
Right_Led = 1; Right_Led = 1;
Headlights_Led = 0; Headlights_Led = 0;
LINE_OUT_NEG_05 = 1;
NFC_C_card = 1; NFC_C_card = 1;
Hill_Descent_control = 1; Hill_Descent_control = 1;
break; break;
...@@ -523,8 +528,9 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -523,8 +528,9 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Signal_GPS = 0; Signal_GPS = 0;
Eletricity = 150; Eletricity = 150;
Hour = 4; Hour = 4;
Tcs = 0; Tcs = 1;
Energy_recovery = 0; Energy_recovery = 0;
motor_hot = 0;
Gear = 0; Gear = 0;
Ready = 0; Ready = 0;
Cruiste = 0; Cruiste = 0;
...@@ -534,6 +540,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -534,6 +540,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 0; Left_Led = 0;
Right_Led = 0; Right_Led = 0;
Headlights_Led = 1; Headlights_Led = 1;
LINE_OUT_NEG_05 = 1;
NFC_C_card=2; NFC_C_card=2;
Side_bracket = 1; Side_bracket = 1;
Hill_Descent_control = 0; Hill_Descent_control = 0;
...@@ -544,8 +551,9 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -544,8 +551,9 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Signal_GPS = 0; Signal_GPS = 0;
Eletricity = 350; Eletricity = 350;
Hour = 6; Hour = 6;
Tcs = 0; Tcs = 2;
Energy_recovery = 0; Energy_recovery = 0;
motor_hot = 0;
Gear = 2; Gear = 2;
Ready = 0; Ready = 0;
Cruiste = 0; Cruiste = 0;
...@@ -555,6 +563,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -555,6 +563,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 0; Left_Led = 0;
Right_Led = 0; Right_Led = 0;
Headlights_Led = 0; Headlights_Led = 0;
LINE_OUT_NEG_05 = 1;
NFC_C_card=0; NFC_C_card=0;
Charging_connection_led = 0; Charging_connection_led = 0;
break; break;
...@@ -566,6 +575,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -566,6 +575,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Hour = 8; Hour = 8;
Tcs = 0; Tcs = 0;
Energy_recovery = 0; Energy_recovery = 0;
motor_hot = 0;
Gear = 0; Gear = 0;
Ready = 0; Ready = 0;
Cruiste = 0; Cruiste = 0;
...@@ -575,6 +585,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -575,6 +585,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 0; Left_Led = 0;
Right_Led = 0; Right_Led = 0;
Headlights_Led = 0; Headlights_Led = 0;
LINE_OUT_NEG_05 = 0;
Charging_connection_led=1; Charging_connection_led=1;
break; break;
case 5: case 5:
...@@ -585,6 +596,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -585,6 +596,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Hour = 10; Hour = 10;
Tcs = 0; Tcs = 0;
Energy_recovery = 2; Energy_recovery = 2;
motor_hot = 0;
Gear = 0; Gear = 0;
Ready = 0; Ready = 0;
Cruiste = 0; Cruiste = 0;
...@@ -594,6 +606,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -594,6 +606,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 0; Left_Led = 0;
Right_Led = 0; Right_Led = 0;
Headlights_Led = 0; Headlights_Led = 0;
LINE_OUT_NEG_05 = 1;
Side_bracket=1; Side_bracket=1;
Charging_connection_led = 0; Charging_connection_led = 0;
break; break;
...@@ -603,8 +616,9 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -603,8 +616,9 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Signal_GPS = 0; Signal_GPS = 0;
Eletricity = 1000; Eletricity = 1000;
Hour = 12; Hour = 12;
Tcs = 2; Tcs = 0;
Energy_recovery = 1; Energy_recovery = 1;
motor_hot = 0;
Gear = 0; Gear = 0;
Ready = 1; Ready = 1;
Cruiste = 1; Cruiste = 1;
...@@ -614,6 +628,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -614,6 +628,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 0; Left_Led = 0;
Right_Led = 0; Right_Led = 0;
Headlights_Led = 0; Headlights_Led = 0;
LINE_OUT_NEG_05 = 1;
Side_bracket=0; Side_bracket=0;
break; break;
case 7: case 7:
...@@ -624,6 +639,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -624,6 +639,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Hour = 14; Hour = 14;
Tcs = 0; Tcs = 0;
Energy_recovery = 3; Energy_recovery = 3;
motor_hot = 0;
Gear = 0; Gear = 0;
Ready = 3; Ready = 3;
Cruiste = 0; Cruiste = 0;
...@@ -633,6 +649,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -633,6 +649,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 0; Left_Led = 0;
Right_Led = 0; Right_Led = 0;
Headlights_Led = 0; Headlights_Led = 0;
LINE_OUT_NEG_05 = 1;
break; break;
case 8: case 8:
Vspeed = 88; Vspeed = 88;
...@@ -642,6 +659,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -642,6 +659,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Hour = 16; Hour = 16;
Tcs = 0; Tcs = 0;
Energy_recovery = 0; Energy_recovery = 0;
motor_hot = 1;
Gear = 0; Gear = 0;
Ready = 2; Ready = 2;
Cruiste = 0; Cruiste = 0;
...@@ -651,6 +669,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -651,6 +669,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 0; Left_Led = 0;
Right_Led = 0; Right_Led = 0;
Headlights_Led = 0; Headlights_Led = 0;
LINE_OUT_NEG_05 = 1;
break; break;
case 9: case 9:
Vspeed = 88; Vspeed = 88;
...@@ -660,6 +679,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -660,6 +679,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Hour = 18; Hour = 18;
Tcs = 0; Tcs = 0;
Energy_recovery = 0; Energy_recovery = 0;
motor_hot = 0;
Gear = 0; Gear = 0;
Ready = 0; Ready = 0;
Cruiste = 0; Cruiste = 0;
...@@ -669,6 +689,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -669,6 +689,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 0; Left_Led = 0;
Right_Led = 0; Right_Led = 0;
Headlights_Led = 0; Headlights_Led = 0;
LINE_OUT_NEG_05 = 1;
break; break;
case 10: case 10:
Vspeed = 88; Vspeed = 88;
...@@ -678,6 +699,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -678,6 +699,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Hour = 20; Hour = 20;
Tcs = 0; Tcs = 0;
Energy_recovery = 0; Energy_recovery = 0;
motor_hot = 0;
Gear = 0; Gear = 0;
Ready = 0; Ready = 0;
Cruiste = 0; Cruiste = 0;
...@@ -688,6 +710,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -688,6 +710,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Right_Led = 0; Right_Led = 0;
Headlights_Led = 0; Headlights_Led = 0;
bluetooth_phone = 1; bluetooth_phone = 1;
LINE_OUT_NEG_05 = 1;
break; break;
case 11: case 11:
Vspeed = 88; Vspeed = 88;
...@@ -697,6 +720,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -697,6 +720,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Hour = 1; Hour = 1;
Tcs = 1; Tcs = 1;
Energy_recovery = 1; Energy_recovery = 1;
motor_hot = 1;
Gear = 1; Gear = 1;
Ready = 3; Ready = 3;
Cruiste = 1; Cruiste = 1;
...@@ -706,6 +730,7 @@ void User_CheckMode_Service(uint8_t CbkCycle) ...@@ -706,6 +730,7 @@ void User_CheckMode_Service(uint8_t CbkCycle)
Left_Led = 1; Left_Led = 1;
Right_Led = 1; Right_Led = 1;
Headlights_Led = 1; Headlights_Led = 1;
LINE_OUT_NEG_05 = 0;
Side_bracket = 1; Side_bracket = 1;
Hill_Descent_control = 1; Hill_Descent_control = 1;
bluetooth_phone = 0 ; bluetooth_phone = 0 ;
......
...@@ -199,7 +199,12 @@ void RTE_GPIO_Init(void) ...@@ -199,7 +199,12 @@ void RTE_GPIO_Init(void)
gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1; gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
GPIO_Config(&gpio_temp); GPIO_Config(&gpio_temp);
GPIO_Config(&gpio_temp);
gpio_temp.enGPIOPort = GPIO_PORT_GROUP_9;
gpio_temp.enGPIOPIN = GPIO_PIN_2;
gpio_temp.enGPIOMode = GPIO_MODE_PORT;
gpio_temp.enGPIODir = GPIO_DIR_OUT;
gpio_temp.enGPIOAltFun = GPIO_ALTER_FUN_1;
queren = 0; queren = 0;
......
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
#define NEG_2_Ctrl GPIO_OUT_PORT09_PIN05 #define NEG_2_Ctrl GPIO_OUT_PORT09_PIN05
#define NEG_3_Ctrl GPIO_OUT_PORT09_PIN04 #define NEG_3_Ctrl GPIO_OUT_PORT09_PIN04
#define NEG_4_Ctrl GPIO_OUT_PORT09_PIN03 #define NEG_4_Ctrl GPIO_OUT_PORT09_PIN03
#define NEG_5_Ctrl GPIO_OUT_PORT09_PIN02 // #define NEG_5_Ctrl GPIO_OUT_PORT09_PIN02
// #define NEG_6_Ctrl GPIO_OUT_PORT09_PIN01 // #define NEG_6_Ctrl GPIO_OUT_PORT09_PIN01
#define NEG_7_Ctrl GPIO_OUT_PORT10_PIN07 #define NEG_7_Ctrl GPIO_OUT_PORT10_PIN07
#define NEG_8_Ctrl GPIO_OUT_PORT10_PIN03 #define NEG_8_Ctrl GPIO_OUT_PORT10_PIN03
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
#define LINE_SafeBelt_2 NEG_2_Ctrl #define LINE_SafeBelt_2 NEG_2_Ctrl
#define LINE_SafeBelt_3 NEG_3_Ctrl #define LINE_SafeBelt_3 NEG_3_Ctrl
#define LINE_SafeBelt_4 NEG_4_Ctrl #define LINE_SafeBelt_4 NEG_4_Ctrl
#define LINE_SafeBelt_5 NEG_5_Ctrl // #define LINE_SafeBelt_5 NEG_5_Ctrl
// #define LINE_SafeBelt_2_press NEG_6_Ctrl // #define LINE_SafeBelt_2_press NEG_6_Ctrl
#define LINE_SafeBelt_3_press NEG_7_Ctrl #define LINE_SafeBelt_3_press NEG_7_Ctrl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment