Commit 9769c2ab authored by hu's avatar hu

调整BUG

parent 453ef5db
...@@ -1204,7 +1204,22 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent) ...@@ -1204,7 +1204,22 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
/*----有车速,无报警----*/ /*----有车速,无报警----*/
if (enKeyEvent == KEY_EVENT_SHORT_PRESS) if (enKeyEvent == KEY_EVENT_SHORT_PRESS)
{ {
; /*Do Nothing!*/ /*工厂模式*/
if (MenuFlag.Menu_StaFlag == 0x00u)
{
Common_Set_Menu_FacDea_Time_Sta(0x00u);
K_Line_Set.K_Line_LID51 = 0x00u;
MenuFlag.Menu_StaFlag = 0x01u;
}
/*经销商模式*/
else if (MenuFlag.Menu_StaFlag == 0x02u)
{
Common_Set_Menu_FacDea_Time_Sta(0x00u);
K_Line_Set.K_Line_LID51 = 0x02u;
MenuFlag.Menu_StaFlag = 0x01u;
}
} }
else if (enKeyEvent == KEY_EVENT_LONG_PRESS) else if (enKeyEvent == KEY_EVENT_LONG_PRESS)
{ {
...@@ -1216,7 +1231,22 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent) ...@@ -1216,7 +1231,22 @@ void Key_Operation_Menu(Key_Event_en_t enKeyEvent)
/*----有车速,无报警----*/ /*----有车速,无报警----*/
if (enKeyEvent == KEY_EVENT_SHORT_PRESS) if (enKeyEvent == KEY_EVENT_SHORT_PRESS)
{ {
; /*Do Nothing!*/ /*工厂模式*/
if (MenuFlag.Menu_StaFlag == 0x00u)
{
Common_Set_Menu_FacDea_Time_Sta(0x00u);
K_Line_Set.K_Line_LID51 = 0x00u;
MenuFlag.Menu_StaFlag = 0x01u;
}
/*经销商模式*/
else if (MenuFlag.Menu_StaFlag == 0x02u)
{
Common_Set_Menu_FacDea_Time_Sta(0x00u);
K_Line_Set.K_Line_LID51 = 0x02u;
MenuFlag.Menu_StaFlag = 0x01u;
}
} }
else if (enKeyEvent == KEY_EVENT_LONG_PRESS) else if (enKeyEvent == KEY_EVENT_LONG_PRESS)
{ {
......
...@@ -36,7 +36,7 @@ _TPMS TPMS_Matching; ...@@ -36,7 +36,7 @@ _TPMS TPMS_Matching;
_UserSet User_set_Num; _UserSet User_set_Num;
_UserSet User_App; _UserSet User_App;
Display_Modular_St Display_DTC[4u]; Display_Modular_St Display_DTC[DTCNumeber + 1u];
#pragma alignvar(8) #pragma alignvar(8)
uint8_t EolNUM[10u][8u]; uint8_t EolNUM[10u][8u];
...@@ -146,39 +146,67 @@ void GUI_Display_Value_Init(void) ...@@ -146,39 +146,67 @@ void GUI_Display_Value_Init(void)
/*保养状态标识*/ /*保养状态标识*/
if (K_Line_Set.K_Line_LID4F) if (K_Line_Set.K_Line_LID4F)
{
State_Flag.User_FDJYLQQ_FLAG = 0u; State_Flag.User_FDJYLQQ_FLAG = 0u;
}
else else
{
State_Flag.User_FDJYLQQ_FLAG = 3u; State_Flag.User_FDJYLQQ_FLAG = 3u;
}
if (K_Line_User_RYLQQ) if (K_Line_User_RYLQQ)
{
State_Flag.User_RYLQQ_FLAG = 0u; State_Flag.User_RYLQQ_FLAG = 0u;
}
else else
{
State_Flag.User_RYLQQ_FLAG = 3u; State_Flag.User_RYLQQ_FLAG = 3u;
}
if (K_Line_Set.K_Line_LID4A) if (K_Line_Set.K_Line_LID4A)
{
State_Flag.User_BSXY_FLAG = 0u; State_Flag.User_BSXY_FLAG = 0u;
}
else else
{
State_Flag.User_BSXY_FLAG = 3u; State_Flag.User_BSXY_FLAG = 3u;
}
if (K_Line_Set.K_Line_LID4B) if (K_Line_Set.K_Line_LID4B)
{
State_Flag.User_CSQY_FLAG = 0u; State_Flag.User_CSQY_FLAG = 0u;
}
else else
{
State_Flag.User_CSQY_FLAG = 3u; State_Flag.User_CSQY_FLAG = 3u;
}
if (K_Line_User_KQGZJ) if (K_Line_User_KQGZJ)
{
State_Flag.User_KQGZJ_FLAG = 0u; State_Flag.User_KQGZJ_FLAG = 0u;
}
else else
{
State_Flag.User_KQGZJ_FLAG = 3u; State_Flag.User_KQGZJ_FLAG = 3u;
}
if (K_Line_Set.K_Line_LID4D) if (K_Line_Set.K_Line_LID4D)
{
State_Flag.User_DLZXY_FLAG = 0u; State_Flag.User_DLZXY_FLAG = 0u;
}
else else
{
State_Flag.User_DLZXY_FLAG = 3u; State_Flag.User_DLZXY_FLAG = 3u;
}
if (K_Line_Set.K_Line_LID4E) if (K_Line_Set.K_Line_LID4E)
{
State_Flag.User_LT_FLAG = 0u; State_Flag.User_LT_FLAG = 0u;
}
else else
{
State_Flag.User_LT_FLAG = 3u; State_Flag.User_LT_FLAG = 3u;
}
User_App.User_FDJYLQQ = (uint32_t)K_Line_Set.K_Line_LID4F * 1000u ; /*发动机油*/ User_App.User_FDJYLQQ = (uint32_t)K_Line_Set.K_Line_LID4F * 1000u ; /*发动机油*/
User_App.User_RYLQQ = (uint32_t)K_Line_User_RYLQQ * 1000u ; /*燃油滤清器*/ User_App.User_RYLQQ = (uint32_t)K_Line_User_RYLQQ * 1000u ; /*燃油滤清器*/
...@@ -1783,13 +1811,13 @@ void GUI_Time_OilTemp_Display(uint8_t Mode) ...@@ -1783,13 +1811,13 @@ void GUI_Time_OilTemp_Display(uint8_t Mode)
{ {
GUI_General_Display(MultiPurpose_Sprite, SpriteSize, GUI_BLENDMODE_SRC_OVER); GUI_General_Display(MultiPurpose_Sprite, SpriteSize, GUI_BLENDMODE_SRC_OVER);
} }
else if (Temp <= 0xFAFFFFFFu) else if (Temp <= 0xFAFFFFFF)
{ {
Temp = Temp / 20u; Temp = Temp / 20u;
if (Temp >= 9999999u) if (Temp >= 9999999)
{ {
GUI_General_Digit_Display(MultiPurpose_Sprite, 9999999u, Nb_20_0, 7u, 5u, GUI_DISP_OILTEMP, 221u, GUI_BLENDMODE_SRC_OVER); /*显示ODO的数值*/ GUI_General_Digit_Display(MultiPurpose_Sprite, 9999999, Nb_20_0, 7u, 5u, GUI_DISP_OILTEMP, 221u, GUI_BLENDMODE_SRC_OVER); /*显示ODO的数值*/
} }
else else
{ {
...@@ -1836,13 +1864,13 @@ void GUI_Time_OilTemp_OFF_Display(uint8_t Mode) ...@@ -1836,13 +1864,13 @@ void GUI_Time_OilTemp_OFF_Display(uint8_t Mode)
GUI_General_Display(MENU_Sprite, CN_Time_wenzi, GUI_BLENDMODE_SRC_OVER); /*时间*/ GUI_General_Display(MENU_Sprite, CN_Time_wenzi, GUI_BLENDMODE_SRC_OVER); /*时间*/
GUI_General_Display(MENU_Sprite, CN_Time_danwei, GUI_BLENDMODE_SRC_OVER); /*H*/ GUI_General_Display(MENU_Sprite, CN_Time_danwei, GUI_BLENDMODE_SRC_OVER); /*H*/
if (Temp <= 0xFAFFFFFFu) if (Temp <= 0xFAFFFFFF)
{ {
Temp = Temp / 20u; Temp = Temp / 20u;
if (Temp >= 9999999u) if (Temp >= 9999999)
{ {
GUI_General_Digit_Display(MENU_Sprite, 9999999u, Nb_20_0, 7u, 5u, GUI_DISP_OILTEMP, 221u, GUI_BLENDMODE_SRC_OVER); GUI_General_Digit_Display(MENU_Sprite, 9999999, Nb_20_0, 7u, 5u, GUI_DISP_OILTEMP, 221u, GUI_BLENDMODE_SRC_OVER);
} }
else else
{ {
...@@ -1853,7 +1881,7 @@ void GUI_Time_OilTemp_OFF_Display(uint8_t Mode) ...@@ -1853,7 +1881,7 @@ void GUI_Time_OilTemp_OFF_Display(uint8_t Mode)
} }
else else
{ {
GUI_General_Digit_Display(MENU_Sprite, 9999999u, Nb_20_0, 7u, 5u, GUI_DISP_OILTEMP, 221u, GUI_BLENDMODE_SRC_OVER); GUI_General_Digit_Display(MENU_Sprite, 9999999, Nb_20_0, 7u, 5u, GUI_DISP_OILTEMP, 221u, GUI_BLENDMODE_SRC_OVER);
GUI_Translate_Display(MENU_Sprite, Nb_20_dian, 719u, 241u, GUI_BLENDMODE_CUSTOM); /*点*/ GUI_Translate_Display(MENU_Sprite, Nb_20_dian, 719u, 241u, GUI_BLENDMODE_CUSTOM); /*点*/
} }
} }
......
#include "kwp2000_interface.h"
#include "UART.h"
#define BOARD_TMBCLK_HZ 32000000
/* physical and functional addresses for the ECU */
unsigned char kwp2000_PhysicalAddress;
unsigned char kwp2000_FunctionalAddress;
unsigned char kwp2000_ServerAddress;
unsigned int kwp2000_P3_MAX_LIMIT;
/*-------------------------------------------------------------------------
* Function Name : Kwp2000_SetAddress
* Description :
* Input :
* Output : None
* Return : None
* onther :
--------------------------------------------------------------------------*/
void Kwp2000_SetAddress( void )
{
kwp2000_PhysicalAddress = KWP2000_ADDR_IC;
kwp2000_FunctionalAddress = KWP2000_ADDR_OBD;
kwp2000_ServerAddress = KWP2000_ADDR_SERVER;
}
/*-------------------------------------------------------------------------
* Function Name : Kwp2000_SetTiming
* Description :
* Input :
* Output : None
* Return : None
* onther :
--------------------------------------------------------------------------*/
void Kwp2000_SetTiming( void )
{
kwp2000_P3_MAX_LIMIT = KWP2000_P3_MAX;
}
/*-------------------------------------------------------------------------
* Function Name : Kwp2000_AscDisableRx
* Description : 禁止收 使能发
* Input :
* Output : None
* Return : None
* onther :
--------------------------------------------------------------------------*/
void Kwp2000_AscDisableRx( void )
{
Uart_DisableRx();
Uart_EnableTx();
}
/*-------------------------------------------------------------------------
* Function Name : Kwp2000_AscEnableRx
* Description : 使能接收功能
* Input :
* Output : None
* Return : None
* onther :
--------------------------------------------------------------------------*/
void Kwp2000_AscEnableRx( void )
{
/* enable receiver, clear all error flags */
Uart_ClearAllErrorFlag();
Uart_EnableRx();
}
/*-------------------------------------------------------------------------
* Function Name : Kwp2000_AscTx
* Description : 发送数据字节
* Input :
* Output : None
* Return : None
* onther :
--------------------------------------------------------------------------*/
void Kwp2000_AscTx( unsigned char* xBuffer_pu8 )
{
Uart_SetData(*xBuffer_pu8);
}
/*-------------------------------------------------------------------------
* Function Name : Kwp2000_AscStart
* Description :
* Input :
* Output : None
* Return : None
* onther :
--------------------------------------------------------------------------*/
void Kwp2000_AscStart( void )
{
}
/*-------------------------------------------------------------------------
* Function Name : Kwp2000_AscStop
* Description :
* Input :
* Output : None
* Return : None
* onther :
--------------------------------------------------------------------------*/
void Kwp2000_AscStop( void )
{
}
/*-------------------------------------------------------------------------
* Function Name : Kwp2000_AscInit
* Description : 串口模块初始化
* Input :
* Output : None
* Return : None
* onther :
--------------------------------------------------------------------------*/
void Kwp2000_AscInit( void )
{
Kwp2000_AscStop(); // disable ASC_A mode
/* disable interrupt service request, clear service request flags */
/*预留设置*/
/* enable receiver and transmitter function*/
Uart_EnableRx();
Uart_EnableTx();
TJA1021_Enable(1);
/* disable transmitter interrupt */
Uart_DisableTxInterrupt();
/// -----------------------------------------------------------------------
/// Configuration of the ASC0 Operation Mode:
/// -----------------------------------------------------------------------
Uart_ConfigOperationMode();
/// -----------------------------------------------------------------------
/// Configuration of the used ASC0 Port Pins:
/// -----------------------------------------------------------------------
Uart_SetTxGpio(); //TX
Uart_SetRxGpio(); //RX
/// -----------------------------------------------------------------------
/// Configuration of priority of SCI_A interrupt:
/// -----------------------------------------------------------------------
/*预留优先级设置*/
/* Configuration of Baudrate , as 10400bps */
Kwp2000_AscSwitchBaudrate(KWP2000_DEFAULT_BAUDRATE_KLINE_DU);
Kwp2000_AscStart();
/* clear service request flags */
Uart_ClearRxFullFlag();
}
/*-------------------------------------------------------------------------
* Function Name : Kwp2000_AscSwitchBaudrate
* Description : 设置波特率
* Input : xBaudrate_u32 波特率数值
* Output : None
* Return : None
* onther :
--------------------------------------------------------------------------*/
void Kwp2000_AscSwitchBaudrate(unsigned long xBaudrate_u32)
{
/* if configuration is valid, ... */
if ( xBaudrate_u32 != 0ul )
{
Kwp2000_AscStop();
Uart_SetBaudrate(xBaudrate_u32);
/* start ASC */
Kwp2000_AscStart();
}
}
\ No newline at end of file
#ifndef _KWP2000_INTERFACE_H
#define _KWP2000_INTERFACE_H
/*
*********************************************************************
* defines
*********************************************************************
*/
/* Defined for ComStatus */
#define KWP2000_DEFAULT_BAUDRATE_KLINE_DU 10400ul
#define KWP2000_MID_BAUDRATE_KLINE_DU 57600ul
#define KWP2000_HIGH_BAUDRATE_KLINE_DU 249600ul
#define KWP2000_ADDR_IC 0x60u
#define KWP2000_ADDR_OBD 0x33u
#define KWP2000_ADDR_SERVER 0xF1u
#define KWP2000_P2_MIN 0
#define KWP2000_P3_MAX 5000
/*
*********************************************************************
* variable
*********************************************************************
*/
extern unsigned char kwp2000_PhysicalAddress;
extern unsigned char kwp2000_FunctionalAddress;
extern unsigned char kwp2000_ServerAddress;
extern unsigned int kwp2000_P3_MAX_LIMIT;
/*
*********************************************************************
* function
*********************************************************************
*/
extern void Kwp2000_AscInit( void );
extern void Kwp2000_AscSwitchBaudrate(unsigned long xBaudrate_u32);
extern unsigned short Uart_GetData( void );
extern unsigned char Uart_GetRxLevel(void);
extern void Uart_SetData( unsigned char xBuffer_pu8 );
extern void Uart_DisableReceiveIsrReq( void );
extern void Uart_EnableReceiveIsrReq( void );
extern void Uart_ClearAllErrorFlag( void );
extern void Uart_EnableRx( void );
extern void Uart_DisableRx( void );
extern void Uart_EnableTx( void );
extern void Uart_SetRxGpio( void );
extern void Uart_SetTxGpio( void );
extern void Uart_SetBaudrate( unsigned long xBaudrate_u32 );
extern void Uart_ClearRxFullFlag(void);
extern void Uart_DisableTxInterrupt( void );
extern void Uart_ConfigOperationMode(void);
extern void TJA1021_Enable( unsigned char state );
extern void Kwp2000_SetTiming( void );
extern void Kwp2000_SetAddress( void );
extern void Kwp2000_AscTx( unsigned char* xBuffer_pu8 );
extern void Kwp2000_AscEnableRx( void );
#endif
This diff is collapsed.
#ifndef _KWP2000_SERVICE_H
#define _KWP2000_SERVICE_H
extern void Kwp2000_Handle( void );
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef _KWP2000_TP_H
#define _KWP2000_TP_H
/*
*********************************************************************
* Defined for ComStatus
*********************************************************************
*/
#define KWP2000_BUFFLEN_MAX 255
#define KWP2000_RX_BUFFER_SIZE 260
#define KWP2000_TX_BUFFER_SIZE 260
/*
*********************************************************************
* Defined for ComStatus
*********************************************************************
*/
#define INIT 0x00u /* Initialisation modes in 0x0y*/
#define COM_INIT 0x01u
#define KWP2000 0x20u /* KWP2000 modes in 0x2y */
#define KWP2000_FAST_INIT 0x21u
#define KWP2000_WAIT_RECEPTION 0x22u
#define KWP2000_WAIT_HEADER 0x23u
#define KWP2000_WAIT_DATAS 0x24u
#define KWP2000_COMMUNICATION 0x25u
#define KWP2000_BUILD_RESPONSE 0x26u
#define KWP2000_SEND_RESPONSE 0x27u
#define KWP2000_MODIFY_CONFIG 0x28u
#define KWP2000_END 0x29u
#define KWP2000_IDLE 0x2Au
#define PROTOCOL 0xF0u /* Protocol modes defined by 0xy0 */
#define KWP2000_MODIFY_NULL 0
#define KWP2000_MODIFY_BAUDRATE 1
#define KWP2000_MODIFY_RESET 2
#define KWP2000_MODIFY_END 3
/*
*********************************************************************
* structure
*********************************************************************
*/
typedef struct
{
unsigned char Format;
unsigned char headerSize;
unsigned char SId;
unsigned char TgtAddr;
unsigned char SrcAddr;
unsigned short Rx_len;
unsigned short Tx_len;
unsigned char RxBuffer[KWP2000_RX_BUFFER_SIZE];
unsigned char TxBuffer[KWP2000_TX_BUFFER_SIZE];
unsigned char *Request_Datas;
unsigned char *Response_Datas;
unsigned short kwp2000_Len;
unsigned char kwp2000_Checksum;
unsigned long tiCom_u32;
unsigned char ResponsePending;
} Kwp2000_ComState_t;
typedef struct
{
unsigned char typeOfModif;
unsigned long newBaudRate;
unsigned short resetType;
} Kwp2000_Modify_t;
/*
*********************************************************************
* variable
*********************************************************************
*/
extern Kwp2000_ComState_t Kwp2000_ComState;
extern Kwp2000_Modify_t Kwp2000_Modify;
extern unsigned long Kwp2000_ComMode;
/*
*********************************************************************
* function
*********************************************************************
*/
extern void Kwp2000_Timeout(void);
extern void Kwp2000_CommuniationDown(void);
extern void Kwp2000_Init(void);
extern void Kwp2000_AscRxInterrupt( void );
extern void Kwp2000_ComInit_Handle( void );
extern unsigned char Kwp2000_FormatAnalyse(void);
extern void Kwp2000_HeaderAnalyse(void);
extern unsigned char Kwp2000_PrepareHeader(unsigned char dataSize);
extern unsigned char Kwp2000_ChecksumCalculate(unsigned char *dataBuffer, unsigned short numberOfBytes);
extern unsigned char kwp2000_AddressTest(void);
extern unsigned char Kwp2000_VerifyChecksum(void);
extern void Kwp2000_ProtocolInit( void );
#endif
...@@ -4,7 +4,7 @@ static const HanSansCNFontPos_t Hansans00002ce20[] = ...@@ -4,7 +4,7 @@ static const HanSansCNFontPos_t Hansans00002ce20[] =
{ {
//{charid, xpos, ypos, width, height, xoffset, yoffset, xadvance} //{charid, xpos, ypos, width, height, xoffset, yoffset, xadvance}
{ 0 , 3995 , 552 , 4 , 22 , 0 , 0 , 4 }, { 0 , 3995 , 552 , 4 , 22 , 0 , 0 , 4 },
#if 1 #if 0
{ 1 , 3995 , 23 , 4 , 22 , 0 , 0 , 4 }, { 1 , 3995 , 23 , 4 , 22 , 0 , 0 , 4 },
{ 2 , 3995 , 805 , 4 , 22 , 0 , 0 , 4 }, { 2 , 3995 , 805 , 4 , 22 , 0 , 0 , 4 },
{ 3 , 3995 , 759 , 4 , 22 , 0 , 0 , 4 }, { 3 , 3995 , 759 , 4 , 22 , 0 , 0 , 4 },
This diff is collapsed.
#ifndef UART_H__
#define UART_H__
/*-----------------use for RH850_D1M1A --------------------*/
#include "r_typedefs.h"
/***************************************************************/
/***************************************************************/
typedef enum
{
UART_RLIN30 = 0U,
UART_RLIN31,
UART_RLIN32,
UART_RLIN33,
UART_RLIN_MAX,
} UART_Channel_en_t;
typedef void (*UART_Confirm)(void);
typedef void (*UART_Read_Msg)(uint16_t u16UARTData);
typedef struct
{
uint32_t u32UARTChEn; /*通道是否使能*/
uint32_t u32UARTbps; /*通道实际波特率*/
UART_Confirm pfnUARTConfirmCallBack;
UART_Read_Msg pfnUARTReadMsgCallBack;
} UART_Channel_Config_st_t;
/****************************************************************/
extern void UART_CH0_TX_ISR(void);
extern void UART_CH1_TX_ISR(void);
extern void UART_CH2_TX_ISR(void);
extern void UART_CH3_TX_ISR(void);
extern void UART_CH0_RX_ISR(void);
extern void UART_CH1_RX_ISR(void);
extern void UART_CH2_RX_ISR(void);
extern void UART_CH3_RX_ISR(void);
extern uint8_t UART_Ch0_Get_TX_Busy_Flag(void);
extern uint8_t UART_Ch1_Get_TX_Busy_Flag(void);
extern uint8_t UART_Ch2_Get_TX_Busy_Flag(void);
extern uint8_t UART_Ch3_Get_TX_Busy_Flag(void);
extern void UART_Ch0_Send_Multiple_Byte(uint8_t *Data, uint8_t Len);
extern void UART_Ch1_Send_Multiple_Byte(uint8_t *Data, uint8_t Len);
extern void UART_Ch2_Send_Multiple_Byte(uint8_t *Data, uint8_t Len);
extern void UART_Ch3_Send_Multiple_Byte(uint8_t *Data, uint8_t Len);
/*首次上30和每次唤醒时调用*/
extern uint32_t UART_Init(UART_Channel_en_t enUARTCh, UART_Channel_Config_st_t *penUARTCfg);
/*休眠时调用*/
extern void UART_Sleep_Init(UART_Channel_en_t enUARTCh);
/******************************************************/
/******************************************************/
/******************************************************/
extern void Uart_ConfigOperationMode(void);
extern unsigned char Uart_GetRxLevel(void);
extern void Uart_ClearRxFullFlag(void);
extern void Uart_SetBaudrate(unsigned long xBaudrate_u32);
extern void Uart_SetRxGpio(void);
extern void Uart_SetTxGpio(void);
extern void Uart_EnableRx(void);
extern void Uart_DisableRx(void);
extern void TJA1021_Enable(unsigned char state);
extern void Uart_EnableTx(void);
extern void Uart_ClearAllErrorFlag(void);
extern void Uart_SetData(unsigned char xBuffer_pu8);
extern unsigned short Uart_GetData(void);
extern void Uart_DisableReceiveIsrReq(void);
extern void Uart_EnableReceiveIsrReq(void);
extern void Uart_DisableTxInterrupt(void);
#endif
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