Commit 3d26f834 authored by hu's avatar hu

增加段码1-9显示

parent 1b397935
...@@ -153,7 +153,7 @@ void TYW_Data_ODO_Clear(void) ...@@ -153,7 +153,7 @@ void TYW_Data_ODO_Clear(void)
Get_Data_Rev_value = GetGaugesCurrentPos(RevGauges) ; Get_Data_Rev_value = GetGaugesCurrentPos(RevGauges) ;
Get_Data_Rev_valueMax = GetGaugesMaxOutVal(RevGauges) ; Get_Data_Rev_valueMax = GetGaugesMaxOutVal(RevGauges) ;
if (( Get_Data_Veh_value >= Get_Data_Veh_valueMax ) && ( Get_Data_Rev_value >= Get_Data_Rev_valueMax )) //if (( Get_Data_Veh_value >= Get_Data_Veh_valueMax ) && ( Get_Data_Rev_value >= Get_Data_Rev_valueMax ))
{ {
Data_Mileage_Clear(); Data_Mileage_Clear();
} }
......
...@@ -11,12 +11,22 @@ ...@@ -11,12 +11,22 @@
#include "DisplaySch_user.h" #include "DisplaySch_user.h"
#include "TYW_stdint.h" #include "TYW_stdint.h"
#include "FlashCheckSum.h"
#include "Watchdog.h"
#include "jcua.h"
#include "r_wm_api.h"
#include "Graphic.h"
#include "BU98R10.h"
#include "Telltales.h"
#include "Telltales_user.h"
#define PRI_SEG_NUM_MAX 17U #define PRI_SEG_NUM_MAX 17U
#define SEC_SEG_NUM_MAX 17U #define SEC_SEG_NUM_MAX 17U
#define COOLANT_SEG_NUM_MAX 12U #define COOLANT_SEG_NUM_MAX 12U
#define FUEL_SEG_NUM_MAX 12U #define FUEL_SEG_NUM_MAX 12U
#define TACHO_SEG_NUM_MAX 27U #define TACHO_SEG_NUM_MAX 27U
#define VEH_SEG_NUM_MAX 30U #define VEH_SEG_NUM_MAX 30U
extern uint32_t SelfdiagnosisTime;
static void Seg_General_Digit_Display(uint32_t Digit, uint8_t Len, uint8_t Blank, uint8_t *DigitBuf, uint8_t *Reg); static void Seg_General_Digit_Display(uint32_t Digit, uint8_t Len, uint8_t Blank, uint8_t *DigitBuf, uint8_t *Reg);
static void Seg_Digit_1_Disp(uint8_t Digit); static void Seg_Digit_1_Disp(uint8_t Digit);
...@@ -1194,114 +1204,139 @@ void Seg_Display_OFF(void) ...@@ -1194,114 +1204,139 @@ void Seg_Display_OFF(void)
} }
} }
/*
static void BU98R10_All_ReadRam(uint8_t addr, uint8_t *data0, uint8_t *data1)
{
uint8_t i;
uint8_t Cmd = 0x09;
uint8_t wdata0 = 0;
uint8_t wdata1 = 0;
SegLCD_AllChip_Write(BU98R10_CMD, BU98R10_CMD_ADSET, BU98R10_CMD_ADSET, BU98R10_CMD_ADSET); uint8_t Flash_time = 0;
SegLCD_AllChip_Write(BU98R10_DATA, addr, addr, addr); uint16_t Color_Time = 0;// 20 更换一次颜色
Cmd = 0x09; void Gui_Display_Test(void)
// D/C = 0,表示发送命令 {
SegLCD_Set_SD(0); uint16_t Get_Data_Veh_value = 0u ;
SegLCD_Set_SCL(0); uint16_t Get_Data_Rev_value = 0u ;
SegLCD_Set_CSB(0); uint16_t Get_Data_Veh_valueMax = 0u;
uint16_t Get_Data_Rev_valueMax = 0u;
uint32_t TmpRet = 0;
Bu98R10_Delay(Bu98R10_Delay_TIME); /*获取的是步数,与当前步数*/
SegLCD_Set_SCL(1); Get_Data_Veh_value = GetGaugesCurrentPos(VehGauges) ;
Get_Data_Veh_valueMax = GetGaugesMaxOutVal(VehGauges) ;
for (i = 0; i < 8; i++) Get_Data_Rev_value = GetGaugesCurrentPos(RevGauges) ;
{ Get_Data_Rev_valueMax = GetGaugesMaxOutVal(RevGauges) ;
SegLCD_Set_SCL(0);
if (Cmd & 0x80) //if (( Get_Data_Veh_value >= Get_Data_Veh_valueMax ) && ( Get_Data_Rev_value >= Get_Data_Rev_valueMax ))
{ {
SegLCD_Set_SD(1); while (1)
}
else
{ {
SegLCD_Set_SD(0); WDT_Clear();
}
Bu98R10_Delay(Bu98R10_Delay_TIME);
SegLCD_Set_SCL(1);
Cmd <<= 1;
}
SegLCD_Set_SD_Dir(0);
SegLCD_Set_SCL(0); if (Flash_time < 30)
Bu98R10_Delay(Bu98R10_Delay_TIME); {
Flash_time++;
}
else
{
if (Color_Time >= 0 && Color_Time < 20)
{
//蓝色
Loc_Display_Red(0, 0, 0XFF);
}
else if (Color_Time >= 20 && Color_Time < 40)
{
//绿色
Loc_Display_Red(0, 0XFF, 0);
}
else if (Color_Time >= 40 && Color_Time < 60)
{
//黄色
Loc_Display_Red(0xFF, 0XFF, 0);
}
else if (Color_Time >= 60 && Color_Time < 80)
{
//红色
Loc_Display_Red(0XFF, 0, 0);
}
else if (Color_Time >= 80 && Color_Time < 100)
{
//黑色
Loc_Display_Red(0, 0, 0);
}
else if (Color_Time >= 100 && Color_Time < 120)
{
//白色
Loc_Display_Red(0xFF, 0xFF, 0XFF);
}
else if (Flash_time == 30)
{
Flash_time = 250;
SegLCD_Set_SCL(1); TmpRet = CheckSpiFlashCRC();
Bu98R10_Delay(Bu98R10_Delay_TIME);
for (i = 0; i < 8; i++) if (TmpRet == 0)
{ {
SegLCD_Set_SCL(0); Loc_Display_Red(0XFF, 0, 0);
wdata0 <<= 1; }
wdata1 <<= 1; else
SegLCD_Set_SCL(1); {
//检验正常。恢复显示正常界面
if (Color_Time == 120)
{
Loc_Display_Red(1, 1, 1);
Flash_time = 0;
Color_Time = 0;
break;
}
}
}
if (SegLCD_Get_SD0_Data) if (Color_Time < 120)
{ {
wdata0 |= SegLCD_Get_SD0_Data; Color_Time++;
} }
if (SegLCD_Get_SD1_Data) }
{
wdata1 |= SegLCD_Get_SD1_Data;
} }
} }
*data0 = wdata0;
*data1 = wdata1;
SegLCD_Set_SD_Dir(1);
SegLCD_Set_CSB(1);
} }
uint8_t checkInterval = 0; uint8_t aaa = 0;
uint8_t checkCount = 0; extern uint8_t BackOdoFlagSta ;
uint8_t checkData[2]; void Gui_9810_Test(void)
void checkSegTftState(void)
{ {
uint32_t PowerStatus = 0u; static uint8_t Time = 0;
PowerStatus = Common_Get_IG_Sts();
if (PowerStatus == COMMON_POWER_ON) if (Time == 0)
{ {
checkInterval++; Time = 100;
if (checkInterval >= 5)
{
BU98R10_All_ReadRam(30, &checkData[0], &checkData[1]);
checkInterval = 0;
if ((checkData[1] & 0x0f) != 0x07) SEG_A25_Disp(7u); /*左侧弧线*/
{ SEG_C25_Disp(7u); /*右侧弧线*/
checkCount = 50;
} SEG_PRI_Display (20 , GUI_DISP_MODE_NORMAL, 7u); /*PRI气压格*/
} SEG_SEC_Display (20 , GUI_DISP_MODE_NORMAL, 7u); /*SEC气压格*/
if (checkCount) SEG_Coolant_Display (12 , GUI_DISP_MODE_NORMAL, 7u); /*水温格*/
SEG_Fuel_Display (12 , GUI_DISP_MODE_NORMAL, 7u); /*燃油格*/
SEG_Tacho_Display (27 , GUI_DISP_MODE_NORMAL, 7u); /*转速格*/
SEG_VehicleSpeed_Display(30 , GUI_DISP_MODE_NORMAL, 7u); /*车速格*/
if (aaa == 10)
{ {
checkCount--; aaa = 11;
} }
if (checkCount == 30) Seg_Digit_1_Disp(aaa);
Seg_Digit_2_Disp(aaa);
Seg_Digit_3_Disp(aaa);
if (aaa >= 12)
{ {
BU98R10_Init(); BackOdoFlagSta = 0;
aaa = 0;
Time = 0;
} }
aaa++;
} }
else else
{ {
checkInterval = 0; Time --;
checkCount = 0;
} }
} }
*/ \ No newline at end of file
\ No newline at end of file
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
#define _SEG_DISPLAY_H_ #define _SEG_DISPLAY_H_
#include "Seg_Ref.h" #include "Seg_Ref.h"
void SEG_A25_Disp(uint8_t seg_status);
void SEG_C25_Disp(uint8_t seg_status);
void SEG_LED_INTER_DIFF_LOCK_T(uint8_t seg_status); void SEG_LED_INTER_DIFF_LOCK_T(uint8_t seg_status);
void SEG_LED_FOUR_MUL_FOUR_T(uint8_t seg_status); void SEG_LED_FOUR_MUL_FOUR_T(uint8_t seg_status);
void SEG_LED_EXH_BRAKE_T(uint8_t seg_status); void SEG_LED_EXH_BRAKE_T(uint8_t seg_status);
...@@ -48,5 +49,8 @@ extern void Seg_Display_Service(void); ...@@ -48,5 +49,8 @@ extern void Seg_Display_Service(void);
extern void Seg_Display_ON(void); extern void Seg_Display_ON(void);
extern void Seg_Display_OFF(void); extern void Seg_Display_OFF(void);
void Gui_Display_Test(void);
void Gui_9810_Test(void);
#endif #endif
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "Common_Interface.h" #include "Common_Interface.h"
static uint8_t L12_Air_Sta ; static uint8_t L12_Air_Sta ;
extern uint8_t BackOdoFlagSta;
TelltaleLRCtrlStruct TelltaleLRCtrl; TelltaleLRCtrlStruct TelltaleLRCtrl;
...@@ -928,7 +929,7 @@ uint8_t LED_AEBS_OFF_L_Judgement(void) ...@@ -928,7 +929,7 @@ uint8_t LED_AEBS_OFF_L_Judgement(void)
} }
void LED_AEBS_OFF_L_Execution(uint8_t led_status) void LED_AEBS_OFF_L_Execution(uint8_t led_status)
{ {
if (K_Line_Set.K_Line_LID28 == 0x01u) if ((K_Line_Set.K_Line_LID28 == 0x01u) || (BackOdoFlagSta == 1))
{ {
if (led_status == 1) if (led_status == 1)
{ {
...@@ -992,7 +993,7 @@ uint8_t LED_LDWS_L_Judgement(void) ...@@ -992,7 +993,7 @@ uint8_t LED_LDWS_L_Judgement(void)
} }
void LED_LDWS_L_Execution(uint8_t led_status) void LED_LDWS_L_Execution(uint8_t led_status)
{ {
if (K_Line_Set.K_Line_LID27 == 0x01u) if ((K_Line_Set.K_Line_LID27 == 0x01u) || (BackOdoFlagSta == 1))
{ {
if (led_status == 1) if (led_status == 1)
{ {
...@@ -1248,7 +1249,7 @@ uint8_t LED_TPMS_L_Judgement(void) ...@@ -1248,7 +1249,7 @@ uint8_t LED_TPMS_L_Judgement(void)
} }
void LED_TPMS_L_Execution(uint8_t led_status) void LED_TPMS_L_Execution(uint8_t led_status)
{ {
if (K_Line_Set.K_Line_LID3E == 0x01u) if ((K_Line_Set.K_Line_LID3E == 0x01u) || (BackOdoFlagSta == 1))
{ {
if (led_status == 1) if (led_status == 1)
{ {
...@@ -1301,7 +1302,7 @@ uint8_t LED_ASR_or_EVSC_OFF_L_Judgement(void) ...@@ -1301,7 +1302,7 @@ uint8_t LED_ASR_or_EVSC_OFF_L_Judgement(void)
} }
void LED_ASR_or_EVSC_OFF_L_Execution(uint8_t led_status) void LED_ASR_or_EVSC_OFF_L_Execution(uint8_t led_status)
{ {
if (K_Line_Set.K_Line_LID22 == 0x01u) if ((K_Line_Set.K_Line_LID22 == 0x01u) || (BackOdoFlagSta == 1))
{ {
if (led_status == 1) if (led_status == 1)
{ {
...@@ -1504,7 +1505,7 @@ uint8_t LED_AMT_L_Judgement(void) ...@@ -1504,7 +1505,7 @@ uint8_t LED_AMT_L_Judgement(void)
} }
void LED_AMT_L_Execution(uint8_t led_status) void LED_AMT_L_Execution(uint8_t led_status)
{ {
if (K_Line_Set.K_Line_LID41 == 0x13u) if ((K_Line_Set.K_Line_LID41 == 0x13u) || (BackOdoFlagSta == 1))
{ {
if (led_status == 1) if (led_status == 1)
{ {
......
...@@ -35,8 +35,6 @@ ...@@ -35,8 +35,6 @@
#include "GPIO.h" #include "GPIO.h"
#include "DisplaySch_user.h" #include "DisplaySch_user.h"
#include "DispSch.h" #include "DispSch.h"
#include "FlashCheckSum.h"
#include "Graphic.h"
#pragma alignvar(8) #pragma alignvar(8)
uint32_t EolNUM[10u][8u]; uint32_t EolNUM[10u][8u];
...@@ -10324,95 +10322,3 @@ void Common_Set_DTCNumTime(uint32_t Vol) ...@@ -10324,95 +10322,3 @@ void Common_Set_DTCNumTime(uint32_t Vol)
DTCNumTime = Vol; DTCNumTime = Vol;
DTCDispNum = Vol; DTCDispNum = Vol;
} }
uint8_t Flash_time = 0;
uint16_t Color_Time = 0;// 20 更换一次颜色
void Gui_Display_Test(void)
{
uint16_t Get_Data_Veh_value = 0u ;
uint16_t Get_Data_Rev_value = 0u ;
uint16_t Get_Data_Veh_valueMax = 0u;
uint16_t Get_Data_Rev_valueMax = 0u;
uint32_t TmpRet = 0;
/*获取的是步数,与当前步数*/
Get_Data_Veh_value = GetGaugesCurrentPos(VehGauges) ;
Get_Data_Veh_valueMax = GetGaugesMaxOutVal(VehGauges) ;
Get_Data_Rev_value = GetGaugesCurrentPos(RevGauges) ;
Get_Data_Rev_valueMax = GetGaugesMaxOutVal(RevGauges) ;
if (( Get_Data_Veh_value >= Get_Data_Veh_valueMax ) && ( Get_Data_Rev_value >= Get_Data_Rev_valueMax ))
{
while (1)
{
WDT_Clear();
if (Flash_time < 30)
{
Flash_time++;
}
else
{
if (Color_Time >= 0 && Color_Time < 20)
{
//蓝色
Loc_Display_Red(0, 0, 0XFF);
}
else if (Color_Time >= 20 && Color_Time < 40)
{
//绿色
Loc_Display_Red(0, 0XFF, 0);
}
else if (Color_Time >= 40 && Color_Time < 60)
{
//黄色
Loc_Display_Red(0xFF, 0XFF, 0);
}
else if (Color_Time >= 60 && Color_Time < 80)
{
//红色
Loc_Display_Red(0XFF, 0, 0);
}
else if (Color_Time >= 80 && Color_Time < 100)
{
//黑色
Loc_Display_Red(0, 0, 0);
}
else if (Color_Time >= 100 && Color_Time < 120)
{
//白色
Loc_Display_Red(0xFF, 0xFF, 0XFF);
}
else if (Flash_time == 30)
{
Flash_time = 250;
TmpRet = CheckSpiFlashCRC();
if (TmpRet == 0)
{
Loc_Display_Red(0XFF, 0, 0);
}
else
{
//检验正常。恢复显示正常界面
if (Color_Time == 120)
{
Loc_Display_Red(1, 1, 1);
Flash_time = 0;
Color_Time = 0;
break;
}
}
}
if (Color_Time < 120)
{
Color_Time++;
}
}
}
}
}
\ No newline at end of file
...@@ -556,7 +556,6 @@ void K_LINE_EOL_Val_Server(void); /**/ ...@@ -556,7 +556,6 @@ void K_LINE_EOL_Val_Server(void); /**/
void Common_Set_MenuDTCNumTime(uint32_t Vol); void Common_Set_MenuDTCNumTime(uint32_t Vol);
void Common_Set_DTCNumTime(uint32_t Vol); void Common_Set_DTCNumTime(uint32_t Vol);
void Gui_Display_Test(void);
/*-----报警--------------------------------------------------------*/ /*-----报警--------------------------------------------------------*/
void GUI_General_Popup(void); void GUI_General_Popup(void);
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "Menu.h" #include "Menu.h"
#include "jcua.h" #include "jcua.h"
#include "kwp2000_service.h" #include "kwp2000_service.h"
#include "SEG_DISPLAY.h"
uint32_t EnterTimer[10]; uint32_t EnterTimer[10];
uint8_t UE_EN[Display_MAX]; uint8_t UE_EN[Display_MAX];
......
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
#include "GenDelay.h" #include "GenDelay.h"
static uint32_t K_Line1ms_count; static uint32_t K_Line1ms_count;
extern uint8_t BackOdoFlagSta;
/******************************************************************************* /*******************************************************************************
* * * *
* 系统常规运行模式(SYS_MODE_OFF / SYS_MODE_ON / SYS_MODE_STANDBY )任务列表 * * 系统常规运行模式(SYS_MODE_OFF / SYS_MODE_ON / SYS_MODE_STANDBY )任务列表 *
...@@ -174,7 +174,7 @@ void Sys_Run_Mode_10ms_Tasks(void) ...@@ -174,7 +174,7 @@ void Sys_Run_Mode_10ms_Tasks(void)
Line_In_Debounce_Service(); Line_In_Debounce_Service();
Telltales_Left_Right_Management_Service(); Telltales_Left_Right_Management_Service();
if (MenuFlag.Menu_Popup_Flag == 4u) if ((MenuFlag.Menu_Popup_Flag == 4u) || (BackOdoFlagSta == 1))
{ {
Test_LED_AllLight(); Test_LED_AllLight();
} }
...@@ -210,7 +210,14 @@ void Sys_Run_Mode_20ms_Tasks(void) ...@@ -210,7 +210,14 @@ void Sys_Run_Mode_20ms_Tasks(void)
Voltmeter_Processing_Service(); Voltmeter_Processing_Service();
Sound_Management_Service(); Sound_Management_Service();
CD4051B_Debounce_Service(); CD4051B_Debounce_Service();
Seg_Display_Service(); /*段码显示逻辑*/ if (BackOdoFlagSta == 0)
{
Seg_Display_Service(); /*段码显示逻辑*/
}
else
{
Gui_9810_Test();
}
Seg_Buffer_Commit(); Seg_Buffer_Commit();
BU98R10_Update_Request(); BU98R10_Update_Request();
} }
......
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