Commit 824aa2f5 authored by 郑萍's avatar 郑萍

feat:增加档位显示以及档位自检

parent d7b3317d
...@@ -49,7 +49,7 @@ void Can_Set_Buff_3A7(canlib_uint8_t CopyData[]) ...@@ -49,7 +49,7 @@ void Can_Set_Buff_3A7(canlib_uint8_t CopyData[])
{ {
CopyData[i] = 0xFFU; CopyData[i] = 0xFFU;
} }
p3A7 = (CANMsg3A7Union *)CopyData; p3A7 = (CANMsg3A7Union *)CopyData;
if (p3A7 != (void *)0) if (p3A7 != (void *)0)
{ {
p3A7->Sig.ICU_MasterBMSCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A20_Msg)) == CAN_ERR_OK); p3A7->Sig.ICU_MasterBMSCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A20_Msg)) == CAN_ERR_OK);
...@@ -84,8 +84,8 @@ void Can_Set_Buff_393(canlib_uint8_t CopyData[]) ...@@ -84,8 +84,8 @@ void Can_Set_Buff_393(canlib_uint8_t CopyData[])
p393->Sig.ICU_SubSoftVer = 1; p393->Sig.ICU_SubSoftVer = 1;
p393->Sig.ICU_SoftPhaseVer = 1; p393->Sig.ICU_SoftPhaseVer = 1;
p393->Sig.Res0 = 0x0; p393->Sig.Res0 = 0x0;
p393->Sig.ICU_ProtoVer = 1; p393->Sig.ICU_ProtoVer = 0;
p393->Sig.ICU_ProtoSubVer = 1; p393->Sig.ICU_ProtoSubVer = 7;
p393->Sig.Res1 = 0x00; p393->Sig.Res1 = 0x00;
} }
} }
...@@ -329,7 +329,7 @@ void Gauge_Service(void) ...@@ -329,7 +329,7 @@ void Gauge_Service(void)
interact_PWM_Low_Duty = 50; interact_PWM_Low_Duty = 50;
if (FLASH_SYNC_05Hz) if (FLASH_SYNC_05Hz)
{ {
SEG_SET_GEAR(1, 0); SEG_SET_GEAR(1, Gear_P, 0);
if (Buzzer_time <= 6000) if (Buzzer_time <= 6000)
{ {
RTE_GPIO_Config(RTE_GPIO_PORT04_PIN01, GpioOut_High); // OUT_EN_1 RTE_GPIO_Config(RTE_GPIO_PORT04_PIN01, GpioOut_High); // OUT_EN_1
...@@ -343,7 +343,7 @@ void Gauge_Service(void) ...@@ -343,7 +343,7 @@ void Gauge_Service(void)
} }
else else
{ {
SEG_SET_GEAR(0, 0); SEG_SET_GEAR(1, Gear_OFF, 0);
RTE_GPIO_Config(RTE_GPIO_PORT04_PIN01, GpioOut_Low); // OUT_EN_1 RTE_GPIO_Config(RTE_GPIO_PORT04_PIN01, GpioOut_Low); // OUT_EN_1
BUZZER_ON = 0; BUZZER_ON = 0;
} }
...@@ -382,6 +382,7 @@ void Gauge_CAN_setup_Service(void) ...@@ -382,6 +382,7 @@ void Gauge_CAN_setup_Service(void)
Charge_OFF_Flag = 0; Charge_OFF_Flag = 0;
interact_PWM_Low_Duty = 0; interact_PWM_Low_Duty = 0;
Gauge_Power_SOC_pull_Display(); Gauge_Power_SOC_pull_Display();
SEG_SET_Cutterhead(1, 3, 1);
} }
break; break;
case READY: case READY:
......
...@@ -35,16 +35,16 @@ typedef enum ...@@ -35,16 +35,16 @@ typedef enum
enum enum
{ {
Gear_P = 0, //P Gear_P = 0, //P
Gear_R, //R Gear_1, //R
Gear_N, //N Gear_2, //N
Gear_D, //D Gear_OFF, //D
}; };
/**@brief 边框线显示函数*/ /**@brief 边框线显示函数*/
_Fun_Res SEG_SET_Frame(uint8_t m_Flag); _Fun_Res SEG_SET_Frame(uint8_t m_Flag);
/**@brief 挡位显示函数*/ /**@brief 挡位显示函数*/
_Fun_Res SEG_SET_GEAR(uint8_t m_Gear_Flag,uint8_t m_Gear); _Fun_Res SEG_SET_GEAR(uint8_t m_Gear_Flag,uint8_t m_Gear,uint8_t checkself);
/**@brief 电量表盘1SOC显示函数*/ /**@brief 电量表盘1SOC显示函数*/
_Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag,uint8_t m_SEG); _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag,uint8_t m_SEG);
...@@ -100,7 +100,7 @@ _Fun_Res SEG_SET_Travel_Time_NUM(uint8_t m_Flag, uint32_t m_NUM); ...@@ -100,7 +100,7 @@ _Fun_Res SEG_SET_Travel_Time_NUM(uint8_t m_Flag, uint32_t m_NUM);
_Fun_Res SEG_Scan_SET_EleDial(uint8_t m_SEG); _Fun_Res SEG_Scan_SET_EleDial(uint8_t m_SEG);
_Fun_Res SEG_Scan_SET_PowerDial(uint8_t m_SEG); _Fun_Res SEG_Scan_SET_PowerDial(uint8_t m_SEG);
/**@brief 刀盘显示函数*/ /**@brief 刀盘显示函数*/
_Fun_Res SEG_SET_Cutterhead(uint16_t LED_NUM, uint8_t m_Flag); _Fun_Res SEG_SET_Cutterhead(uint8_t m_Flag, uint8_t LED_NUM, uint8_t checkself);
void SEG_Scan_SET_FuelDial(void); void SEG_Scan_SET_FuelDial(void);
void SEG_Scan_SET_EspeedDial(void); void SEG_Scan_SET_EspeedDial(void);
......
...@@ -375,7 +375,7 @@ static Tellib_uint16_t LED_Battery_Charging_Judgement(void) ...@@ -375,7 +375,7 @@ static Tellib_uint16_t LED_Battery_Charging_Judgement(void)
Tellib_uint8_t Signal3 = Get_CAN_Power_State(); Tellib_uint8_t Signal3 = Get_CAN_Power_State();
if(ADC_Read_Signal(ADC_CH_KL30_VOLTAGE) >= 9000 && ADC_Read_Signal(ADC_CH_KL30_VOLTAGE) <= 16000 && (Get_CAN_Power_State() != PKEY_ON && Get_CAN_Power_State() != KEY_OFF)) if(ADC_Read_Signal(ADC_CH_KL30_VOLTAGE) >= 9000 && ADC_Read_Signal(ADC_CH_KL30_VOLTAGE) <= 16000 && (Get_CAN_Power_State() != PKEY_ON && Get_CAN_Power_State() != KEY_OFF))
{ {
if (Signal1 == 0x1 && Signal2 == 0X1) if ((Signal1 == 0x1 || Signal1 == 0x0 ) && Signal2 == 0X1)
{ {
if(Signal3 == CHRG_PLUGIN || Signal3 == CHRGEND) if(Signal3 == CHRG_PLUGIN || Signal3 == CHRGEND)
{ {
...@@ -475,22 +475,23 @@ static void LED_Cutterhead_Switch_Execution(Tellib_uint16_t led_statu ...@@ -475,22 +475,23 @@ static void LED_Cutterhead_Switch_Execution(Tellib_uint16_t led_statu
} }
static Tellib_uint16_t LED_GEAR_Judgement(void) static Tellib_uint16_t LED_GEAR_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 1u; Tellib_uint16_t LED_STATE = 0u;
if(Get_CAN_Power_State() != KEY_OFF && Charge_OFF_Flag == 0)
{
LED_STATE = 1;
}
return LED_STATE; return LED_STATE;
} }
static void LED_GEAR_Execution(Tellib_uint16_t led_status) static void LED_GEAR_Execution(Tellib_uint16_t led_status)
{ {
// if ( led_status == 1u ) if ( led_status == 1u )
// { {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON);
// SEG_SET_GEAR(1,Gear_N); }
// } else
// else {
// { LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_OFF);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_OFF); }
// SEG_SET_GEAR(0,Gear_N);
// SEG_SET_LED_STS(SEG_LED_Cutter_Head_switch,0);
// }
} }
static Tellib_uint16_t LED_External_Discharge_Judgement(void) static Tellib_uint16_t LED_External_Discharge_Judgement(void)
...@@ -756,7 +757,7 @@ static void LED_Cutterhead_Gear_Execution(Tellib_uint16_t led_status) ...@@ -756,7 +757,7 @@ static void LED_Cutterhead_Gear_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_Working_Hours_One_Judgement(void) static Tellib_uint16_t LED_Working_Hours_One_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
if (Get_Clockonetime_lenth() == 1) if (Get_Clockonetime_lenth() == 1 && openLED_flag)
{ {
LED_STATE = 1; LED_STATE = 1;
} }
...@@ -839,11 +840,11 @@ static Tellib_uint16_t LED_P_GEAR_G_Judgement(void) ...@@ -839,11 +840,11 @@ static Tellib_uint16_t LED_P_GEAR_G_Judgement(void)
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_CH0_ID_125_Sig_MMCU_ParkingGearState(); Tellib_uint8_t Signal1 = Get_CAN_CH0_ID_125_Sig_MMCU_ParkingGearState();
Tellib_uint8_t Signal2 = Get_CAN_Power_State(); Tellib_uint8_t Signal2 = Get_CAN_Power_State();
if ( Signal1 == 0x1 && openLED_flag) if ( Signal1 == 0x1 && openLED_flag && checkself_seg_Flag == 0)
{ {
LED_STATE = 1; LED_STATE = 1;
} }
else if(Signal2 == PKEY_ON) else if(Signal2 == PKEY_ON && checkself_seg_Flag == 0)
{ {
LED_STATE = 2; LED_STATE = 2;
} }
...@@ -857,28 +858,24 @@ static void LED_P_GEAR_G_Execution(Tellib_uint16_t led_status) ...@@ -857,28 +858,24 @@ static void LED_P_GEAR_G_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if ( led_status == 1u )
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_ON);
SEG_SET_GEAR(Gear_P, 1); SEG_SET_GEAR(1, Gear_P, 0);
} }
else if(led_status == 2u) else if(led_status == 2u)
{ {
if(FLASH_SYNC_05Hz) if(FLASH_SYNC_05Hz)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_ON);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_OFF);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_OFF);
} }
} }
else else if(checkself_seg_Flag == 0)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_OFF);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_OFF);
SEG_SET_GEAR(Gear_P, 0); SEG_SET_GEAR(0, Gear_P, 0);
} }
} }
static Tellib_uint16_t LED_Fuel_Alarm_W_Judgement(void) static Tellib_uint16_t LED_Fuel_Alarm_W_Judgement(void)
......
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