Commit 11760a7c authored by 时昊's avatar 时昊

变更

parent c6a0b88a
......@@ -25,7 +25,7 @@ if not "%~1" == "" goto debugFile
@echo on
"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.5\common\bin\cspybat" -f "C:\Users\Administrator\Desktop\L\lg02y\IAR_EWARM\Application\settings\Application.DebugWithoutBootloader.general.xcl" --backend -f "C:\Users\Administrator\Desktop\L\lg02y\IAR_EWARM\Application\settings\Application.DebugWithoutBootloader.driver.xcl"
"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.5\common\bin\cspybat" -f "E:\work\le19基于lg02y的变更单号0059的基础上改\lg02y源码\IAR_EWARM\Application\settings\Application.DebugWithoutBootloader.general.xcl" --backend -f "E:\work\le19基于lg02y的变更单号0059的基础上改\lg02y源码\IAR_EWARM\Application\settings\Application.DebugWithoutBootloader.driver.xcl"
@echo off
goto end
......@@ -34,7 +34,7 @@ goto end
@echo on
"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.5\common\bin\cspybat" -f "C:\Users\Administrator\Desktop\L\lg02y\IAR_EWARM\Application\settings\Application.DebugWithoutBootloader.general.xcl" "--debug_file=%~1" --backend -f "C:\Users\Administrator\Desktop\L\lg02y\IAR_EWARM\Application\settings\Application.DebugWithoutBootloader.driver.xcl"
"C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.5\common\bin\cspybat" -f "E:\work\le19基于lg02y的变更单号0059的基础上改\lg02y源码\IAR_EWARM\Application\settings\Application.DebugWithoutBootloader.general.xcl" "--debug_file=%~1" --backend -f "E:\work\le19基于lg02y的变更单号0059的基础上改\lg02y源码\IAR_EWARM\Application\settings\Application.DebugWithoutBootloader.driver.xcl"
@echo off
:end
\ No newline at end of file
......@@ -14,7 +14,7 @@
RTC_Time_st_t RTCTimeCurrent;
extern uint32_t Factory_ClearOdo_Display_Flag;
BattCurr_st_t BattCurr;
const PowerSegMap_st_t PositivePowerSegMap [] = {
{0u, 0u},
{12u, 1u},
......@@ -152,23 +152,36 @@ void Gauge_Power_Display(void)
uint32_t powerCurrentValue;
uint32_t powerRemainingAvailableValue;
uint8_t i;
uint8_t signFlag = 0;
uint32_t Batt_Curr = 0;
if ( SYS_OPR_STAT_IGN_ON )
{
if(Factory_ClearOdo_Display_Flag == 0)
{
if ( (CAN_MSG_Status(ID_can0x18FAB027_Msg_Count) == 0u) && (CAN_MSG_Status(ID_can0x18FAB327_Msg_Count) == 0u) )
Batt_Curr = Get_ID_18FA40F4_Sig_BMSBattCurr();
if((CAN_MSG_Status(ID_can0x18FA40F4_Msg_Count) != 0u)||(Batt_Curr == 0XFFFF ))
{
// 0格和--%
BattCurr.Valid = 0;
BattCurr.Value = 0;
SEG_SET_PowerDial(1u, 0u, 0u, 255u);
}
else
{
if(CAN_MSG_Status(ID_can0x18FAB027_Msg_Count) == 0u)
{
if(Get_ID_18FAB027_Sig_VCUPTModeInd() != 1)//+
{
if(CAN_MSG_Status(ID_can0x18FAB327_Msg_Count) == 0u)
{
if((Get_ID_18FAB027_Sig_VCUPTSysElecPwrInd() / 2u) == 0)
{
SEG_SET_PowerDial(1u, 0u, 0u, 0u);
}
else
{
//��ȡ��ǰ����
powerCurrentValue = Get_ID_18FAB027_Sig_VCUPTSysElecPwrInd( ) / 2u;
powerDisplaySign = Get_ID_18FAB027_Sig_VCUPTModeInd();
//��ȡʣ����ù���??
powerRemainingAvailableValue = Get_ID_18FAB327_Sig_VCU_PTResiduePwrInd( ) / 10u;
//������ʾ�ٷֱ�
if ( (powerCurrentValue == 0u) && (powerRemainingAvailableValue == 0u) )
{
powerDisplayValue = 0;
......@@ -178,10 +191,7 @@ void Gauge_Power_Display(void)
{
if ( powerDisplaySign != 1u )
{
signFlag = 0;
powerDisplayValue = powerCurrentValue * 100u / (powerCurrentValue + powerRemainingAvailableValue);
//�������������??
for ( i = 0; i < POSITIVE_POWER_SEG_MAP_MAX; i++ )
{
if ( powerDisplayValue <= PositivePowerSegMap [ i ].value )
......@@ -191,69 +201,102 @@ void Gauge_Power_Display(void)
}
}
}
else
}
if ( (powerSegNum != 0xffu) && (powerDisplayValue <= 100u) )
{
signFlag = 1;
powerDisplayValue = powerCurrentValue;
//�����ʴ���100��100��ʾ
powerDisplayValue = powerDisplayValue * 100u / 40u;
if ( powerDisplayValue > 100 )
if (Common_Get_Act_V_Speed() < 20u)
{
powerDisplayValue = 100;
SEG_SET_PowerDial(1u, 0u, 0u, 0u);
}
//�������������??
for ( i = 0; i < NEGATIVE_POWER_SEG_MAP_MAX; i++ )
else
{
if ( powerDisplayValue <= NegativePowerSegMap [ i ].value )
SEG_SET_PowerDial(1u, powerSegNum, 0, powerDisplayValue);
}
}
else
{
powerSegNum = NegativePowerSegMap [ i ].segNum;
break;
SEG_SET_PowerDial(1u, 0u, 0u, 0u);
}
}
}
else
{
SEG_SET_PowerDial(1u, 0u, 0u, 255u);
}
}
//������ʾ
if ( (powerSegNum != 0xffu) && (powerDisplayValue <= 100u) )
else//-
{
//���ٹ����߼�
//ʵ�ʳ��٣�2km/h ʱ����ʾ����Ϊ0
// 2km/h��ʵ�ʳ��٣�7km/h����������ʾΪ0
//ʵ�ʳ��١�7km/h ʱ��������ʾ��
if ( (Common_Get_Act_V_Speed( ) < 20u) || ((Common_Get_Act_V_Speed( ) < 70u) && (powerDisplaySign == 1u)) )
if (Batt_Curr < 0xFB00)
{
SEG_SET_PowerDial(1u, 0u, 0u, 0u);
BattCurr.Valid = 1;
Batt_Curr = (Batt_Curr * 5);
if (Batt_Curr >= 160000)
{
Batt_Curr -= 160000;
BattCurr.Symbol = 0;
}
else
{
if(powerDisplayValue == 0)
Batt_Curr = 160000 - Batt_Curr;
BattCurr.Symbol = 1;
}
BattCurr.Value = Batt_Curr/100;
}
else
{
SEG_SET_PowerDial(1u, powerSegNum, 0, powerDisplayValue);
BattCurr.Symbol = 0;
BattCurr.Valid = 0;
BattCurr.Value = 0;
}
if ((Common_Get_Act_V_Speed() >= 20u)&&(Common_Get_Act_V_Speed() < 70u)||(Common_Get_Act_V_Speed() < 20u))
{
//0格和0%
SEG_SET_PowerDial(1u, 0u, 0u, 0u);
}
else
{
SEG_SET_PowerDial(1u, powerSegNum, signFlag, powerDisplayValue);
if(BattCurr.Symbol == 1)
{
if((BattCurr.Value <= 100)&&(BattCurr.Value > 0))
{
//-1格和-50%
SEG_SET_PowerDial(1u, 0x81u, 1u, 50u);
}
else if(BattCurr.Value > 100)
{
//-1 -2格和-100%
SEG_SET_PowerDial(1u, 0x82u, 1u, 100u);
}
}
else
{
//�źŴ�����
if(BattCurr.Value >= 0)
{
//0格和0%
SEG_SET_PowerDial(1u, 0u, 0u, 0u);
}
}
}
}
}
else
{
//���ĵ��ߴ���
BattCurr.Valid = 0;
BattCurr.Value = 0;
SEG_SET_PowerDial(1u, 0u, 0u, 255u);
}
}
}
}
else
{
// IGOFF����
SEG_SET_PowerDial(0u, 0u, 0u, 0u);
BattCurr.Symbol = 0;
BattCurr.Valid = 0;
BattCurr.Value = 0;
}
}
/**************************************************************************
......@@ -478,6 +521,10 @@ void Gauge_Gear_Display(void)
DisplayGear = 2u;
Gear_keep_current = 2;
break;
case 0xFAu:
DisplayGear = 4u;
Gear_keep_current = 4;
break;
default:
DisplayGear = 0u;
Gear_keep_current = 0;
......
......@@ -17,6 +17,14 @@ typedef struct
uint8_t segNum;
}BatterySegMap_st_t;
typedef struct
{
uint32_t Value;
uint8_t Symbol;
uint8_t Valid;
}BattCurr_st_t;
#define POSITIVE_POWER_SEG_MAP_MAX (sizeof(PositivePowerSegMap)/sizeof(PowerSegMap_st_t))
#define NEGATIVE_POWER_SEG_MAP_MAX (sizeof(NegativePowerSegMap)/sizeof(PowerSegMap_st_t))
#define BATTERY_SEG_MAP_MAX (sizeof(batterySegMap)/sizeof(BatterySegMap_st_t))
......
......@@ -141,7 +141,7 @@ _Fun_Res SEG_SET_LED_STS(uint8_t LED_NUM , uint8_t m_Flag)
_Fun_Res SEG_SET_GEAR(uint8_t m_Gear_Flag,uint8_t m_Gear)
{
_Fun_Res m_Res ;
if((m_Gear_Flag>=2u)||(m_Gear>3u))
if((m_Gear_Flag>=2u)||(m_Gear>4u))
{
m_Res = EX_ERR;
}
......@@ -221,6 +221,30 @@ _Fun_Res SEG_SET_GEAR(uint8_t m_Gear_Flag,uint8_t m_Gear)
IC2_SEG042 = IC_SEG_OFF;
IC2_SEG043 = IC_SEG_ON;
IC2_SEG044 = IC_SEG_ON;
}
else if(m_Gear==Gear_S)
{
IC2_SEG034 = IC_SEG_OFF;
IC2_SEG033 = IC_SEG_ON;
IC2_SEG031 = IC_SEG_ON;
IC2_SEG050 = IC_SEG_ON;
IC2_SEG036 = IC_SEG_ON;
IC2_SEG035 = IC_SEG_OFF;
IC2_SEG049 = IC_SEG_OFF;
IC2_SEG037 = IC_SEG_ON;
IC2_SEG041 = IC_SEG_ON;
IC2_SEG032 = IC_SEG_ON;
IC2_SEG030 = IC_SEG_ON;
IC2_SEG048 = IC_SEG_ON;
IC2_SEG038 = IC_SEG_OFF;
IC2_SEG046 = IC_SEG_OFF;
IC2_SEG047 = IC_SEG_ON;
IC2_SEG045 = IC_SEG_ON;
IC2_SEG039 = IC_SEG_OFF;
IC2_SEG040 = IC_SEG_ON;
IC2_SEG042 = IC_SEG_ON;
IC2_SEG043 = IC_SEG_ON;
IC2_SEG044 = IC_SEG_ON;
}
else
{
......@@ -2839,6 +2863,30 @@ _Fun_Res SEG_SET_GEAR1(uint8_t m_Gear_Flag,uint8_t m_Gear)
IC2_SEG042 = IC_SEG_OFF;
IC2_SEG043 = IC_SEG_ON;
IC2_SEG044 = IC_SEG_ON;
}
else if(m_Gear==Gear_S)
{
IC2_SEG034 = IC_SEG_OFF;
IC2_SEG033 = IC_SEG_ON;
IC2_SEG031 = IC_SEG_ON;
IC2_SEG050 = IC_SEG_ON;
IC2_SEG036 = IC_SEG_ON;
IC2_SEG035 = IC_SEG_OFF;
IC2_SEG049 = IC_SEG_OFF;
IC2_SEG037 = IC_SEG_ON;
IC2_SEG041 = IC_SEG_ON;
IC2_SEG032 = IC_SEG_ON;
IC2_SEG030 = IC_SEG_ON;
IC2_SEG048 = IC_SEG_ON;
IC2_SEG038 = IC_SEG_OFF;
IC2_SEG046 = IC_SEG_OFF;
IC2_SEG047 = IC_SEG_ON;
IC2_SEG045 = IC_SEG_ON;
IC2_SEG039 = IC_SEG_OFF;
IC2_SEG040 = IC_SEG_ON;
IC2_SEG042 = IC_SEG_ON;
IC2_SEG043 = IC_SEG_ON;
IC2_SEG044 = IC_SEG_ON;
}
else
{
......
......@@ -49,6 +49,7 @@ enum
Gear_R, //R
Gear_N, //N
Gear_D, //D
Gear_S, //S
};
/**@brief �߿�����ʾ����*/
......
......@@ -24,6 +24,7 @@ const _LINE_IN_TriggerLevel_ Line_In_DEFAULT_Level[LINE_MAX] =
LEVEL_LOW,
LEVEL_HIGH,
LEVEL_LOW,//sh
LEVEL_HIGH,
};
/*触发电平*/
const _LINE_IN_TriggerLevel_ Line_In_Trigger_Level[LINE_MAX] =
......@@ -44,6 +45,7 @@ const _LINE_IN_TriggerLevel_ Line_In_Trigger_Level[LINE_MAX] =
LEVEL_HIGH,
LEVEL_LOW,
LEVEL_HIGH,//sh
LEVEL_LOW,
};
/*清除电平*/
const _LINE_IN_TriggerLevel_ Line_In_Remove_Level[LINE_MAX] =
......@@ -64,6 +66,7 @@ const _LINE_IN_TriggerLevel_ Line_In_Remove_Level[LINE_MAX] =
LEVEL_LOW,
LEVEL_HIGH,
LEVEL_LOW,//sh
LEVEL_HIGH,
};
/*工作状态*/
const _LINE_IN_WorkSt_ Line_In_Work_Status[LINE_MAX] =
......@@ -84,6 +87,7 @@ const _LINE_IN_WorkSt_ Line_In_Work_Status[LINE_MAX] =
LINE_IN_IG_OFFON,
LINE_IN_IG_OFFON,
LINE_IN_IG_ON,//sh
LINE_IN_IG_ON,
};
/*触发时间*/
const uint32_t Line_In_Trigger_Timer[LINE_MAX] =
......@@ -104,6 +108,7 @@ const uint32_t Line_In_Trigger_Timer[LINE_MAX] =
100ul,
100ul,
100ul,//sh
100ul,
};
/*清除电平*/
const uint32_t Line_In_Remove_Timer[LINE_MAX] =
......@@ -124,6 +129,7 @@ const uint32_t Line_In_Remove_Timer[LINE_MAX] =
50ul,
50ul,
80ul,//sh
80ul,
};
/*使能*/
......@@ -197,6 +203,7 @@ void Line_In_Debounce_Service(void)
Line_In_Debounce( LINE_IN_SOC_CC, Get_Line_In_SOC_CC());
Line_In_Debounce( LINE_IN_DOOROPEN, Get_Line_In_DoorOpen());
Line_In_Debounce( LINE_IN_ENERGY_RECOVERY, Get_Line_In_Energy_Recovery());//sh //前雾灯
Line_In_Debounce( LINE_IN_ENERGY_RECOVERY0, Get_Line_In_Energy_Recovery0());
}
}
/*获取当前硬线状态*/
......
......@@ -38,6 +38,7 @@ typedef enum
LINE_IN_SOC_CC,
LINE_IN_DOOROPEN,
LINE_IN_ENERGY_RECOVERY,//sh
LINE_IN_ENERGY_RECOVERY0,
LINE_MAX,
} _LINE_IN_NAME_;
......
......@@ -222,15 +222,15 @@ void EnergyRecovery0_Key_Detect(void)
if ( SYS_OPR_STAT_IGN_ON )
{
Key_SW_EnergyRecovery0 = Get_Line_In_Energy_Recovery0();
if ( Key_SW_EnergyRecovery0 == 0u )
Key_SW_EnergyRecovery0 = Get_LINE_IN_Sts(LINE_IN_ENERGY_RECOVERY0);
if ( Key_SW_EnergyRecovery0 == 1u )
{
if ( Key_SW_EnergyRecovery0_Timer < 255u )
{
Key_SW_EnergyRecovery0_Timer++;
}
if ( Key_SW_EnergyRecovery0_Timer >= 200u ) /*长按判断*/
if ( Key_SW_EnergyRecovery0_Timer >= 150u ) /*长按判断*/
{
Key_EnergyRecovery0 = MMI_KEY_HOLD; /*长按TRIP*/
}
......@@ -239,9 +239,9 @@ void EnergyRecovery0_Key_Detect(void)
Key_EnergyRecovery0 = MMI_KEY_IDLE; /*按键抬起*/
}
}
else if ( Key_SW_EnergyRecovery0 == 1u )
else if ( Key_SW_EnergyRecovery0 == 0u )
{
if ( (Key_SW_EnergyRecovery0_Timer > 50u) && (Key_SW_EnergyRecovery0_Timer < 200u) )
if ( (Key_SW_EnergyRecovery0_Timer > 20u) && (Key_SW_EnergyRecovery0_Timer < 150u) )
{
Key_EnergyRecovery0 = MMI_KEY_PRESS; /*短按TRIP*/
}
......
......@@ -2415,7 +2415,7 @@ void SEG_DISPLAY(void)
{
Frame = 0;
}
if(GEAR > 3)
if(GEAR > 4)
{
GEAR = 0;
}
......
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