Commit 169bc477 authored by 李俭双's avatar 李俭双

Merge branch 'lijianshuang' into 'dev'

🐞 fix:暂传胎压相关模块,还未调试

See merge request !28
parents a52b9273 035d6434
......@@ -18,7 +18,7 @@ User definitions
typedef unsigned short MD_STATUS;
#define HAS_BOOTLOADER (0u) // 仅仿真App时设置为0
#define HAS_BOOTLOADER (1u) // 仅仿真App时设置为0
#define APP_BASE (0x00008000ul)
/* Status list definition */
......
......@@ -275,7 +275,7 @@
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<StartAddress>0x8000</StartAddress>
<Size>0x40000</Size>
</OCR_RVCT4>
<OCR_RVCT5>
......
SET PATH=C:\Keil_v5\ARM\ARMCC\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\tyw05\AppData\Local\Microsoft\WindowsApps;
SET ARMCC5_ASMOPT=--diag_suppress=9931
SET ARMCC5_CCOPT=--diag_suppress=9931
SET ARMCC5_LINKOPT=--diag_suppress=9931
SET CPU_TYPE=BAT32G139GK64FB
SET CPU_VENDOR=Cmsemicon
SET UV2_TARGET=TianYing200
......
......@@ -5,7 +5,7 @@
#define TY200_080000b 0
#define TY200_080000b_ty 1
#define IC_Current TY200_080000b_ty //选择当前程序为哪个零件号的仪表
#define IC_Current TY200_080000b //选择当前程序为哪个零件号的仪表
/*COMMON INTERFACE*/
typedef enum
......
......@@ -5,21 +5,48 @@ _TPMS_Display TPMS;
void Data_TPMS_KL30_Init ( void )
{
uint32_t TPMS_L[2] = {0,0};
Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, TPMS_L, 2u);
MenuData.TPMS_Front_Learn = TPMS_L[0];
MenuData.TPMS_Rear_Learn = TPMS_L[1];
TPMS.Front_Press_Value = 0;
TPMS.Rear_Press_Value = 0;
TPMS.Front_TPMS_Valid = 0;
TPMS.Rear_TPMS_Valid = 0;
TPMS.TPMS_Warning = 0;
TPMS.TPMS_Unit = Get_Dis_Tpms_Unit();
TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
}
void Data_TPMS_KL15_WAKE_UP_Init ( void )
{
uint32_t TPMS_L[2] = {0,0};
Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, TPMS_L, 2u);
MenuData.TPMS_Front_Learn = TPMS_L[0];
MenuData.TPMS_Rear_Learn = TPMS_L[1];
TPMS.TPMS_Front_Learn = MenuData.TPMS_Front_Learn;
TPMS.TPMS_Rear_Learn = MenuData.TPMS_Rear_Learn;
}
void Data_TPMS_Processing_Service ( void )
{
uint16_t Front_TPMS = 0;
uint16_t Rear_TPMS = 0;
uint32_t TPMS_L[2] = {0,0};
TPMS.TPMS_Front_Learn = Get_CAN_CH0_ID_341_Sig_Front_LearningStatus();
TPMS.TPMS_Rear_Learn = Get_CAN_CH0_ID_341_Sig_Rear_LearningStatus();
if((TPMS.TPMS_Front_Learn != MenuData.TPMS_Front_Learn) || (TPMS.TPMS_Rear_Learn != MenuData.TPMS_Rear_Learn))
{
TPMS_L[0] = TPMS.TPMS_Front_Learn;
TPMS_L[1] = TPMS.TPMS_Rear_Learn;
Data_User_EEPROM_Write(EM_MenuData_TPMS_LEARN, TPMS_L, 2u);
MenuData.TPMS_Front_Learn = TPMS.TPMS_Front_Learn;
MenuData.TPMS_Rear_Learn = TPMS.TPMS_Rear_Learn;
}
TPMS.TPMS_Unit = Get_Dis_Tpms_Unit();
Front_TPMS = Get_CAN_CH0_ID_341_Sig_Front_Pressure();
Rear_TPMS = Get_CAN_CH0_ID_341_Sig_Rear_Pressure();
if ( Common_Get_IG_Sts() == COMMON_POWER_ON )
{
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x341_Msg_Count) == CAN_SIG_LOST)
......@@ -37,7 +64,7 @@ void Data_TPMS_Processing_Service ( void )
if((Front_TPMS == 0xFF) && (Rear_TPMS != 0xFF))
{
TPMS.Front_TPMS_Valid = 0;
TPMS.Rear_TPMS_Valid = 1;
TPMS.Rear_TPMS_Valid = 2;
TPMS.Front_Press_Value = 990;
TPMS.Rear_Press_Value = Rear_TPMS * 275;
TPMS.Rear_Press_Value /= 102 ;
......@@ -56,7 +83,7 @@ void Data_TPMS_Processing_Service ( void )
}
else if ((Front_TPMS != 0xFF) && (Rear_TPMS == 0xFF))
{
TPMS.Front_TPMS_Valid = 1;
TPMS.Front_TPMS_Valid = 2;
TPMS.Rear_TPMS_Valid = 0;
TPMS.Rear_Press_Value = 990;
TPMS.Front_Press_Value = Front_TPMS *275 ;
......@@ -85,8 +112,8 @@ void Data_TPMS_Processing_Service ( void )
}
else
{
TPMS.Front_TPMS_Valid = 1;
TPMS.Rear_TPMS_Valid = 1;
TPMS.Front_TPMS_Valid = 2;
TPMS.Rear_TPMS_Valid = 2;
TPMS.Front_Press_Value = Front_TPMS * 275 ;
TPMS.Front_Press_Value /= 102 ;
if(TPMS.Front_Press_Value > 990)
......@@ -111,6 +138,55 @@ void Data_TPMS_Processing_Service ( void )
}
}
if(MenuData.TPMS_Front_Learn == Unstudied)
{
TPMS.Front_TPMS_Valid = Unstudied;
}
else if(MenuData.TPMS_Front_Learn == Learning)
{
TPMS.Front_TPMS_Valid = Learning;
}
else if(MenuData.TPMS_Front_Learn == LearningCompletion)
{
TPMS.Front_TPMS_Valid = LearningCompletion;
TPMS.Rear_Press_Value = 990;
}
else if(MenuData.TPMS_Front_Learn == LearningFailure)
{
TPMS.Front_TPMS_Valid = LearningFailure;
}
else
{
;
}
if(MenuData.TPMS_Rear_Learn == Unstudied)
{
TPMS.Rear_TPMS_Valid = Unstudied;
}
else if(MenuData.TPMS_Rear_Learn == Learning)
{
TPMS.Rear_TPMS_Valid = Learning;
}
else if(MenuData.TPMS_Rear_Learn == LearningCompletion)
{
TPMS.Rear_TPMS_Valid = LearningCompletion;
TPMS.Front_Press_Value = 990;
}
else if(MenuData.TPMS_Rear_Learn == LearningFailure)
{
TPMS.Rear_TPMS_Valid = LearningFailure;
}
else
{
;
}
if ((MenuData.TPMS_Rear_Learn != LearningCompletion) && (MenuData.TPMS_Front_Learn != LearningCompletion))
{
TPMS.TPMS_Warning = 0;
}
}
else
{
......@@ -132,10 +208,14 @@ uint32_t Data_Bar_To_Psi (uint32_t bar)
// bar += 5;
return Bar;
}
/*指示灯报警信号 0:白色常亮 1:黄色常亮*/
uint8_t Get_Led_TPMS_Waring (void)
{
return TPMS.TPMS_Warning;
}
/*0:未学习,无效,常显-- 1:学习中,无效,闪烁-- 2:学习完成,有效,按实际胎压数值显示 3:学习失败,无效,最大值闪烁显示*/
uint8_t Get_Front_TPMS_Sig_Vaild (void)
{
return TPMS.Front_TPMS_Valid;
......
......@@ -10,8 +10,17 @@ typedef struct __attribute__((aligned(4)))
uint8_t Rear_TPMS_Valid;
uint8_t TPMS_Warning;
uint8_t TPMS_Unit;
uint32_t TPMS_Front_Learn;
uint32_t TPMS_Rear_Learn;
}_TPMS_Display;
typedef enum
{
Unstudied = 0,
Learning,
LearningCompletion,
LearningFailure,
} TPMSLearning;
void Data_TPMS_KL30_Init ( void );
void Data_TPMS_Processing_Service ( void );
uint32_t Data_Bar_To_Psi (uint32_t bar);
......@@ -22,4 +31,5 @@ uint16_t Get_Front_TPMS_Sig_Value (void);
uint16_t Get_Rear_TPMS_Sig_Value (void);
uint16_t Get_Rear_TPMS_TX (void);
uint16_t Get_Front_TPMS_TX (void);
void Data_TPMS_KL15_WAKE_UP_Init ( void );
#endif
......@@ -128,8 +128,11 @@ void Gauge_Service(void)
SEG_SET_EspeedDial(1, Get_DispEngineSpeed()/500);
SEG_SET_CoolantDial(1, GET_DataCoolantTempSegDisp(), GET_DataCoolantTempValueDisp(), GET_DataCollantTempSegValid());
SEG_SET_Voltage_NUM(1, Get_Battery_Voltage());
#if(IC_Current == TY200_080000b_ty)
SEG_SET_TPMS_NUM(1, Get_Front_TPMS_Sig_Value(), Get_Rear_TPMS_Sig_Value(), Get_Dis_Tpms_Unit(),Get_Front_TPMS_Sig_Vaild(), Get_Rear_TPMS_Sig_Vaild());
#endif
SEG_SET_Navigation_STS(Get_Navigation_St_Dis(),Get_Navigation_Code_Dis(),Get_Navigation_Mileage_Dis());
}
else
{
......
......@@ -3568,7 +3568,9 @@ void Check_SEG_Display(void)
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);
#if(IC_Current == TY200_080000b_ty)
SEG_SET_TPMS_NUM(1, a * 11, a * 11, 0, 1, 1);
#endif
SEG_SET_Voltage_NUM(1, a * 111);
SEG_SET_Navigation_STS(1, 3, a * 111100);
......@@ -3634,10 +3636,10 @@ void Checkself_SEG_Display(void)
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);
#if(IC_Current == TY200_080000b_ty)
TPMS = (Checkself_SEG_step / 3) * 11;
SEG_SET_TPMS_NUM(1, TPMS, TPMS, 0, 1, 1);
#endif
voltage = (Checkself_SEG_step / 3) * 111;
SEG_SET_Voltage_NUM(1, voltage);
......
......@@ -11,6 +11,7 @@ uint8_t PageType = 0;
uint8_t PageMenu = 0;
uint8_t Hour_Set = 0;
uint8_t Minute_Set = 0;
uint8_t Tpms_TX_Flag = 0;
RTC_TimeTypeDef RTC_TimeStruct;
RTC_DateTypeDef RTC_DateStruct;
RTC_CounterTypeDef counter_val;
......@@ -70,6 +71,19 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//Mode
Data_Clear_Trip_All();
}
if (PageType == Page_Front_Tpms)
{
Tpms_TX_Flag = 1;
}
else if (PageType == Page_Rear_Tpms)
{
Tpms_TX_Flag = 2;
}
else
{
Tpms_TX_Flag = 0;
}
TYW_RESET_ODO();
}
......@@ -281,6 +295,7 @@ void Key_Left_Short_Press(void)
}
Unit_Convert_Service();
}
#if (IC_Current == TY200_080000b_ty)
else if(PageType == Page_Tpms_Unit)
{
if(Get_Dis_Tpms_Unit() == 0)
......@@ -293,10 +308,24 @@ void Key_Left_Short_Press(void)
}
Unit_Convert_Service();
}
else if(PageType == Page_Front_Tpms)
{
PageType == Page_Rear_Tpms;
}
else if(PageType == Page_Rear_Tpms)
{
PageType == Page_Front_Tpms;
}
else
{
;
}
#elif (IC_Current == TY200_080000b)
else
{
;
}
#endif
}
void Key_Auto_Save(void)
......@@ -354,11 +383,26 @@ void Key_Left_Long_Press(void)
}
PageType = Page_Km_Unit;
}
#if (IC_Current == TY200_080000b_ty)
else if(PageType == Page_Km_Unit)
{
PageType = Page_Tpms_Unit;
}
else if(PageType == Page_Tpms_Unit)
{
PageType == Page_Front_Tpms;
}
else if((PageType == Page_Front_Tpms) || (PageType == Page_Rear_Tpms))
{
PageType = Page_Menu;
Tpms_TX_Flag = 0;
}
else
{
;
}
#elif (IC_Current == TY200_080000b)
else if(PageType == Page_Km_Unit)
{
PageType = Page_Menu;
}
......@@ -366,6 +410,7 @@ void Key_Left_Long_Press(void)
{
;
}
#endif
}
......@@ -499,3 +544,7 @@ uint8_t Get_Dis_Tcs_Val(void)
{
return MenuData.Tcs_Val; // 0 off, 1 on
}
uint8_t Get_Tpms_TX_Flag(void)
{
return Tpms_TX_Flag;
}
\ No newline at end of file
......@@ -20,6 +20,8 @@ typedef struct
uint8_t KM_Unit; // 0 km, 1 mile
uint8_t Tpms_Unit;// 0 bar, 1 psi
uint32_t Tcs_Val; // 0 off, 1 on
uint32_t TPMS_Front_Learn;
uint32_t TPMS_Rear_Learn;
}_Menu_Data;
typedef enum
......@@ -29,7 +31,8 @@ typedef enum
Page_Time_Minute,
Page_Km_Unit,
Page_Tpms_Unit,
Page_Front_Tpms,
Page_Rear_Tpms,
Page_Max,
}_Page_Type;
......@@ -73,4 +76,5 @@ void MenuData_Unit_Init(void);
void Maintain_Reset_Service(void);
void MenuData_TCS_Init(void);
void Data_TCS_Set_OnOff(uint32_t u32Data);
uint8_t Get_Tpms_TX_Flag(void);
#endif
......@@ -60,9 +60,10 @@ const LED_Attribute_st LED_Attribute [ LED_Max ] = {
{em_LED_Maintain, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Maintain_Judgement, LED_Maintain_Execution},
{em_LED_Low_Batt_Vol, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Low_Batt_Judgement, LED_Low_Batt_Execution},
{em_LED_Lateral_Strut, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Lateral_Strut_Judgement, LED_Lateral_Strut_Execution},
#if(IC_Current == TY200_080000b_ty)
{em_LED_Tire_Pressure_Alarm, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Tire_Pressure_Judgement, LED_Tire_Pressure_Execution},
//{em_LED_Navigator, SelfCheck, NoExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Navigato_Judgement, LED_Navigato_Execution},
#endif
};
......
#new Option
#Mon May 27 17:27:21 CST 2024
#Mon Jun 03 09:12:48 CST 2024
IsSort=true
MergeFlashIsCompression=false
ChangeAppFilePath=
......
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