Commit 702f6475 authored by 郑萍's avatar 郑萍

🐞 fix:天有为清大计策略:

125 MMCU_PowerMode  0x3
18203220  MBMS_StatBattWorkState 0xf
MBMS_StatBattChargeState 0x7
157 BMCU_BladeSpeedGear 0x7
339 MMCU_AccumulatedWorkHours>6000
以及增加刀盘档位熄灭时刀盘图标熄灭
parent ba6fcdf7
......@@ -69,6 +69,7 @@ void Common_Input_Para(void)
{
Common_Set_IG_Sts(COMMON_POWER_ON);
Common_Set_IG_Sts_Valid(COMMON_Valid);
Checkself_Init();
PowerIgnOffTimeLine = 0ul;
PowerIgnOnTimeLine = 0ul;
}
......
......@@ -2,12 +2,48 @@
#include "SEG_DISPLAY\SEG_DISPLAY.h"
#include "Application.h"
#define DISPLAY_OPEN ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != PKEY_ON) && (System_Indicator_CANFlag != 1))
#define TYW_CLEAR_TIME_FLAG ()
uint16_t poweroff_time = 0;
uint8_t SOC_Count_Time = 0;
uint8_t BUZZER_ON = 0;
uint8_t Charge_OFF_Flag = 0;
void TYW_Clear_Eeprom_Service(void)
{
uint8_t u8MBMS_StatBattChargeState = 0;
uint8_t u8MBMS_StatBattWorkState = 0;
uint8_t u8BMCU_BladeSpeedGear = 0;
uint16_t u16MMCU_AccumulatedWorkHours = 0;
if (Get_CAN_Power_State() == READY)
{
if ((CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18203220_Msg)) == CAN_SIG_NORMAL) && (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x157_Msg)) == CAN_SIG_NORMAL) && (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x339_Msg)) == CAN_SIG_NORMAL))
{
u8MBMS_StatBattChargeState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattChargeState();
u8MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
u16MMCU_AccumulatedWorkHours = Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours();
u8BMCU_BladeSpeedGear = Get_CAN_CH0_ID_157_Sig_BMCU_BladeSpeedGear();
if ((u8MBMS_StatBattChargeState == 0x7) && (u8MBMS_StatBattWorkState == 0xf) && (u8BMCU_BladeSpeedGear == 0x7) && (u16MMCU_AccumulatedWorkHours >= 6000))
{
g_u8TYWClearEepromFlag = 1;
}
else
{
g_u8TYWClearEepromFlag = 0;
}
}
else
{
g_u8TYWClearEepromFlag = 0;
}
}
else
{
g_u8TYWClearEepromFlag = 0;
}
}
void Gauge_Power_SOC_pull_Display(void)
{
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
......@@ -386,6 +422,13 @@ void Gauge_Service(void)
{
if ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != POWER_CHECK_NULL))
{
if (g_u8TYWClearEepromFlag >= 1)
{
TYW_RESET_TIME();
}
else
{
TYW_Clear_Eeprom_Service();
BUZZER_Init();
interact_PWM_Low_Duty = 100;
if (Common_GetIgnOnTime() > 1500)
......@@ -407,6 +450,7 @@ void Gauge_Service(void)
// Checkself_SEG_Display();
}
}
}
else if (Get_CAN_Power_State() == PKEY_ON)
{
poweroff_time = 0;
......@@ -581,3 +625,15 @@ void BUZZER_Init(void)
BUZZER_ON = 0;
RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_LOW); // OUT_EN_1
}
void TYW_RESET_TIME(void)
{
uint32_t Clear_EE[1] = {0};
if (g_u8TYWClearEepromFlag == 1)
{
g_u8TYWClearEepromFlag = 2;
Clear_EE[0] = 0;
eeprom_WriteRecord(EEPROM_BLOCK_00, (uint8_t *)&Clear_EE, 4);
}
Check_SEG_Display();
}
......@@ -39,6 +39,7 @@ typedef struct
extern uint8_t BUZZER_ON;
extern uint8_t Charge_OFF_Flag;
extern uint8_t EEPROM_Cumulativee_clean;
extern uint16_t poweroff_time;
void Gauge_Power_SOC_pull_Display(void);
// void Gauge_Power_2_SOC_Display(void);
......@@ -73,5 +74,6 @@ uint8_t Get_EleDial_AllSOC_lenth(void);
uint8_t Get_Clockonetime_lenth(void);
uint8_t Get_CAN_Num_SBMS_Soc_2_Grid(void);
uint8_t Get_CAN_Num_MBMS_Soc_1_Grid(void);
void TYW_Clear_Eeprom_Service(void);
void TYW_RESET_TIME(void);
#endif
......@@ -12,6 +12,7 @@ const uint8_t SEG_DISPLAY_NUMBER0[] = {0x3Fu, 0x06u, 0x5Bu, 0x4Fu, 0x66u, 0x6Du,
const uint8_t SEG_UNDISPLAY_NUMBER0[] = {0x00u, 0x06u, 0x5Bu, 0x4Fu, 0x66u, 0x6Du, 0x7Du, 0x07u, 0x7Fu, 0x6Fu};
uint8_t SOC_charge_seg_Flag = 0;
uint8_t checkself_seg_Flag = 0;
uint8_t g_u8TYWClearEepromFlag = 0;
/**@brief 边框线显示函数
* @param[in] m_Flag 是否显示 -1 显示 -0 不显示
* @return 函数执行结果
......@@ -251,6 +252,7 @@ _Fun_Res SEG_SET_Cutterhead(uint8_t m_Flag, uint8_t LED_NUM, uint8_t checkself)
}
else
{
IC1_SEG117 = IC_SEG_OFF;
IC1_SEG075 = IC_SEG_OFF;
IC1_SEG082 = IC_SEG_OFF;
IC1_SEG081 = IC_SEG_OFF;
......@@ -2555,39 +2557,77 @@ _Fun_Res SEG_SET_Clock_ALL(uint8_t m_Flag, uint32_t m_NUM)
}
return m_Res;
}
// uint8_t check_SEG_step = 0;
uint8_t check_SEG_step = 0;
///*仪表段码扫描函数*/
// void Check_SEG_Display(void)
//{
// uint32_t a;
// a = check_SEG_step / 25u;
// SEG_SET_TRIP_NUM(1u, ((a * 1000u) + (a * 100u) + (a * 10u) + a));
// SEG_SET_ODO_NUM(1u, ((a * 100000u) + (a * 10000u) + (a * 1000u) + (a * 100u) + (a * 10u) + a));
// SEG_SET_VSpeed_NUM(1u, (100u + (a * 10u) + a));
// SEG_SET_Clock(((a * 10u) + a), ((a * 10u) + a), 1u, 1u, 1u);
// SEG_SET_LED_STS(0, 1);
// SEG_SET_LED_STS(1, 1);
// SEG_SET_LED_STS(2, 1);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Fuel_Y, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_Fuel_W, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, LED_ON);
// RTE_GPIO_Set_Level(VSPEED_TEN_OUT, 1);
// RTE_GPIO_Set_Level(VSPEED_HUNDREDS_OUT, 1);
// SEG_Scan_SET_FuelDial();
// SEG_Scan_SET_EspeedDial();
//
//}
/*仪表段码扫描函数*/
void Check_SEG_Display(void)
{
uint16_t hour = 0;
uint16_t min = 0;
uint8_t soc_all = 0;
uint8_t Checkself_num = ((check_SEG_step * 10) / 48);
if (Checkself_num >= 10)
{
Checkself_num = 9;
}
uint32_t allhour = Checkself_num * 11111;
// Fuel = Checkself_SEG_step / 5u;
// SEG_SET_FuelDial(1, Fuel);
uint32_t EleDial_2SOC = ((check_SEG_step * 10) / 48);
SEG_SET_EleDial_2SOC(1, EleDial_2SOC);
SEG_SET_EleDial_1SOC(1, EleDial_2SOC);
soc_all = Checkself_num * 11 + 100;
SEG_SET_EleDial_AllSOC(1, soc_all);
checkself_seg_Flag = 1;
SEG_SET_Clock_ALL(1, allhour);
hour = Checkself_num * 11;
min = Checkself_num * 11;
SEG_SET_Clock(hour, min, 1, 1, 1);
SEG_SET_GEAR(1, Checkself_num, 1);
SEG_SET_Cutterhead(1, Checkself_num, 1);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_00_Grass_Full_R, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Gears_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_10_READY_G, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Key_Access_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_Seat_Detection_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_13_OVERLOAD_R, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_14_Cutterhead_Switch_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_Cutterhead_Gear_W, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_17_External_Discharge_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_21_LED_Open_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Working_Hours_One_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_32_Charging_Connection_R, LED_ON);
SEG_SET_LED_STS(SEG_LED_Recharge, 1);
SEG_SET_LED_STS(SEG_LED_System_Light, 1);
SEG_SET_LED_STS(SEG_LED_Chloramine, 1);
SEG_SET_LED_STS(SEG_LED_Cutter_Overload, 1);
SEG_SET_LED_STS(SEG_LED_Seat_Detection, 1);
SEG_SET_LED_STS(SEG_LED_Key_Access, 1);
SEG_SET_LED_STS(SEG_LED_Ready, 1);
SEG_SET_LED_STS(SEG_LED_Cutter_Head_switch, 1);
// SEG_SET_LED_STS(SEG_LED_External_Discharge, 1);
SEG_SET_LED_STS(SEG_LED_Distance_Light, 1);
SEG_SET_LED_STS(SEG_LED_HHT_Charger, 1);
SEG_SET_Frame(1);
if (check_SEG_step < 50)
{
check_SEG_step++;
}
else
{
check_SEG_step = 0;
}
}
uint8_t Checkself_SEG_step = 0;
uint8_t Checkself_SEG_step_count = 0;
......@@ -2597,7 +2637,9 @@ void Checkself_Init(void)
Checkself_SEG_step = 0;
Checkself_SEG_step_count = 0;
checkself_seg_Flag = 0;
check_SEG_step = 0;
Buzzer_time = 0;
g_u8TYWClearEepromFlag = 0;
}
uint8_t soc_all = 0;
void Checkself_SEG_Display(void)
......@@ -2606,15 +2648,15 @@ void Checkself_SEG_Display(void)
uint16_t Trip = 0;
uint16_t hour = 0;
uint16_t min = 0;
uint8_t Checkself_num = ((Checkself_SEG_step*10) / 48);
if(Checkself_num >= 10)
uint8_t Checkself_num = ((Checkself_SEG_step * 10) / 48);
if (Checkself_num >= 10)
{
Checkself_num = 9;
}
uint32_t allhour = Checkself_num * 11111;
// Fuel = Checkself_SEG_step / 5u;
// SEG_SET_FuelDial(1, Fuel);
uint32_t EleDial_2SOC = ((Checkself_SEG_step*10) / 48);
uint32_t EleDial_2SOC = ((Checkself_SEG_step * 10) / 48);
SEG_SET_EleDial_2SOC(1, EleDial_2SOC);
SEG_SET_EleDial_1SOC(1, EleDial_2SOC);
......@@ -2678,4 +2720,3 @@ void Checkself_SEG_Display(void)
// }
// }
}
......@@ -83,7 +83,7 @@ _Fun_Res SEG_SET_Clock(uint8_t m_hour, uint8_t m_minute, uint8_t m_icon, uint8_t
/**@brief 累计时间显示函数*/
_Fun_Res SEG_SET_Clock_ALL(uint8_t m_Flag , uint32_t m_NUM);
uint8_t Check_SEG_Display(void);
void Check_SEG_Display(void);
......@@ -116,6 +116,7 @@ extern uint8_t SOC_charge_seg_Flag;
extern uint8_t Checkself_SEG_step;
extern uint8_t Checkself_SEG_step_count;
extern uint8_t checkself_seg_Flag;
extern uint8_t g_u8TYWClearEepromFlag;
extern uint16_t Buzzer_time;
......
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