Commit 936978e1 authored by 李俭双's avatar 李俭双

Merge branch 'lijianshuang' into 'dev'

Lijianshuang

See merge request !21
parents d11a8701 4247e53f
......@@ -9,9 +9,9 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] =
{
{0x220ul, 50ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_220, (void *)0},
{0x6EEul, 8ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EE, (void *)0},
{0x6EFul, 8ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EF, (void *)0},
{0x450ul, 8ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_450, (void *)0},
{0x6EEul, 100ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EE, (void *)0},
{0x6EFul, 100ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_6EF, (void *)0},
{0x450ul, 100ul * 1000ul, 7ul * 1000ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_450, (void *)0},
};
const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
......@@ -20,7 +20,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
5000ul,
1000ul,
0x402ul,
(( void * )0),
(( void * )0),
......
......@@ -22,7 +22,8 @@ void Can_Set_Buff_6EE(canlib_uint8_t CopyData[])
{
CANMsg6EEUnion *p6EE;
uint8_t i = 0;
uint16_t Vspeed_tx = 0;
uint16_t Vspeed_tx = 0;
uint32_t ODO_tx = Data_ODO_Read() / 10;
Vspeed_tx = Get_DispVechileSpeed_TX()/10;
p6EE = (CANMsg6EEUnion *)CopyData;
......@@ -35,7 +36,9 @@ void Can_Set_Buff_6EE(canlib_uint8_t CopyData[])
}
p6EE -> Sig.Vsppe_H3_TX = (Vspeed_tx >> 8) & 0x7u ;
p6EE -> Sig.Vsppe_L8_TX = Vspeed_tx & 0xFF ;
p6EE -> Sig.ODO_TX = Data_ODO_Read();
p6EE -> Sig.ODO_TX_H = (ODO_tx >> 16) & 0xFF ;
p6EE -> Sig.ODO_TX_M = (ODO_tx >> 8) & 0xFF ;
p6EE -> Sig.ODO_TX_L = ODO_tx & 0xFF ;
p6EE -> Sig.Uint_TX = Get_Dis_KM_Unit() ;
p6EE -> Sig.Coolant_Seg_TX = GET_DataCoolantTempSegDisp() ;
if (GET_DataCollantTempWarnflg() == 2)
......@@ -63,7 +66,9 @@ void Can_Set_Buff_6EF(canlib_uint8_t CopyData[])
CANMsg6EFUnion *p6EF;
uint8_t i = 0;
uint16_t Espeed_tx = 0;
uint16_t TripA_tx = 0;
Espeed_tx = Get_DispEngineSpeed()/100;
TripA_tx = Data_Read_Trip(EM_TRIP_A);
p6EF = (CANMsg6EFUnion *)CopyData;
if ( p6EF != ( void * )0 )
{
......@@ -73,7 +78,8 @@ void Can_Set_Buff_6EF(canlib_uint8_t CopyData[])
}
}
p6EF -> Sig.Espeed_TX = Espeed_tx;
p6EF -> Sig.TripA = Data_Read_Trip(EM_TRIP_A);
p6EF -> Sig.TripA_H = (TripA_tx >> 8) & 0xFF;
p6EF -> Sig.TripA_L = TripA_tx & 0xFF;
p6EF -> Sig.Coolant_TX = GET_DataCoolantTempValueDisp() + 40;
}
void Can_Set_Buff_450(canlib_uint8_t CopyData[])
......
......@@ -41,7 +41,9 @@ typedef union
uint32_t Vsppe_L8_TX : 8;
uint32_t ODO_TX : 24;
uint32_t ODO_TX_H : 8;
uint32_t ODO_TX_M : 8;
uint32_t ODO_TX_L : 8;
} Sig;
} CANMsg6EEUnion;
......@@ -55,7 +57,8 @@ typedef union
uint32_t Coolant_TX : 8;
uint32_t TripA : 16;
uint32_t TripA_H : 8;
uint32_t TripA_L : 8;
uint32_t TripB : 16;
......
......@@ -41,6 +41,7 @@ void Data_TPMS_Processing_Service ( void )
TPMS.Front_Press_Value = 99;
TPMS.Rear_Press_Value = Rear_TPMS * 275;
TPMS.Rear_Press_Value /= 10 ;
TPMS.Rear_Press_Value /= 102 ;
if(TPMS.Rear_Press_Value > 99)
{
TPMS.Rear_Press_Value = 99;
......@@ -61,6 +62,7 @@ void Data_TPMS_Processing_Service ( void )
TPMS.Rear_Press_Value = 99;
TPMS.Front_Press_Value = Front_TPMS *275 ;
TPMS.Front_Press_Value /= 10 ;
TPMS.Front_Press_Value /= 102 ;
if(TPMS.Front_Press_Value > 99)
{
TPMS.Front_Press_Value = 99;
......@@ -89,6 +91,7 @@ void Data_TPMS_Processing_Service ( void )
TPMS.Rear_TPMS_Valid = 1;
TPMS.Front_Press_Value = Front_TPMS * 275 ;
TPMS.Front_Press_Value /= 10 ;
TPMS.Front_Press_Value /= 102 ;
if(TPMS.Front_Press_Value > 99)
{
TPMS.Front_Press_Value = 99;
......@@ -96,6 +99,7 @@ void Data_TPMS_Processing_Service ( void )
TPMS.Rear_Press_Value = Rear_TPMS * 275;
TPMS.Rear_Press_Value /= 10 ;
TPMS.Rear_Press_Value /= 102 ;
if(TPMS.Rear_Press_Value > 99)
{
TPMS.Rear_Press_Value = 99;
......
......@@ -4,8 +4,8 @@
#include "common.h"
typedef struct
{
uint16_t Front_Press_Value;
uint16_t Rear_Press_Value;
uint32_t Front_Press_Value;
uint32_t Rear_Press_Value;
uint8_t Front_TPMS_Valid;
uint8_t Rear_TPMS_Valid;
uint8_t TPMS_Warning;
......
......@@ -290,9 +290,9 @@ void Data_Vehicle_Speed_Processing_Service(void)
if ( DataVSpeedValid )
{
VSpeedCal *= 107;
VSpeedCal *= 108;
VSpeedCal /= 100;
VSpeedCal = VSpeedCal + 10;
if(VSpeedCal > 1990)
{
VSpeedCal = 1990;
......
......@@ -82,10 +82,10 @@ void Fuel_R_Cal(uint8_t deltaTime)
/*四舍五入*/
//if (FuelRes < 32000)
//{
if (FuelRes % 10 >= 5)
{
FuelRes += 5;
}
//if (FuelRes % 10 >= 5)
//{
// FuelRes += 5;
//}
//}
//else
//{
......
......@@ -875,6 +875,23 @@ void SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM, uint8_t m_Unit)
if (m_Flag == 1)
{
if (m_NUM > 99)
{
RTE_GPIO_Set_Level(VSpeed_Tens, 1);
RTE_GPIO_Set_Level(VSpeed_Hundreds, 1);
}
else if (m_NUM > 9)
{
RTE_GPIO_Set_Level(VSpeed_Tens, 1);
RTE_GPIO_Set_Level(VSpeed_Hundreds, 0);
}
else
{
RTE_GPIO_Set_Level(VSpeed_Tens, 0);
RTE_GPIO_Set_Level(VSpeed_Hundreds, 0);
}
if ((ClearODO_Flag != 1) && (Common_GetIgnOnTime() >= 3000))
{
if (Get_Current_PageType() == Page_Km_Unit)
......@@ -1672,6 +1689,8 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
uint32_t Num;
uint8_t m8;
RTE_GPIO_Set_Level(ODO_TenThousand, 1);
RTE_GPIO_Set_Level(ODO_Thousand, 1);
if ((ClearODO_Flag != 1) && (Common_GetIgnOnTime() >= 3000))
{
if (Get_Current_PageType() == Page_Km_Unit)
......@@ -1689,7 +1708,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
}
else
{
if((Get_Current_PageType() == Page_Odo) || (Get_Current_PageType() == Page_Trip))
if((Get_Current_PageMenu() == Page_Odo) || (Get_Current_PageMenu() == Page_Trip))
{
if (m_Uint == 0)
{
......@@ -1702,7 +1721,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG037 = IC_SEG_OFF;
}
if(Get_Current_PageType() == Page_Odo)
if(Get_Current_PageMenu() == Page_Odo)
{
IC1_SEG072 = IC_SEG_ON;
IC1_SEG045 = IC_SEG_OFF;
......@@ -1710,7 +1729,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
LED_Driver_Channel_Set(LampChannel_0, LampCh0_35_ODO, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_34_TRIP, LED_OFF);
}
else if (Get_Current_PageType() == Page_Trip)
else if (Get_Current_PageMenu() == Page_Trip)
{
IC1_SEG072 = IC_SEG_OFF;
IC1_SEG045 = IC_SEG_ON;
......@@ -1748,7 +1767,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
LED_Driver_Channel_Set(LampChannel_0, LampCh0_34_TRIP, LED_ON);
}
if((Get_Current_PageType() == Page_Odo) || (ClearODO_Flag == 1) || (Common_GetIgnOnTime() < 3000))
if((Get_Current_PageMenu() == Page_Odo) || (ClearODO_Flag == 1) || (Common_GetIgnOnTime() < 3000))
{
if(m_NUM_ODO > 99999)
{
......@@ -2078,7 +2097,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG040 = IC_SEG_OFF;
}
}
else if (Get_Current_PageType() == Page_Trip)
else if (Get_Current_PageMenu() == Page_Trip)
{
IC1_SEG076 = IC_SEG_OFF;
IC1_SEG071 = IC_SEG_OFF;
......@@ -2214,14 +2233,14 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG055 = IC_SEG_OFF;
}
Num = (m_NUM_TRIP / 10) % 10;
if ((m_NUM_TRIP >= 100) || (m_NUM_TRIP == 0))
{
//if ((m_NUM_TRIP >= 100) || (m_NUM_TRIP == 0))
//{
m8 = SEG_DISPLAY_NUMBER0[Num];
}
else
{
m8 = SEG_UNDISPLAY_NUMBER0[Num];
}
//}
//else
//{
// m8 = SEG_UNDISPLAY_NUMBER0[Num];
//}
if (Bit_Is_Set(m8, 0))
{
IC1_SEG050 = IC_SEG_ON;
......@@ -2338,7 +2357,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
IC1_SEG040 = IC_SEG_OFF;
}
}
else if (Get_Current_PageType() == Page_DTC)
else if (Get_Current_PageMenu() == Page_DTC)
{
IC1_SEG076 = IC_SEG_OFF;
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x402_Msg_Count) == CAN_SIG_LOST)
......@@ -2396,7 +2415,7 @@ void SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(uint8_t m_Uint, uint32_t m_NUM_ODO, uint
}
}
}
else if (Get_Current_PageType() == Page_TCS)
else if (Get_Current_PageMenu() == Page_TCS)
{
IC1_SEG076 = IC_SEG_OFF;
......@@ -2804,6 +2823,7 @@ void Check_SEG_Display(void)
SEG_SET_ODO_TRIP_FAULTCODE_TCS_DIS(1, ((a * 11111) + 100000), 0);
SEG_SET_VSpeed_NUM(1u, (100u + (a * 10u) + a), 0);
SEG_SET_Clock(((a * 10u) + a), ((a * 10u) + a), 1u, 1u, 1u);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Screen_Time, LED_ON);
SEG_SET_TPMS_NUM(1, a * 11, a * 11, 0, 1, 1);
SEG_SET_Voltage_NUM(1, a * 111);
......@@ -2865,6 +2885,7 @@ void Checkself_SEG_Display(void)
hour = (Checkself_SEG_step / 3) * 11;
min = (Checkself_SEG_step / 3) * 11;
SEG_SET_Clock(hour, min, 1, 1, 1);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Screen_Time, LED_ON);
TPMS = (Checkself_SEG_step / 3) * 11;
SEG_SET_TPMS_NUM(1, TPMS, TPMS, 0, 1, 1);
......@@ -2881,7 +2902,7 @@ void Checkself_SEG_Display(void)
Checkself_SEG_step_count = 60;
}
if (Checkself_SEG_step_count <= 30)
if (Checkself_SEG_step_count <= 29)
{
Checkself_SEG_step++;
}
......
......@@ -90,7 +90,7 @@ const ADC_Res_List_st_t stADCResList[ADC_SIGNAL_CH_NUMBER] =
{ 3300000U, 1000000U, 0U, 0U,},
{ 3300000U, 1000000U, 0U, 0U,},
{ 0U, 0U, 0U, 0U,},
{ 0U, 0U, 670U, 300U,},
{ 0U, 0U, 2000U, 300U,},
};
/* Private function prototypes ----------------------------------------------*/
......
......@@ -8,6 +8,7 @@ __align(4)
_Menu_Infor MenuInfor;
_Menu_Data MenuData;
uint8_t PageType = 0;
uint8_t PageMenu = 0;
RTC_TimeTypeDef RTC_TimeStruct;
RTC_DateTypeDef RTC_DateStruct;
......@@ -31,6 +32,24 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//Mode
break;
case KEY_EVENT_LONG_PRESS_4: //10s
Maintain_Reset_Service();
if((PageMenu == Page_TCS) && (PageType == Page_Menu))
{
if(Get_Dis_Tcs_Val() == 0)
{
MenuData.Tcs_Val = 1;//on
}
else
{
MenuData.Tcs_Val = 0;//off
}
}
if((PageMenu == Page_Trip) && (PageType == Page_Menu))
{
Data_Clear_Trip_All();
}
TYW_RESET_ODO();
break;
case KEY_EVENT_OFF_TO_ON:
......@@ -132,9 +151,9 @@ void Key_KL30_Init_EXample(void)
Key_Parameter_Set_Short_Press_1_Time(50U,1000U);
Key_Parameter_Set_Short_Press_2_Time(3000U,9000U);
//Key_Parameter_Set_Long_Press_1_Time(7000U);
//Key_Parameter_Set_Long_Press_2_Time(8000U);
//Key_Parameter_Set_Long_Press_3_Time(9000U);
Key_Parameter_Set_Long_Press_1_Time(9100U);
Key_Parameter_Set_Long_Press_2_Time(9200U);
Key_Parameter_Set_Long_Press_3_Time(9300U);
Key_Parameter_Set_Long_Press_4_Time(10000U);
}
void Key_Wakeup_Init_EXample(void)
......@@ -158,7 +177,7 @@ void Key_Wakeup_Init_EXample(void)
void KEY_LEFT_EVENT_NONE_Service(void)
{
MenuInfor.Back_Time_Left++;
if((MenuInfor.Back_Time_Left > BACK_MENU_TIME) &&(PageType != Page_DTC))
if((MenuInfor.Back_Time_Left > BACK_MENU_TIME) &&(PageType != Page_Menu))
{
MenuInfor.Back_Time_Left = BACK_MENU_TIME;
MenuInfor.Back_Time_Left_Flag = 1;
......@@ -188,22 +207,26 @@ void Key_Left_Short_Press(void)
uint8_t datmin = 0u;
if(PageType == Page_Odo)
if(PageType == Page_Menu)
{
PageType = Page_Trip;
}
else if(PageType == Page_Trip)
{
PageType = Page_DTC;
}
else if(PageType == Page_DTC)
{
PageType = Page_TCS;
}
else if(PageType == Page_TCS)
{
PageType = Page_Odo;
if(PageMenu == Page_Odo)
{
PageMenu = Page_Trip;
}
else if(PageMenu == Page_Trip)
{
PageMenu = Page_DTC;
}
else if(PageMenu == Page_DTC)
{
PageMenu = Page_TCS;
}
else if(PageMenu == Page_TCS)
{
PageMenu = Page_Odo;
}
}
if(PageType == Page_Time_Hour)
{
......@@ -262,14 +285,14 @@ void Key_Auto_Save(void)
{
RTC_SetTime(&counter_val.time);
}
PageType = Page_Odo;
PageType = Page_Menu ;
}
}
void Key_Left_Long_Press(void)
{
if(PageType == Page_Odo)
if((PageType == Page_Menu) )
{
PageType = Page_Time_Hour;
}
......@@ -287,29 +310,14 @@ void Key_Left_Long_Press(void)
}
else if(PageType == Page_Tpms_Unit)
{
PageType = Page_Odo;
PageType = Page_Menu;
}
else
{
;
}
if(PageType == Page_TCS)
{
if(Get_Dis_Tcs_Val() == 0)
{
MenuData.Tcs_Val = 1;//on
}
else
{
MenuData.Tcs_Val = 0;//off
}
}
if(PageType == Page_Trip)
{
Data_Clear_Trip_All();
}
}
......@@ -397,7 +405,7 @@ void TYW_RESET_ODO(void)
void Maintain_Reset_Service(void)
{
if(Get_Data_Maintenace_Interval_Processing() == 0)
if((Get_Data_Maintenace_Interval_Processing() == 0) && (PageMenu == Page_TCS) && (PageType == Page_Menu))
{
Data_Maintenance_Interval_Reset();
}
......@@ -417,6 +425,10 @@ uint8_t Get_Current_PageType(void)
{
return PageType;
}
uint8_t Get_Current_PageMenu(void)
{
return PageMenu;
}
uint8_t Get_Dis_KM_Unit(void)
{
......
......@@ -24,18 +24,24 @@ typedef struct
typedef enum
{
Page_Odo = 0,
Page_Menu = 0,
Page_Time_Hour,
Page_Time_Minute,
Page_Km_Unit,
Page_Tpms_Unit,
Page_Max,
}_Page_Type;
typedef enum
{
Page_Odo = 0,
Page_Trip,
Page_DTC,
Page_TCS,
Page_Max,
}_Page_Type;
Page_Menu_Max,
}_Page_Menu_Type;
extern uint8_t PageType;
......@@ -56,6 +62,7 @@ void Key_Auto_Save(void);
uint8_t Get_Dis_Hour_Time(void);
uint8_t Get_Dis_Minute_Time(void);
uint8_t Get_Current_PageType(void);
uint8_t Get_Current_PageMenu(void);
void TYW_RESET_ODO(void);
uint8_t Get_Dis_KM_Unit(void);
uint8_t Get_Dis_Tpms_Unit(void);
......
......@@ -8,10 +8,10 @@ const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_TurnLeft, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 20U, 20U, Get_LINE_IN_TurnRight, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 60U, 20U, Get_LINE_IN_HighBeam, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 40U, 20U, Get_LINE_IN_HighBeam, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_FAULT_ELECTROSPRAY, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Fault_ABS, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Oil_Pressure, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 500U, 20U, Get_LINE_IN_Oil_Pressure, },
{LEVEL_HIGH, LEVEL_LOW, LINE_IN_IG_ON, 100U, 20U, Get_LINE_IN_Auto_Start_Stop, },
};
......
......@@ -48,6 +48,7 @@ static void Power_KL30_Init(void)
Gpio_Init(Gpio_KL30_Init);
eeprom_StoreInfo_Init();
Can_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
DFlash_init();
Analog_Signal_Conv_Init();
BU98R10_Init();
......@@ -95,6 +96,7 @@ static void Power_Wakeup_Init(void)
Simulated_IIC_2_Init();
Gpio_Init(Gpio_WakeUp_Init);
Can_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
eeprom_StoreInfo_Init();
Analog_Signal_Conv_Init();
Data_User_Mileage_WakeupInit();
......@@ -137,6 +139,7 @@ static void Power_IG_OFF_Init(void)
{
Line_In_KL15_OFF_Init();
Checkself_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Disable);
}
static void Power_IG_ON_Init(void)
......@@ -150,6 +153,7 @@ static void Power_IG_ON_Init(void)
Data_Voltage_Init();
MenuData_TCS_Init();
Data_Coolant_Temp_KL15_Init();
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
}
static void Power_Sleep_Init(void)
......
......@@ -4,15 +4,15 @@
#include "delay.h"
#define u16Base_Vol 0u
#define u16ENTER_LOW_N_RANGE 7000U
#define u16EXIT_LOW_N_RANGE 8000U
#define u16ENTER_LOW_N_RANGE 6500U
#define u16EXIT_LOW_N_RANGE 7000U
#define u16ENTER_LOW_Y_RANGE 9000U
#define u16EXIT_LOW_Y_RANGE 10000U
#define u16EXIT_HIGH_Y_RANGE 15000U
#define u16ENTER_HIGH_Y_RANGE 16000U
#define u16EXIT_HIGH_N_RANGE 18000U
#define u16ENTER_HIGH_N_RANGE 19000U
#define u16EXIT_HIGH_Y_RANGE 60000U
#define u16ENTER_HIGH_Y_RANGE 60000U
#define u16EXIT_HIGH_N_RANGE 60000U
#define u16ENTER_HIGH_N_RANGE 60000U
#define u16Top_Vol 0xffffu
......
......@@ -159,14 +159,22 @@ static void LED_FAULT_ELECTROSPRAY_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_ABS_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if (Line_In_Get_Status(LINE_IN_Fault_ABS))
if((CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x120_Msg_Count) == CAN_SIG_LOST) )
{
LED_STATE = 0;
LED_STATE = 1;
}
else
{
LED_STATE = 1;
if (Line_In_Get_Status(LINE_IN_Fault_ABS))
{
LED_STATE = 0;
}
else
{
LED_STATE = 1;
}
}
return LED_STATE;
}
static void LED_ABS_Execution(Tellib_uint16_t led_status)
......@@ -284,7 +292,7 @@ static Tellib_uint16_t LED_Coolant_Judgement(void)
}
else
{
LED_STATE = 0;
LED_STATE = 1;
}
return LED_STATE;
}
......@@ -318,7 +326,7 @@ static void LED_Coolant_Execution(Tellib_uint16_t led_status)
SEG_SET_LED_STS(em_SEG_Coolant, 0);
}
}
else if ( led_status == 0u )
else if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_13_Temp_AlarmW, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Temp_AlarmR, LED_OFF);
......@@ -361,14 +369,15 @@ static void LED_Bluetooth_Execution(Tellib_uint16_t led_status)
static Tellib_uint16_t LED_TCS_Judgement(void)
{
Tellib_uint16_t LED_STATE = 0u;
if((CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x120_Msg_Count) == CAN_SIG_LOST) )
if (Get_Dis_Tcs_Val() == 1)
{
LED_STATE = 1;
}
else
{
if (Get_Dis_Tcs_Val() == 1)
if((CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x120_Msg_Count) == CAN_SIG_LOST) )
{
LED_STATE = 1;
}
else
{
if((Get_CAN_CH0_ID_120_Sig_TCSStatus() == 1) || (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 2) || (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 3) || (Get_CAN_CH0_ID_120_Sig_TCSStatus() == 5))
{
LED_STATE = 1;
......@@ -385,12 +394,14 @@ static Tellib_uint16_t LED_TCS_Judgement(void)
{
LED_STATE = 0;
}
}
else
{
LED_STATE = 0;
}
}
else
{
LED_STATE = 0;
}
return LED_STATE;
}
......
......@@ -51,7 +51,7 @@ static uint32_t UART_GetSysClock(void)
{
if (USE_HSE_SYSTYEM_CLOCK == SYSTYEM_CLOCK_OPEN)
{
return 8000000;
return 64000000;
}
else
{
......
......@@ -16,7 +16,7 @@ void RTE_CLOCK_Select_Start(void)
CGC_PLL_Setting(PLL_SR_fMX,PLL_DIV_2,PLL_MUL_16);
CGC_PLL_CFG_AS_FCLK();
delay_init(64000000);
// SystemCoreClock = 64000000UL;
SystemCoreClock = 64000000UL;
#endif
#ifdef USED_FHOCO_FCLK
......
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