Commit 7eb49f99 authored by 郑萍's avatar 郑萍

feat:增加系统指示灯以及修复系统指示灯点亮时其他段码点亮的情况

parent bce14a43
...@@ -36,6 +36,7 @@ typedef enum ...@@ -36,6 +36,7 @@ typedef enum
CHRG_PLUGIN, CHRG_PLUGIN,
CHRGING, CHRGING,
CHRGEND, CHRGEND,
POWER_CHECK_NULL,
} POWER_CHECK_STATE_t; } POWER_CHECK_STATE_t;
typedef enum typedef enum
......
...@@ -85,7 +85,7 @@ void Set_CAN_ALL_Signal(void) ...@@ -85,7 +85,7 @@ void Set_CAN_ALL_Signal(void)
else else
{ {
MMCU_SeatDetectState = Get_CAN_CH0_ID_125_Sig_MMCU_SeatDetectState(); // 掉线需要做处理 MMCU_SeatDetectState = Get_CAN_CH0_ID_125_Sig_MMCU_SeatDetectState(); // 掉线需要做处理
MMCU_PowerMode = Get_CAN_CH0_ID_125_Sig_MMCU_PowerMode(); // MMCU_PowerMode = Get_CAN_CH0_ID_125_Sig_MMCU_PowerMode();
} }
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x339_Msg)) == CAN_ERR_OK) if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x339_Msg)) == CAN_ERR_OK)
{ {
......
...@@ -30,7 +30,6 @@ uint8_t Common_Get_IG_Sts(void) ...@@ -30,7 +30,6 @@ uint8_t Common_Get_IG_Sts(void)
return (uint8_t)PowerSts; return (uint8_t)PowerSts;
} }
uint16_t Common_Get_TireSize(void) uint16_t Common_Get_TireSize(void)
{ {
return 1u; return 1u;
...@@ -50,23 +49,29 @@ void Common_Set_IG_Sts_Valid(DataValid_t Val) ...@@ -50,23 +49,29 @@ void Common_Set_IG_Sts_Valid(DataValid_t Val)
PowerSts_Valid = Val; PowerSts_Valid = Val;
} }
void Common_Input_Para(void) void Common_Input_Para(void)
{ {
if (SYS_OPR_STAT_IGN_ON) if (SYS_OPR_STAT_IGN_ON)
{ {
if ((Get_CAN_Power_State() != KEY_OFF)) if ((Get_CAN_Power_State() != KEY_OFF) && (System_Indicator_CANFlag != 1))
{ {
Common_Set_IG_Sts(COMMON_POWER_ON); Common_Set_IG_Sts(COMMON_POWER_ON);
Common_Set_IG_Sts_Valid(COMMON_Valid); Common_Set_IG_Sts_Valid(COMMON_Valid);
PowerIgnOffTimeLine = 0ul; PowerIgnOffTimeLine = 0ul;
if (PowerIgnOnTimeLine < 0x7ffffffful) if (PowerIgnOnTimeLine < 0x7ffffffful && (Get_CAN_Power_State() != PKEY_ON))
{ {
PowerIgnOnTimeLine += 2u; PowerIgnOnTimeLine += 2u;
} }
} }
else if (System_Indicator_CANFlag == 1)
{
Common_Set_IG_Sts(COMMON_POWER_ON);
Common_Set_IG_Sts_Valid(COMMON_Valid);
PowerIgnOffTimeLine = 0ul;
PowerIgnOnTimeLine = 1600ul;
}
else else
{ {
PowerIgnOnTimeLine = 0ul; PowerIgnOnTimeLine = 0ul;
...@@ -108,4 +113,3 @@ uint32_t Common_GetSocTime(void) ...@@ -108,4 +113,3 @@ uint32_t Common_GetSocTime(void)
{ {
return PowerSocTimeLine; return PowerSocTimeLine;
} }
#include "GUI_Display\GUI_Display.h" #include "GUI_Display\GUI_Display.h"
#include "SEG_DISPLAY\SEG_DISPLAY.h" #include "SEG_DISPLAY\SEG_DISPLAY.h"
#include "Application.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))
uint16_t poweroff_time = 0; uint16_t poweroff_time = 0;
uint8_t SOC_Count_Time = 0; uint8_t SOC_Count_Time = 0;
...@@ -11,7 +11,7 @@ uint8_t Charge_OFF_Flag = 0; ...@@ -11,7 +11,7 @@ uint8_t Charge_OFF_Flag = 0;
void Gauge_Power_SOC_pull_Display(void) void Gauge_Power_SOC_pull_Display(void)
{ {
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState(); // uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if (DISPLAY_OPEN)
{ {
uint8_t Current_1_Grid = Get_CAN_Num_MBMS_Soc_1_Grid(); uint8_t Current_1_Grid = Get_CAN_Num_MBMS_Soc_1_Grid();
uint8_t Current_2_Grid = Get_CAN_Num_SBMS_Soc_2_Grid(); uint8_t Current_2_Grid = Get_CAN_Num_SBMS_Soc_2_Grid();
...@@ -59,7 +59,7 @@ void Gauge_Gears_Display(void) ...@@ -59,7 +59,7 @@ void Gauge_Gears_Display(void)
uint8_t Signal1 = Get_CAN_Num_MMCU_TravelSpeedGear(); uint8_t Signal1 = Get_CAN_Num_MMCU_TravelSpeedGear();
uint8_t Signal2 = Get_CAN_Num_MMCU_ParkingGearState(); uint8_t Signal2 = Get_CAN_Num_MMCU_ParkingGearState();
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState(); // uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0) &&(Get_CAN_Power_State() != KEY_OFF))
{ {
if (Signal2 != 0x1) if (Signal2 != 0x1)
{ {
...@@ -110,7 +110,7 @@ void Gauge_Power_SOC_CHAGING_Display(void) ...@@ -110,7 +110,7 @@ void Gauge_Power_SOC_CHAGING_Display(void)
uint8_t MBMS_TOTALSigCharge = Get_CAN_Num_MBMS_TOTALSigCharge(); uint8_t MBMS_TOTALSigCharge = Get_CAN_Num_MBMS_TOTALSigCharge();
uint8_t MBMS_StatBattWorkState = Get_CAN_Num_MBMS_StatBattWorkState(); uint8_t MBMS_StatBattWorkState = Get_CAN_Num_MBMS_StatBattWorkState();
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState(); // uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if (Common_Get_IG_Sts() == COMMON_POWER_ON) if ((Common_Get_IG_Sts() == COMMON_POWER_ON))
{ {
uint8_t Current_1_Grid = Get_CAN_Num_MBMS_Soc_1_Grid(); uint8_t Current_1_Grid = Get_CAN_Num_MBMS_Soc_1_Grid();
uint8_t Current_2_Grid = Get_CAN_Num_SBMS_Soc_2_Grid(); uint8_t Current_2_Grid = Get_CAN_Num_SBMS_Soc_2_Grid();
...@@ -210,7 +210,7 @@ uint8_t AllSOC_DIS = 0; ...@@ -210,7 +210,7 @@ uint8_t AllSOC_DIS = 0;
void Gauge_EleDial_AllSOC_Display(void) void Gauge_EleDial_AllSOC_Display(void)
{ {
if (Common_Get_IG_Sts() == COMMON_POWER_ON) if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != PKEY_ON))
{ {
AllSOC_DIS = Get_CAN_Num_MBMS_StatSoc(); AllSOC_DIS = Get_CAN_Num_MBMS_StatSoc();
SEG_SET_EleDial_AllSOC(1, AllSOC_DIS); SEG_SET_EleDial_AllSOC(1, AllSOC_DIS);
...@@ -238,7 +238,7 @@ uint8_t Clockonetime_flag = 0; ...@@ -238,7 +238,7 @@ uint8_t Clockonetime_flag = 0;
void Gauge_Clock_Display(void) void Gauge_Clock_Display(void)
{ {
uint32_t Clock_all = 0; uint32_t Clock_all = 0;
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if (DISPLAY_OPEN)
{ {
Clock_all = Get_CAN_Num_MMCU_SingleWorkingHours(); Clock_all = Get_CAN_Num_MMCU_SingleWorkingHours();
uint8_t Clock_hours = Clock_all / 10; uint8_t Clock_hours = Clock_all / 10;
...@@ -261,7 +261,7 @@ uint16_t EEPROM_Write_Time = 0; ...@@ -261,7 +261,7 @@ uint16_t EEPROM_Write_Time = 0;
void Data_CumulativeWorkHours_EEPROM_Write(void) void Data_CumulativeWorkHours_EEPROM_Write(void)
{ {
uint32_t u32Data[1] = {0}; uint32_t u32Data[1] = {0};
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if (DISPLAY_OPEN)
{ {
u32Data[0] = Get_CAN_Num_MMCU_AccumulatedWorkHours(); u32Data[0] = Get_CAN_Num_MMCU_AccumulatedWorkHours();
if (++EEPROM_Write_Time > 6000) // 一分钟存一次 if (++EEPROM_Write_Time > 6000) // 一分钟存一次
...@@ -282,7 +282,7 @@ uint32_t u32Data_read[1] = {0}; ...@@ -282,7 +282,7 @@ uint32_t u32Data_read[1] = {0};
void Gauge_Clock_All_Display(void) void Gauge_Clock_All_Display(void)
{ {
eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data_read, 4); eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data_read, 4);
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if (DISPLAY_OPEN)
{ {
SEG_SET_Clock_ALL(1, u32Data_read[0]); SEG_SET_Clock_ALL(1, u32Data_read[0]);
} }
...@@ -306,7 +306,7 @@ uint8_t Get_Clock_All_lenth(void) ...@@ -306,7 +306,7 @@ uint8_t Get_Clock_All_lenth(void)
} }
void Gauge_Frame_Display(void) void Gauge_Frame_Display(void)
{ {
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if (DISPLAY_OPEN)
{ {
SEG_SET_Frame(1); SEG_SET_Frame(1);
} }
...@@ -331,7 +331,7 @@ void Gauge_Service(void) ...@@ -331,7 +331,7 @@ void Gauge_Service(void)
uint8_t i = 0; uint8_t i = 0;
if (Common_Get_IG_Sts() == COMMON_POWER_ON) if (Common_Get_IG_Sts() == COMMON_POWER_ON)
{ {
if (Get_CAN_Power_State() != PKEY_ON) if ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF))
{ {
BUZZER_Init(); BUZZER_Init();
if (Common_GetIgnOnTime() > 1500) if (Common_GetIgnOnTime() > 1500)
...@@ -484,7 +484,7 @@ void Checkself_LED_Display(void) ...@@ -484,7 +484,7 @@ void Checkself_LED_Display(void)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_00_Grass_Full_R, LED_ON); 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_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_02_System_Indicator_R, 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);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON);
...@@ -502,7 +502,7 @@ void Checkself_LED_Display(void) ...@@ -502,7 +502,7 @@ void Checkself_LED_Display(void)
LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Working_Hours_One_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); 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_Recharge, 1);
// SEG_SET_LED_STS(SEG_LED_System_Light, 1); SEG_SET_LED_STS(SEG_LED_System_Light, 1);
SEG_SET_LED_STS(SEG_LED_Chloramine, 1); SEG_SET_LED_STS(SEG_LED_Chloramine, 1);
SEG_SET_LED_STS(SEG_LED_Cutter_Overload, 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_Seat_Detection, 1);
......
...@@ -105,7 +105,7 @@ monitorlib_uint8_t Sys_Read_KL15_Valid(void) ...@@ -105,7 +105,7 @@ monitorlib_uint8_t Sys_Read_KL15_Valid(void)
monitorlib_uint8_t System_LINE_KL15(void) monitorlib_uint8_t System_LINE_KL15(void)
{ {
static monitorlib_uint8_t u8KL15 = 0; static monitorlib_uint8_t u8KL15 = 0;
if (Get_CAN_CH0_ID_125_Sig_MMCU_PowerMode() != 0x0 ) if ((Get_CAN_Num_MMCU_PowerMode() != 0x0) || (System_Indicator_CANFlag == 1))
{ {
u8KL15 = 1u; u8KL15 = 1u;
} }
......
...@@ -835,7 +835,7 @@ static Tellib_uint16_t LED_SystIndicator_R_Judgement(void) ...@@ -835,7 +835,7 @@ static Tellib_uint16_t LED_SystIndicator_R_Judgement(void)
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_ErrorGrage(); Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_ErrorGrage();
Tellib_uint8_t Signal2 = Get_CAN_Num_SMCU_ErrorGrage(); Tellib_uint8_t Signal2 = Get_CAN_Num_SMCU_ErrorGrage();
Tellib_uint8_t Signal3 = System_Indicator_CANFlag; Tellib_uint8_t Signal3 = System_Indicator_CANFlag;
if (((Signal1 == 0x4) || (Signal1 == 0x5) ||(Signal2 == 0x4) || (Signal2 == 0x5) || (Signal3 == 1)) && openLED_flag) if (((Signal1 == 0x4) || (Signal1 == 0x5) ||(Signal2 == 0x4) || (Signal2 == 0x5) || (Signal3 == 1)))
{ {
LED_STATE = 1; LED_STATE = 1;
...@@ -848,16 +848,16 @@ static Tellib_uint16_t LED_SystIndicator_R_Judgement(void) ...@@ -848,16 +848,16 @@ static Tellib_uint16_t LED_SystIndicator_R_Judgement(void)
} }
static void LED_SystIndicator_R_Execution(Tellib_uint16_t led_status) static void LED_SystIndicator_R_Execution(Tellib_uint16_t led_status)
{ {
// if ( led_status == 1u ) if ( led_status == 1u )
// { {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_ON);
// SEG_SET_LED_STS(SEG_LED_System_Light,1); SEG_SET_LED_STS(SEG_LED_System_Light,1);
// } }
// else else
// { {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_OFF);
// SEG_SET_LED_STS(SEG_LED_System_Light,0); SEG_SET_LED_STS(SEG_LED_System_Light,0);
// } }
} }
static Tellib_uint16_t LED_P_GEAR_G_Judgement(void) static Tellib_uint16_t LED_P_GEAR_G_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