Commit 427770e1 authored by 郑萍's avatar 郑萍

🐞 fix:添加或与的括号

parent 5c3b3ca0
......@@ -6,7 +6,7 @@
#define BACK_LIGHT_DAY 200
#define openLED_flag (Get_CAN_Power_State() != PKEY_ON && Get_CAN_Power_State() != KEY_OFF )
#define openLED_flag ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) )
uint8_t interact_PWM_Low_Duty = 0;
void BackLight_Process(void)
......@@ -15,7 +15,7 @@ void BackLight_Process(void)
{
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
//电量
if (Get_EleDial_AllSOC_lenth() == 2 || checkself_seg_Flag == 1)
if ((Get_EleDial_AllSOC_lenth() == 2) || (checkself_seg_Flag == 1))
{
RTE_GPIO_Set_Level(RTE_GPIO_PORT03_PIN00, RTE_GPIO_LEVEL_HIGH);//百位
RTE_GPIO_Set_Level(RTE_GPIO_PORT02_PIN04, RTE_GPIO_LEVEL_HIGH);
......@@ -42,10 +42,10 @@ void BackLight_Process(void)
void BackLight_Clock_All_Process(void)
{
if (openLED_flag && Charge_OFF_Flag == 0)
if (openLED_flag && (Charge_OFF_Flag == 0))
{
//总计时间
if (Get_Clock_All_lenth() == 2|| checkself_seg_Flag == 1)
if ((Get_Clock_All_lenth() == 2)|| (checkself_seg_Flag == 1))
{
RTE_GPIO_Set_Level(RTE_GPIO_PORT01_PIN05, RTE_GPIO_LEVEL_HIGH); //总计工作时长统计千位_MCU_OUT
RTE_GPIO_Set_Level(RTE_GPIO_PORT01_PIN06, RTE_GPIO_LEVEL_HIGH); //总计工作时长统计百十位_MCU_OUT
......@@ -71,7 +71,7 @@ void BackLight_Clock_All_Process(void)
void Interact_Light_Process(void)
{
if (openLED_flag && Charge_OFF_Flag == 0)
if (openLED_flag && (Charge_OFF_Flag == 0))
{
TimerM_PWM_set_duty(TIMERM_COUNTER0, TIMERM_CHD, interact_PWM_Low_Duty * 10);
}
......
......@@ -11,7 +11,7 @@ uint8_t Charge_OFF_Flag = 0;
void Gauge_Power_SOC_pull_Display(void)
{
// 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))
{
uint8_t Current_1_Grid = Get_CAN_Num_MBMS_Soc_1_Grid();
uint8_t Current_2_Grid = Get_CAN_Num_SBMS_Soc_2_Grid();
......@@ -32,7 +32,7 @@ void Gauge_Cutterhead_Gear_Display(void)
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0) && (Get_CAN_Power_State() == READY))
{
if (Signal2 == 0x1 || Signal2 == 0x2 || Signal2 == 0x3 || Signal2 == 0x4)
if ((Signal2 == 0x1) || (Signal2 == 0x2) || (Signal2 == 0x3) || (Signal2 == 0x4))
{
if (FLASH_SYNC_1Hz)
{
......@@ -59,11 +59,11 @@ void Gauge_Gears_Display(void)
uint8_t Signal1 = Get_CAN_Num_MMCU_TravelSpeedGear();
uint8_t Signal2 = Get_CAN_Num_MMCU_ParkingGearState();
// 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))
{
if (Signal2 != 0x1)
{
if (Signal1 == 0x1 || Signal1 == 0x2)
if ((Signal1 == 0x1) || (Signal1 == 0x2))
{
SEG_SET_GEAR(1, Signal1, 0);
}
......@@ -115,7 +115,7 @@ void Gauge_Power_SOC_CHAGING_Display(void)
uint8_t Current_1_Grid = Get_CAN_Num_MBMS_Soc_1_Grid();
uint8_t Current_2_Grid = Get_CAN_Num_SBMS_Soc_2_Grid();
if ((MBMS_TOTALSigAcc == 0x1 && MBMS_TOTALSigCharge == 0x1) || (MBMS_TOTALSigAcc == 0x0 && MBMS_TOTALSigCharge == 0x1)) // 上电充电
if (((MBMS_TOTALSigAcc == 0x1) && (MBMS_TOTALSigCharge == 0x1)) || ((MBMS_TOTALSigAcc == 0x0) && (MBMS_TOTALSigCharge == 0x1))) // 上电充电
{
if (MBMS_StatBattWorkState == 0x1) // 主电池
{
......@@ -191,7 +191,7 @@ void Gauge_Power_SOC_CHAGING_Display(void)
SEG_SET_EleDial_2SOC(1, Current_2_Grid);
}
}
if (MBMS_TOTALSigAcc == 0x0 && MBMS_TOTALSigCharge == 0x1) // 下电充电
if ((MBMS_TOTALSigAcc == 0x0) && (MBMS_TOTALSigCharge == 0x1)) // 下电充电
{
poweroff_time++;
}
......@@ -238,7 +238,7 @@ uint8_t Clockonetime_flag = 0;
void Gauge_Clock_Display(void)
{
uint32_t Clock_all = 0;
if (Common_Get_IG_Sts() == COMMON_POWER_ON && Charge_OFF_Flag == 0)
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0))
{
Clock_all = Get_CAN_Num_MMCU_SingleWorkingHours();
uint8_t Clock_hours = Clock_all / 10;
......@@ -261,7 +261,7 @@ uint16_t EEPROM_Write_Time = 0;
void Data_CumulativeWorkHours_EEPROM_Write(void)
{
uint32_t u32Data[1] = {0};
if (Common_Get_IG_Sts() == COMMON_POWER_ON && Charge_OFF_Flag == 0)
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0))
{
u32Data[0] = Get_CAN_Num_MMCU_AccumulatedWorkHours();
if (++EEPROM_Write_Time > 6000) // 一分钟存一次
......@@ -282,7 +282,7 @@ uint32_t u32Data_read[1] = {0};
void Gauge_Clock_All_Display(void)
{
eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data_read, 4);
if (Common_Get_IG_Sts() == COMMON_POWER_ON && Charge_OFF_Flag == 0)
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0))
{
SEG_SET_Clock_ALL(1, u32Data_read[0]);
}
......@@ -306,7 +306,7 @@ uint8_t Get_Clock_All_lenth(void)
}
void Gauge_Frame_Display(void)
{
if (Common_Get_IG_Sts() == COMMON_POWER_ON && Charge_OFF_Flag == 0)
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0))
{
SEG_SET_Frame(1);
}
......
......@@ -587,7 +587,7 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG)
IC1_SEG121 = IC_SEG_ON;
IC1_SEG122 = IC_SEG_ON;
if (m_SEG == 1 && Common_GetIgnOnTime() >= 3000 && SOC_charge_seg_Flag != 1)
if ((m_SEG == 1) && (Common_GetIgnOnTime() >= 1500) && (SOC_charge_seg_Flag != 1))
{
if (FLASH_SYNC_1Hz)
{
......@@ -679,7 +679,7 @@ _Fun_Res SEG_SET_EleDial_2SOC(uint8_t m_Flag, uint8_t m_SEG)
IC1_SEG133 = IC_SEG_GREY;
IC1_SEG134 = IC_SEG_GREY;
if (m_SEG == 1 && Common_GetIgnOnTime() >= 3000 && SOC_charge_seg_Flag != 1)
if ((m_SEG == 1) && (Common_GetIgnOnTime() >= 1500) && (SOC_charge_seg_Flag != 1))
{
if (FLASH_SYNC_1Hz)
{
......@@ -2197,7 +2197,7 @@ _Fun_Res SEG_SET_Clock_ALL(uint8_t m_Flag, uint32_t m_NUM)
IC2_SEG077 = IC_SEG_ON;
Num = m_NUM / 10000u;
if (m_NUM > 10000 || checkself_seg_Flag == 1)
if ((m_NUM > 10000) || (checkself_seg_Flag == 1))
{
m8 = SEG_DISPLAY_NUMBER0[Num];
}
......@@ -2264,7 +2264,7 @@ _Fun_Res SEG_SET_Clock_ALL(uint8_t m_Flag, uint32_t m_NUM)
}
/*千位*/
Num = (m_NUM / 1000u) % 10u;
if (m_NUM > 1000 || checkself_seg_Flag == 1)
if ((m_NUM > 1000) || (checkself_seg_Flag == 1))
{
m8 = SEG_DISPLAY_NUMBER0[Num];
}
......@@ -2331,7 +2331,7 @@ _Fun_Res SEG_SET_Clock_ALL(uint8_t m_Flag, uint32_t m_NUM)
}
/*百位*/
Num = (m_NUM / 100u) % 10u;
if (m_NUM > 100 || checkself_seg_Flag == 1)
if ((m_NUM > 100) || (checkself_seg_Flag == 1))
{
m8 = SEG_DISPLAY_NUMBER0[Num];
}
......
......@@ -6,7 +6,7 @@
#include "Application.h"
#include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h"
#include "Components.h"
#define openLED_flag (Get_CAN_Power_State() != PKEY_ON && Get_CAN_Power_State() != KEY_OFF && Charge_OFF_Flag == 0)
#define openLED_flag ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Charge_OFF_Flag == 0))
static Tellib_uint16_t LED_EFI_failure_Judgement(void);
static void LED_EFI_failure_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Fuel_Alarm_Judgement(void);
......@@ -254,7 +254,7 @@ static Tellib_uint16_t LED_OVERLOAD_Judgement(void)
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_BMCU_Moto1_Locked_RotorFault();
Tellib_uint8_t Signal2 = Get_CAN_Num_BMCU_Moto2_Locked_RotorFault();
if ((Signal1 == 0x1 || Signal2 == 0x1) && openLED_flag)
if (((Signal1 == 0x1) || (Signal2 == 0x1)) && openLED_flag)
{
LED_STATE = 1;
}
......@@ -308,7 +308,7 @@ static Tellib_uint16_t LED_Seat_Detection_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_SeatDetectState();
if (Signal1 == 0x1 && openLED_flag)
if ((Signal1 == 0x1) && openLED_flag)
{
LED_STATE = 1;
}
......@@ -344,7 +344,7 @@ static Tellib_uint16_t LED_Key_Access_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_TOTALSigAcc();
if (Signal1 == 0x1 && openLED_flag)
if ((Signal1 == 0x1) && openLED_flag)
{
LED_STATE = 1;
}
......@@ -373,11 +373,11 @@ static Tellib_uint16_t LED_Battery_Charging_Judgement(void)
Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_TOTALSigAcc();
Tellib_uint8_t Signal2 = Get_CAN_Num_MBMS_TOTALSigCharge();
Tellib_uint8_t Signal3 = Get_CAN_Power_State();
if( (Get_CAN_Power_State() != PKEY_ON && Get_CAN_Power_State() != KEY_OFF && Charge_OFF_Flag != 2))
if((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF))
{
if ((Signal1 == 0x1 || Signal1 == 0x0 ) && Signal2 == 0X1)
if (((Signal1 == 0x1) || (Signal1 == 0x0) ) && (Signal2 == 0X1))
{
if(Signal3 == CHRG_PLUGIN || Signal3 == CHRGEND)
if((Signal3 == CHRG_PLUGIN) || (Signal3 == CHRGEND))
{
LED_STATE = 2;
}
......@@ -450,7 +450,7 @@ static Tellib_uint16_t LED_Cutterhead_Switch_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_BMCU_PTOSwicthState();
if (Signal1 == 0x1 && openLED_flag && (Get_CAN_Power_State() == READY))
if ((Signal1 == 0x1) && openLED_flag && ((Get_CAN_Power_State() == READY)))
{
LED_STATE = 1;
}
......@@ -478,9 +478,9 @@ static Tellib_uint16_t LED_GEAR_Judgement(void)
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_TravelSpeedGear();
Tellib_uint8_t Signal2 = Get_CAN_Num_MMCU_ParkingGearState();
if(Signal2 != 0x1 && Charge_OFF_Flag == 0)
if((Signal2 != 0x1) && (Charge_OFF_Flag == 0))
{
if (Signal1 == 0x1 || Signal1 == 0x2)
if ((Signal1 == 0x1) || (Signal1 == 0x2))
{
LED_STATE = 1;
}
......@@ -695,9 +695,9 @@ static Tellib_uint16_t LED_Gears_Judgement(void)
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_TravelSpeedGear();
Tellib_uint8_t Signal2 = Get_CAN_Num_MMCU_ParkingGearState();
if(Signal2 != 0x1 && openLED_flag)
if((Signal2 != 0x1 ) && openLED_flag)
{
if (Signal1 == 0x1 || Signal1 == 0x2)
if ((Signal1 == 0x1) || (Signal1 == 0x2))
{
LED_STATE = 1;
}
......@@ -730,9 +730,9 @@ static Tellib_uint16_t LED_Cutterhead_Gear_Judgement(void)
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_BMCU_BladeSpeedGear();
Tellib_uint8_t Signal2 = Get_CAN_Num_BMCU_ErrorGrage();
if((Signal2 == 0x1 || Signal2 == 0x2 || Signal2 == 0x3 || Signal2 == 0x4) && openLED_flag && (Get_CAN_Power_State() == READY))
if(((Signal2 == 0x1) || (Signal2 == 0x2 )|| (Signal2 == 0x3) || (Signal2 == 0x4)) && openLED_flag && (Get_CAN_Power_State() == READY))
{
if(Signal1 == 0x1 || Signal1 == 0x2 || Signal1 == 0x3)
if((Signal1 == 0x1) || (Signal1 == 0x2) || (Signal1 == 0x3))
{
LED_STATE = 2;
}
......@@ -741,9 +741,9 @@ static Tellib_uint16_t LED_Cutterhead_Gear_Judgement(void)
LED_STATE = 0;
}
}
else if (Signal2 == 0x0 && openLED_flag && (Get_CAN_Power_State() == READY))
else if ((Signal2 == 0x0) && openLED_flag && (Get_CAN_Power_State() == READY))
{
if(Signal1 == 0x1 || Signal1 == 0x2 || Signal1 == 0x3)
if((Signal1 == 0x1) || (Signal1 == 0x2) || (Signal1 == 0x3))
{
LED_STATE = 1;
}
......@@ -781,7 +781,7 @@ static void LED_Cutterhead_Gear_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_Working_Hours_One_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if (Get_Clockonetime_lenth() == 1 && openLED_flag)
if ((Get_Clockonetime_lenth() == 1) && openLED_flag)
{
LED_STATE = 1;
}
......@@ -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 Signal2 = Get_CAN_Num_SMCU_ErrorGrage();
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)) && openLED_flag)
{
LED_STATE = 1;
......@@ -864,11 +864,11 @@ static Tellib_uint16_t LED_P_GEAR_G_Judgement(void)
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_ParkingGearState();
Tellib_uint8_t Signal2 = Get_CAN_Power_State();
if ( Signal1 == 0x1 && openLED_flag && checkself_seg_Flag == 0)
if ( (Signal1 == 0x1) && openLED_flag && (checkself_seg_Flag == 0))
{
LED_STATE = 1;
}
else if(Signal2 == PKEY_ON && checkself_seg_Flag == 0)
else if((Signal2 == PKEY_ON )&& (checkself_seg_Flag == 0))
{
LED_STATE = 2;
}
......@@ -932,7 +932,7 @@ static Tellib_uint16_t LED_Charging_Connection_R_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_StatBattChargeState();
if ((Signal1 == 0x1 || Signal1 == 0x2 ||Signal1 == 0x3) && (Get_CAN_Power_State() != PKEY_ON && Get_CAN_Power_State() != KEY_OFF))
if (((Signal1 == 0x1) || (Signal1 == 0x2) ||(Signal1 == 0x3)) && ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF)))
{
LED_STATE = 1;
}
......@@ -960,7 +960,7 @@ static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
// Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_StatBattChargeState();
// if (Signal1 == 0x1 || Signal1 == 0x2 ||Signal1 == 0x3)
// if ((Signal1 == 0x1) || (Signal1 == 0x2) ||(Signal1 == 0x3))
// {
// LED_STATE = 1;
// }
......@@ -972,14 +972,14 @@ static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void)
}
static void LED_Power_Battery_Failure_R_Execution(Tellib_uint16_t led_status)
{
if ( led_status == 1u && openLED_flag)
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_ON);
SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,0);
}
// if ( (led_status == 1u ) && openLED_flag)
// {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_ON);
// SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,1);
// }
// else
// {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_OFF);
// SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,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