Commit 3ba2e1d3 authored by hu's avatar hu

调整个别报文接收周期,调整CAN外发

parent c5d4fd9f
...@@ -112,7 +112,7 @@ void Speed_Processing_Service(void) ...@@ -112,7 +112,7 @@ void Speed_Processing_Service(void)
Fre_SortShort(VehFreBuf, VehFreNum); Fre_SortShort(VehFreBuf, VehFreNum);
i = 0u; i = 0u;
} }
VehValCup = (uint16_t) VehFreBuf[1u]; VehValCup = (uint16_t) VehFreBuf[3u];
if (VehValCup > 2250) if (VehValCup > 2250)
{ {
......
...@@ -76,7 +76,7 @@ static void Key_Process(Key_Num_en_t enKeyIndex) ...@@ -76,7 +76,7 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
if (stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack != 0U) if (stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack != 0U)
{ {
if ((stKeyCtrVariate[enKeyIndex].enKeyTypeLast == KEY_CAN_NONE) && if ((stKeyCtrVariate[enKeyIndex].enKeyTypeLast == KEY_CAN_NONE) &&
(enKeyRealType == KEY_CAN_SHORT_PRESS)) (enKeyRealType == KEY_CAN_SHORT_PRESS))
{ {
stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack(KEY_EVENT_SHORT_PRESS); stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack(KEY_EVENT_SHORT_PRESS);
} }
...@@ -110,7 +110,7 @@ static void Key_Process(Key_Num_en_t enKeyIndex) ...@@ -110,7 +110,7 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
if (stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack != 0U) if (stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack != 0U)
{ {
if ((stKeyCtrVariate[enKeyIndex].enKeyTypeLast == KEY_CAN_SHORT_PRESS) && if ((stKeyCtrVariate[enKeyIndex].enKeyTypeLast == KEY_CAN_SHORT_PRESS) &&
(enKeyRealType == KEY_CAN_NONE)) (enKeyRealType == KEY_CAN_NONE))
{ {
stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack(KEY_EVENT_SHORT_PRESS); stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack(KEY_EVENT_SHORT_PRESS);
} }
...@@ -157,8 +157,8 @@ static void Key_Process(Key_Num_en_t enKeyIndex) ...@@ -157,8 +157,8 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
stKeyCtrVariate[enKeyIndex].u16KeyIGNTimeCount = 0U; stKeyCtrVariate[enKeyIndex].u16KeyIGNTimeCount = 0U;
} }
if ((stKeyCtrVariate[enKeyIndex].u16KeyInvalidTimeCount >= stKeyParameter.u16KeyLoosenTime) && if ((stKeyCtrVariate[enKeyIndex].u16KeyInvalidTimeCount >= stKeyParameter.u16KeyLoosenTime) &&
(stKeyCtrVariate[enKeyIndex].u16KeyValidTimeCount >= stKeyParameter.u16KeyShortPressTime) && (stKeyCtrVariate[enKeyIndex].u16KeyValidTimeCount >= stKeyParameter.u16KeyShortPressTime) &&
(stKeyCtrVariate[enKeyIndex].u16KeyValidTimeCount < stKeyParameter.u16KeyLongPressTime)) (stKeyCtrVariate[enKeyIndex].u16KeyValidTimeCount < stKeyParameter.u16KeyLongPressTime))
{ {
stKeyCtrVariate[enKeyIndex].u16KeyValidTimeCount = 0U; stKeyCtrVariate[enKeyIndex].u16KeyValidTimeCount = 0U;
/* call back */ /* call back */
...@@ -240,7 +240,7 @@ static void Key_Process(Key_Num_en_t enKeyIndex) ...@@ -240,7 +240,7 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
if (enKeyIGNRealStatus == KEY_IG_ON) if (enKeyIGNRealStatus == KEY_IG_ON)
{ {
if ((stKeyCtrVariate[enKeyIndex].u16KeyFirstIGNTimeRecord >= stKeyParameter.u16KeyValidOFFTime) && if ((stKeyCtrVariate[enKeyIndex].u16KeyFirstIGNTimeRecord >= stKeyParameter.u16KeyValidOFFTime) &&
(stKeyCtrVariate[enKeyIndex].u16KeyIGNTimeCount >= stKeyParameter.u16KeyValidONTime)) (stKeyCtrVariate[enKeyIndex].u16KeyIGNTimeCount >= stKeyParameter.u16KeyValidONTime))
{ {
if (stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack != 0U) if (stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack != 0U)
{ {
...@@ -255,7 +255,7 @@ static void Key_Process(Key_Num_en_t enKeyIndex) ...@@ -255,7 +255,7 @@ static void Key_Process(Key_Num_en_t enKeyIndex)
if (enKeyIGNRealStatus == KEY_IG_OFF) if (enKeyIGNRealStatus == KEY_IG_OFF)
{ {
if ((stKeyCtrVariate[enKeyIndex].u16KeyFirstIGNTimeRecord >= stKeyParameter.u16KeyValidONTime) && if ((stKeyCtrVariate[enKeyIndex].u16KeyFirstIGNTimeRecord >= stKeyParameter.u16KeyValidONTime) &&
(stKeyCtrVariate[enKeyIndex].u16KeyIGNTimeCount >= stKeyParameter.u16KeyValidOFFTime)) (stKeyCtrVariate[enKeyIndex].u16KeyIGNTimeCount >= stKeyParameter.u16KeyValidOFFTime))
{ {
if (stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack != 0U) if (stKeyAttribute[enKeyIndex].pfnKeyOperationCallBack != 0U)
{ {
...@@ -306,9 +306,10 @@ void Key_Init(void) ...@@ -306,9 +306,10 @@ void Key_Init(void)
stKeyCtrVariate[i].u16KeyIGNTimeCount = 0U; stKeyCtrVariate[i].u16KeyIGNTimeCount = 0U;
} }
/*按键动作时间*/ /*按键动作时间*/
/*342 4.1 短按/长按操作的判断标准(判定时间):短按;40ms以上,未到800ms,长按;800ms以上*/
stKeyParameter.u16KeyLoosenTime = 100U; stKeyParameter.u16KeyLoosenTime = 100U;
stKeyParameter.u16KeyShortPressTime = 40U; stKeyParameter.u16KeyShortPressTime = 40U;
stKeyParameter.u16KeyLongPressTime = 1500U; stKeyParameter.u16KeyLongPressTime = 1000U;
stKeyParameter.u16KeySuperLongPressTime = 10000U; stKeyParameter.u16KeySuperLongPressTime = 10000U;
stKeyParameter.u16KeyValidOFFTime = 200U; /*按键动作时间*/ stKeyParameter.u16KeyValidOFFTime = 200U; /*按键动作时间*/
stKeyParameter.u16KeyValidONTime = 1000U; stKeyParameter.u16KeyValidONTime = 1000U;
......
...@@ -176,7 +176,7 @@ const st_CANMsgAttribute CAN_MSG_CONST_ARRAY[ID_TOTAL_MAX] = ...@@ -176,7 +176,7 @@ const st_CANMsgAttribute CAN_MSG_CONST_ARRAY[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}, {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, 2000ul,
0x18FEEE00ul, 0x18FEEE00ul,
(( void * )0), (( void * )0),
(( void * )0), (( void * )0),
...@@ -306,7 +306,7 @@ const st_CANMsgAttribute CAN_MSG_CONST_ARRAY[ID_TOTAL_MAX] = ...@@ -306,7 +306,7 @@ const st_CANMsgAttribute CAN_MSG_CONST_ARRAY[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}, {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, 2000ul,
0x18EF1718ul, 0x18EF1718ul,
(( void * )0), (( void * )0),
(( void * )0), (( void * )0),
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "Common_Interface.h" #include "Common_Interface.h"
#include "Gauges.h" #include "Gauges.h"
#include "GaugesInterface.h" #include "GaugesInterface.h"
#include "Telltales.h" #include "Telltales.h"
#include "GUI.h" #include "GUI.h"
...@@ -389,37 +388,36 @@ void Can_Set_Buff_18FF2A17(uint8_t CopyData[]) ...@@ -389,37 +388,36 @@ void Can_Set_Buff_18FF2A17(uint8_t CopyData[])
uint8_t Range_Air_Cut_Warning = 0u; uint8_t Range_Air_Cut_Warning = 0u;
uint8_t IRIS_Warning_Lamp_Status = 0u; uint8_t IRIS_Warning_Lamp_Status = 0u;
#if 0
/*手刹状态*/ /*手刹状态*/
if (LINK_PARK_BRAKE_IN_LG32_P03 == 0) if (Line_In_Get_Status(LINE_IN_PARK_BRAKE) == 1u)
SW_Parking = 1 ; SW_Parking = 1 ;
else else
SW_Parking = 0 ; SW_Parking = 0 ;
/*水温状态*/ /*水温状态*/
if ((ET1_Engine_Coolant_Temperature > 0xFA) || (ET1_STATUS & CAN_MSG_LOST)) if ((Get_ID_18FEEE00_Sig_Engine_Coolant_Temperature() > 0xFA) ||
(CAN_SIG_LOST == CAN_MSG_Status(ID_CanMsg18FEEE00_Msg_Count)))
{ {
Water_Temp_Level = 2; Water_Temp_Level = 2;
Over_Heat_Warning_Status = 0; Over_Heat_Warning_Status = 0;
} }
else if ((DataCoolantTempSegDisp >= 0) && (DataCoolantTempSegDisp < 12)) else if ((Coolant_Get_CurSeg() >= 0) && (Coolant_Get_CurSeg() < 12))
{ {
Water_Temp_Level = 0 ; Water_Temp_Level = 0 ;
Over_Heat_Warning_Status = 0 ; Over_Heat_Warning_Status = 0 ;
} }
else if ((DataCoolantTempSegDisp >= 12) && (DataCoolantTempSegDisp <= 13)) else if ((Coolant_Get_CurSeg() >= 12) && (Coolant_Get_CurSeg() <= 13))
{ {
Water_Temp_Level = 1 ; Water_Temp_Level = 1 ;
if (DataVSpeedDisp > 20) if (Common_Get_Disp_V_Speed() > 20)
Over_Heat_Warning_Status = 0 ; Over_Heat_Warning_Status = 0 ;
else else
Over_Heat_Warning_Status = 1 ; Over_Heat_Warning_Status = 1 ;
} }
/*电源电压*/ /*电源电压*/
IGN_Voltage = (9 + DataCoolantVolSegDisp) * 10 ; IGN_Voltage = (9 + Gui_Get_Voltmeter_DisplayMode()) * 10 ;
#endif
CopyData[0] = (uint8_t)(((Water_Temp_Level << 6u) & 0xC0u) | CopyData[0] = (uint8_t)(((Water_Temp_Level << 6u) & 0xC0u) |
((Remining_Fuel_Warning << 5u) & 0x20u) | ((Remining_Fuel_Warning << 5u) & 0x20u) |
......
#include "GUI.h" #include "GUI.h"
#include "r_wm_api.h"
#include "r_typedefs.h" #include "r_typedefs.h"
#include "loc_graphics.h" #include "loc_graphics.h"
...@@ -5988,4 +5989,17 @@ void GUI_General_Popup_Display(uint16_t PopupMsg) ...@@ -5988,4 +5989,17 @@ void GUI_General_Popup_Display(uint16_t PopupMsg)
GUI_General_Display(MultiPurpose_Sprite, GUIGeneralPopupTable[PopupMsg].HImageCN3, GUI_BLENDMODE_CUSTOM); GUI_General_Display(MultiPurpose_Sprite, GUIGeneralPopupTable[PopupMsg].HImageCN3, GUI_BLENDMODE_CUSTOM);
GUI_General_Display(MultiPurpose_Sprite, GUIGeneralPopupTable[PopupMsg].HImageCN4, GUI_BLENDMODE_CUSTOM); GUI_General_Display(MultiPurpose_Sprite, GUIGeneralPopupTable[PopupMsg].HImageCN4, GUI_BLENDMODE_CUSTOM);
} }
}
void Loc_Display_Blue(void)
{
loc_Disable_Window_App();
JCUA_Disable_window();
R_WM_ScreenBgColorSet(0, 0, 0, 0Xff);
R_WM_FrameEndMark(0, 0);
R_WM_FrameWait(0, 0);
} }
\ No newline at end of file
...@@ -64,6 +64,7 @@ void RTE_PWM_LCD_Start(void) ...@@ -64,6 +64,7 @@ void RTE_PWM_LCD_Start(void)
} }
/*车速频率输出*/
void RTE_PWM_Set_Speed_Out(uint16_t m_Cycle, uint16_t m_Duty) void RTE_PWM_Set_Speed_Out(uint16_t m_Cycle, uint16_t m_Duty)
{ {
uint32_t ActSetFreq = 0u;; uint32_t ActSetFreq = 0u;;
...@@ -73,20 +74,22 @@ void RTE_PWM_Set_Speed_Out(uint16_t m_Cycle, uint16_t m_Duty) ...@@ -73,20 +74,22 @@ void RTE_PWM_Set_Speed_Out(uint16_t m_Cycle, uint16_t m_Duty)
Fre_8_pulse *= 25 ; Fre_8_pulse *= 25 ;
Fre_8_pulse /= 8 ; Fre_8_pulse /= 8 ;
//车速1//8脉冲 /*A16-25 A17-8 A18-8*/
/*车速1 8脉冲*/
ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_2_CH10 , Fre_8_pulse , m_Duty); ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_2_CH10 , Fre_8_pulse , m_Duty);
//车速2//25脉冲 /*车速2 25脉冲*/
ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_2_CH13 , m_Cycle , m_Duty); ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_2_CH13 , m_Cycle , m_Duty);
//车速3//25脉冲 /*车速3 25脉冲*/
ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_2_CH15 , m_Cycle , m_Duty); ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_2_CH15 , m_Cycle , m_Duty);
} }
/*转速频率输出*/
void RTE_PWM_Set_Tacho_Out(uint16_t m_Cycle, uint16_t m_Duty) void RTE_PWM_Set_Tacho_Out(uint16_t m_Cycle, uint16_t m_Duty)
{ {
uint32_t ActSetFreq; uint32_t ActSetFreq;
//转速 /*342 10.2 以4脉冲/发动机1转向A39端子输出 */
ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_0_CH7 , m_Cycle , m_Duty); ActSetFreq = TimerB_PWM_Channel_Fre_Set(TIMERB_0_CH7 , m_Cycle , m_Duty);
} }
...@@ -149,7 +149,7 @@ void RSCAN0_CH_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum) ...@@ -149,7 +149,7 @@ void RSCAN0_CH_Init(CANFD_Filter_Init_st_t *pFilterInit, uint32_t IDFilterNum)
RSCAN0C0CTR |= 0x00400000UL; // BUSOFF end occur recover by user RSCAN0C0CTR |= 0x00400000UL; // BUSOFF end occur recover by user
/* Set Channel Configuration register */ /* Set Channel Configuration register */
RSCAN0C0CFG = 0x023A0000UL; /* 500K 75%*/ RSCAN0C0CFG = 0x023A0000UL; /* 500K 75%*/
//RSCAN0C0CFG = 0x023A0001UL; /* 250K 75%*/ //RSCAN0C0CFG = 0x023A0001UL; /* 250K 75%*/
#endif #endif
/* Set Global Configuration register */ /* Set Global Configuration register */
......
This diff is collapsed.
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