Commit 4dacfeaa authored by 郑萍's avatar 郑萍

🎉 init:删除燃油部分

parent f473ba18
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<Targets> <Targets>
<Target> <Target>
<TargetName>HaoJin232</TargetName> <TargetName>RMR42E</TargetName>
<ToolsetNumber>0x4</ToolsetNumber> <ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName> <ToolsetName>ARM-ADS</ToolsetName>
<pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed> <pCCUsed>5060960::V5.06 update 7 (build 960)::.\ARMCC</pCCUsed>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<InvalidFlash>1</InvalidFlash> <InvalidFlash>1</InvalidFlash>
</TargetStatus> </TargetStatus>
<OutputDirectory>.\Objects\</OutputDirectory> <OutputDirectory>.\Objects\</OutputDirectory>
<OutputName>HaoJin</OutputName> <OutputName>RMR42E</OutputName>
<CreateExecutable>1</CreateExecutable> <CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib> <CreateLib>0</CreateLib>
<CreateHexFile>1</CreateHexFile> <CreateHexFile>1</CreateHexFile>
...@@ -383,16 +383,6 @@ ...@@ -383,16 +383,6 @@
<Group> <Group>
<GroupName>Application</GroupName> <GroupName>Application</GroupName>
<Files> <Files>
<File>
<FileName>Data_Fuel.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\Source\Application\Fuel\Data_Fuel.c</FilePath>
</File>
<File>
<FileName>Data_Fuel.h</FileName>
<FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\Fuel\Data_Fuel.h</FilePath>
</File>
<File> <File>
<FileName>BackLight.c</FileName> <FileName>BackLight.c</FileName>
<FileType>1</FileType> <FileType>1</FileType>
...@@ -1096,19 +1086,19 @@ ...@@ -1096,19 +1086,19 @@
<component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.5.0" condition="ARMv6_7_8-M Device"> <component Cclass="CMSIS" Cgroup="CORE" Cvendor="ARM" Cversion="5.5.0" condition="ARMv6_7_8-M Device">
<package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.8.0"/> <package name="CMSIS" schemaVersion="1.3" url="http://www.keil.com/pack/" vendor="ARM" version="5.8.0"/>
<targetInfos> <targetInfos>
<targetInfo name="HaoJin232"/> <targetInfo name="RMR42E"/>
</targetInfos> </targetInfos>
</component> </component>
<component Cclass="Device" Cgroup="ISR" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"> <component Cclass="Device" Cgroup="ISR" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE">
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.5"/> <package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.5"/>
<targetInfos> <targetInfos>
<targetInfo name="HaoJin232"/> <targetInfo name="RMR42E"/>
</targetInfos> </targetInfos>
</component> </component>
<component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"> <component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE">
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.5"/> <package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.5"/>
<targetInfos> <targetInfos>
<targetInfo name="HaoJin232"/> <targetInfo name="RMR42E"/>
</targetInfos> </targetInfos>
</component> </component>
</components> </components>
...@@ -1118,7 +1108,7 @@ ...@@ -1118,7 +1108,7 @@
<component Cclass="Device" Cgroup="ISR" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/> <component Cclass="Device" Cgroup="ISR" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/> <package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/>
<targetInfos> <targetInfos>
<targetInfo name="HaoJin232"/> <targetInfo name="RMR42E"/>
</targetInfos> </targetInfos>
</file> </file>
<file attr="config" category="source" condition="Startup ARM" name="Device\Source\ARM\startup_BAT32A239.s" version="1.0.0"> <file attr="config" category="source" condition="Startup ARM" name="Device\Source\ARM\startup_BAT32A239.s" version="1.0.0">
...@@ -1126,7 +1116,7 @@ ...@@ -1126,7 +1116,7 @@
<component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/> <component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/> <package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/>
<targetInfos> <targetInfos>
<targetInfo name="HaoJin232"/> <targetInfo name="RMR42E"/>
</targetInfos> </targetInfos>
</file> </file>
<file attr="config" category="source" name="Device\Source\system_BAT32A239.c" version="1.0.0"> <file attr="config" category="source" name="Device\Source\system_BAT32A239.c" version="1.0.0">
...@@ -1134,7 +1124,7 @@ ...@@ -1134,7 +1124,7 @@
<component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/> <component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/> <package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/>
<targetInfos> <targetInfos>
<targetInfo name="HaoJin232"/> <targetInfo name="RMR42E"/>
</targetInfos> </targetInfos>
</file> </file>
<file attr="config" category="header" name="Device\Source\userdefine.h" version="1.0.0"> <file attr="config" category="header" name="Device\Source\userdefine.h" version="1.0.0">
...@@ -1142,7 +1132,7 @@ ...@@ -1142,7 +1132,7 @@
<component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/> <component Cclass="Device" Cgroup="Startup" Cvendor="Cmsemicon" Cversion="1.0.0" condition="BAT32A239 CMSIS-CORE"/>
<package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/> <package name="BAT32A239" schemaVersion="1.4" url="http://www.mcu.com.cn/pack/" vendor="Cmsemicon" version="1.0.3"/>
<targetInfos> <targetInfos>
<targetInfo name="HaoJin232"/> <targetInfo name="RMR42E"/>
</targetInfos> </targetInfos>
</file> </file>
<file attr="config" category="source" name="Device\Source\isr_BAT32A239.c" version="1.0.0"> <file attr="config" category="source" name="Device\Source\isr_BAT32A239.c" version="1.0.0">
......
/*
* Auto generated Run-Time-Environment Configuration File
* *** Do not modify ! ***
*
* Project: 'RMR42E'
* Target: 'RMR42E'
*/
#ifndef RTE_COMPONENTS_H
#define RTE_COMPONENTS_H
/*
* Define the Device Header File:
*/
#define CMSIS_device_header "BAT32A239.h"
#endif /* RTE_COMPONENTS_H */
#ifndef APPLICATION_H__ #ifndef APPLICATION_H__
#define APPLICATION_H__ #define APPLICATION_H__
#include "Fuel\Data_Fuel.h"
#include "GPIO_USER\GpioUser.h" #include "GPIO_USER\GpioUser.h"
#include "BackLight\BackLight.h" #include "BackLight\BackLight.h"
//#include "Data_VSpeed\Data_VSpeed.h"
//#include "Data_ESpeed\Data_ESpeed.h"
#include "CommonInterface\CommonInterface.h" #include "CommonInterface\CommonInterface.h"
#include "SEG_DISPLAY\SEG_DISPLAY.h" #include "SEG_DISPLAY\SEG_DISPLAY.h"
#include "SEG_DISPLAY\SEG_Ref.h" #include "SEG_DISPLAY\SEG_Ref.h"
......
#include "Data_Fuel.h"
#include "Application.h"
#define FUEL_DATA_TIME 25u /*这里填写多长时间采集一个数据,单位ms*/
#define FUEL_DATA_NUM 20u /*燃油电阻采集数据总数 最大255*/
#define FUEL_CAL_START 5u /*数据排序后取中间部分计算平均:起始*/
#define FUEL_CAL_END 15u /*数据排序后取中间部分计算平均:结束*/
#define RETURN_DIFFERENCE 25u /*判断上升或下降的回差,精度0.1*/
#define FUEL_SEG_UP 0u
#define FUEL_SEG_DOWN 1u
uint16_t FuelData[FUEL_DATA_NUM];
uint8_t FuelDataCount = 0u;
uint16_t FuelR = 0u; /*滤波后的燃油电阻,精度0.1*/
static uint16_t FuelRBak = 0;
uint8_t DesFuelSetp = 0u;
uint8_t CurFuelSetp = 0u;
uint8_t FuelInitFlag = 0u;
uint8_t FuelStateInitFlag = 0u;
uint8_t FuelDir = FUEL_SEG_UP;
FuelSensorSts_t FuelSensorState = FuelSensorNormal;
uint16_t FuelSensorNormalTime = 0u;
uint16_t FuelSensorShortTime = 0u;
uint16_t FuelSensorOpenTime = 0u;
uint8_t FuelADCompleteFlg = 0u;
void Fuel_KL30_Init(void)
{
DesFuelSetp = 0u;
CurFuelSetp = 0u;
FuelInitFlag = 1u;
FuelStateInitFlag = 1u;
FuelDir = FUEL_SEG_UP;
FuelSensorState = FuelSensorNormal;
FuelSensorNormalTime = 0u;
FuelSensorShortTime = 0u;
FuelSensorOpenTime = 0u;
FuelADCompleteFlg = 0u;
// PORT_ClrBit(Fuel_Vcc_en);
}
void Fuel_KL15_Init(void)
{
// PORT_SetBit(Fuel_Vcc_en);
DesFuelSetp = 0u;
CurFuelSetp = 0u;
FuelInitFlag = 1u;
FuelStateInitFlag = 1u;
FuelDir = FUEL_SEG_UP;
FuelSensorState = FuelSensorNormal;
FuelSensorNormalTime = 0u;
FuelSensorShortTime = 0u;
FuelSensorOpenTime = 0u;
FuelADCompleteFlg = 0u;
}
uint16_t TestFuelR = 1100u;
void Fuel_R_Cal(uint8_t deltaTime)
{
uint16_t FuelRes = 0;
uint8_t i, j;
uint32_t temp32;
static uint16_t timeCount = 0;
if(FuelStateInitFlag)
{
FuelR = ADC_Read_Signal(ADC_CH_FUEL1);
}
if (timeCount >= FUEL_DATA_TIME)
{
timeCount = 0;
if (FuelDataCount < FUEL_DATA_NUM)
{
/*获取燃油电阻*/
FuelRes = ADC_Read_Signal(ADC_CH_FUEL1);; // ADC_Read_Signal(ADC_CH_FUEL1);
/*四舍五入*/
//if (FuelRes < 32000)
//{
if (FuelRes % 10 >= 5)
{
FuelRes += 5;
}
//}
//else
//{
// FuelRes = 32000;
//}
/*由小到大插入数据*/
for (i = 0; i < FuelDataCount; i++)
{
if (FuelRes < FuelData[i])
{
break;
}
}
for (j = FuelDataCount; j > i; j--)
{
FuelData[j] = FuelData[j - 1];
}
FuelData[i] = FuelRes;
FuelDataCount++;
}
else
{
/*一组数据采集完毕,取中间部分计算平均值*/
temp32 = 0;
for (i = FUEL_CAL_START; i < FUEL_CAL_END; i++)
{
temp32 += FuelData[i];
}
FuelR = temp32 / (FUEL_CAL_END - FUEL_CAL_START);
FuelDataCount = 0;
FuelADCompleteFlg = 1;
}
}
timeCount += deltaTime;
}
void Fuel_State_Check(uint8_t deltaTime)
{
// if (FuelR < 20)
//{ /*短路 1*/
// FuelSensorOpenTime = 0;
// FuelSensorNormalTime = 0;
// if ((FuelSensorShortTime > 3000) || ((FuelStateInitFlag) && (FuelSensorShortTime > 3000)))
// {
// FuelSensorState = FuelSensorShortCircuit;
// DesFuelSetp = 0;
// CurFuelSetp = 0;
// FuelStateInitFlag = 0;
// FuelInitFlag = 1;
// FuelDir = FUEL_SEG_UP;
// }
// else
// {
// FuelSensorShortTime += deltaTime;
// }
// }
// else
if (FuelR >= 1100)
{ /*断路 320*/
FuelSensorShortTime = 0;
FuelSensorNormalTime = 0;
if ((FuelSensorOpenTime > 2800) || ((FuelStateInitFlag) && (FuelSensorOpenTime > 2800)))
{
FuelSensorState = FuelSensorOpenCircuit;
DesFuelSetp = 0;
CurFuelSetp = 5;
FuelStateInitFlag = 0;
FuelInitFlag = 1;
FuelDir = FUEL_SEG_UP;
}
else
{
FuelSensorOpenTime += deltaTime;
}
}
else
{
FuelSensorShortTime = 0;
FuelSensorOpenTime = 0;
if (FuelSensorNormalTime > 3000)
{
FuelSensorState = FuelSensorNormal;
FuelStateInitFlag = 0;
}
else
{
FuelSensorNormalTime += deltaTime;
}
}
}
void Fuel_Gauges_Cal(uint8_t deltaTime)
{
static uint16_t time = 0;
if ((FuelSensorState == FuelSensorNormal) && (FuelR < 1100))
{ // 32000 //FuelR >10 change FuelR >20
/*采集完第一组数据后,开始计算燃油格数*/
if (FuelADCompleteFlg)
{
if (FuelInitFlag)
{
FuelRBak = FuelR;
}
/*根据回差计算走动方向*/
if (FuelDir == FUEL_SEG_UP)
{
if (FuelR >= FuelRBak + RETURN_DIFFERENCE)
{
FuelDir = FUEL_SEG_DOWN;
FuelRBak = FuelR;
}
if (FuelR < FuelRBak)
{
FuelRBak = FuelR;
}
}
else
{
if (FuelRBak >= FuelR + RETURN_DIFFERENCE)
{
FuelDir = FUEL_SEG_UP;
FuelRBak = FuelR;
}
if (FuelR > FuelRBak)
{
FuelRBak = FuelR;
}
}
/*计算目标格数*/
if (FuelDir == FUEL_SEG_UP)
{
if (((DesFuelSetp == 4) || FuelInitFlag) && (FuelR < 240))
{
DesFuelSetp = 5;
}
else if (((DesFuelSetp == 3) || FuelInitFlag) && (FuelR < 430))
{
DesFuelSetp = 4;
}
else if (((DesFuelSetp == 2) || FuelInitFlag) && (FuelR < 610))
{
DesFuelSetp = 3;
}
else if (((DesFuelSetp == 1) || FuelInitFlag) && (FuelR < 790))
{
DesFuelSetp = 2;
}
else if (((DesFuelSetp == 0) || FuelInitFlag) && (FuelR < 970))
{
DesFuelSetp = 1;
}
}
else if (FuelDir == FUEL_SEG_DOWN)
{
if (((DesFuelSetp == 1) || FuelInitFlag) && (FuelR >= 970))
{
DesFuelSetp = 0;
}
else if (((DesFuelSetp == 2) || FuelInitFlag) && (FuelR >= 790))
{
DesFuelSetp = 1;
}
else if (((DesFuelSetp == 3) || FuelInitFlag) && (FuelR >= 610))
{
DesFuelSetp = 2;
}
else if (((DesFuelSetp == 4) || FuelInitFlag) && (FuelR >= 430))
{
DesFuelSetp = 3;
}
else if (((DesFuelSetp == 5) || FuelInitFlag) && (FuelR >= 240))
{
DesFuelSetp = 4;
}
}
}
/*IGN ON 1秒/故障恢复后,开始走格 立即指向当前格 20220704*/
if (Common_GetIgnOnTime() >= 3000)
{
time += deltaTime;
if (FuelInitFlag)
{
FuelInitFlag = 0;
time = 0;
CurFuelSetp = DesFuelSetp;
}
if (time >= 10000)
{ /* 10S变化一格 */
time = 0;
if (CurFuelSetp < DesFuelSetp)
{
CurFuelSetp++;
}
else if (CurFuelSetp > DesFuelSetp)
{
CurFuelSetp--;
}
}
if (CurFuelSetp == DesFuelSetp)
{
time = 0;
}
}
}
}
uint8_t Get_Fuel_Disp_Byte(void)
{
uint8_t FuelDispByte = 0u;
FuelDispByte = CurFuelSetp;
// if (FuelSensorState == FuelSensorShortCircuit)
//{
// //Short
// FuelDispByte = FLASH_SYNC_1Hz ? 7 : 0;
// }
// else if (FuelSensorState == FuelSensorOpenCircuit)
//{
// //Open
// FuelDispByte = FLASH_SYNC_1Hz ? 6 : 0;
// }
// else if (CurFuelSetp == 1)
//{
// FuelDispByte = FLASH_SYNC_1Hz ? 1 : 0;
// }
//
// else if(CurFuelSetp == 0)
//{
// FuelDispByte = 0;
// }
return FuelDispByte;
}
void Fuel_Cal_Sevice(uint8_t deltaTime)
{
/*检测燃油电阻状态*/
Fuel_State_Check(deltaTime);
/*显示燃油格*/
Fuel_Gauges_Cal(deltaTime);
}
uint8_t Get_CurFuelSetp(void)
{
return CurFuelSetp;
}
FuelSensorSts_t Get_Fuel_Sensor_State(void)
{
return FuelSensorState;
}
#ifndef DATA_FUEL_H
#define DATA_FUEL_H
#include "Components.h"
typedef enum{
FuelSensorNormal = 0,
FuelSensorShortCircuit,
FuelSensorOpenCircuit,
}FuelSensorSts_t;
extern void Fuel_KL15_Init(void);
extern void Fuel_KL30_Init(void);
extern void Fuel_Cal_Sevice(uint8_t deltaTime);
extern uint8_t Get_Fuel_Disp_Byte(void);
extern uint8_t Get_CurFuelSetp(void);
extern FuelSensorSts_t Get_Fuel_Sensor_State(void);
#endif
...@@ -169,18 +169,6 @@ void Gauge_ODO_Display(void) ...@@ -169,18 +169,6 @@ void Gauge_ODO_Display(void)
SEG_SET_ODO_NUM(0u, 0u); SEG_SET_ODO_NUM(0u, 0u);
} }
} }
void Gauge_FuelDial_Display(void)
{
if ( Common_Get_IG_Sts( ) == COMMON_POWER_ON )
{
SEG_SET_FuelDial(1, Get_CurFuelSetp());
}
else
{
SEG_SET_FuelDial(0, 0);
}
}
void Gauge_EspeedDial_Display(void) void Gauge_EspeedDial_Display(void)
{ {
if ( Common_Get_IG_Sts( ) == COMMON_POWER_ON ) if ( Common_Get_IG_Sts( ) == COMMON_POWER_ON )
...@@ -236,8 +224,6 @@ void Gauge_Service(void) ...@@ -236,8 +224,6 @@ void Gauge_Service(void)
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, 0); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, 0); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, 0); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_Fuel_W, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Fuel_Y, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, 0); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, 0);
} }
} }
...@@ -252,7 +238,6 @@ void Gauge_Service(void) ...@@ -252,7 +238,6 @@ void Gauge_Service(void)
Gauge_ODO_Display(); Gauge_ODO_Display();
Gauge_Clock_Display(); Gauge_Clock_Display();
Gauge_Trip_Display(); Gauge_Trip_Display();
Gauge_FuelDial_Display();
Gauge_EspeedDial_Display(); Gauge_EspeedDial_Display();
} }
else else
...@@ -270,8 +255,6 @@ void Gauge_Service(void) ...@@ -270,8 +255,6 @@ void Gauge_Service(void)
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, 0); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, 0); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, 0); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_Fuel_W, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Fuel_Y, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, 0); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, 0);
} }
} }
......
...@@ -49,7 +49,6 @@ void Gauge_DrivingRange_Display(void); ...@@ -49,7 +49,6 @@ void Gauge_DrivingRange_Display(void);
void Gauge_Trip_Display(void); void Gauge_Trip_Display(void);
void Gauge_ODO_Display(void); void Gauge_ODO_Display(void);
//void Gauge_Gear_Display(void); //void Gauge_Gear_Display(void);
void Gauge_FuelDial_Display(void);
void Gauge_EspeedDial_Display(void); void Gauge_EspeedDial_Display(void);
void Gauge_Frame_Display(void); void Gauge_Frame_Display(void);
void Gauge_MaintenanceMileage_Display(void); void Gauge_MaintenanceMileage_Display(void);
......
...@@ -252,131 +252,131 @@ _Fun_Res SEG_SET_GEAR(uint8_t m_Gear_Flag, uint8_t m_Gear) ...@@ -252,131 +252,131 @@ _Fun_Res SEG_SET_GEAR(uint8_t m_Gear_Flag, uint8_t m_Gear)
} }
return m_Res; return m_Res;
} }
/**@brief 燃油表盘显示函数 // /**@brief 燃油表盘显示函数
* @param[in] m_Flag 段与数字是否显示 -1 显示 -0 不显示 // * @param[in] m_Flag 段与数字是否显示 -1 显示 -0 不显示
* @param[in] m_SEG 燃油表盘段数0<=m_SEG<=5 // * @param[in] m_SEG 燃油表盘段数0<=m_SEG<=5
* @return 函数执行结果 // * @return 函数执行结果
* - EX_OK 上报成功 // * - EX_OK 上报成功
* - EX_ERR 上报失败 // * - EX_ERR 上报失败
*/ // */
_Fun_Res SEG_SET_FuelDial(uint8_t m_Flag, uint8_t m_SEG) // _Fun_Res SEG_SET_FuelDial(uint8_t m_Flag, uint8_t m_SEG)
{ // {
_Fun_Res m_Res; // _Fun_Res m_Res;
// uint8_t Num; // // uint8_t Num;
uint8_t m8; // uint8_t m8;
if ((m_Flag >= 2u) || (m_SEG > 5u)) // if ((m_Flag >= 2u) || (m_SEG > 5u))
{ // {
m_Res = EX_ERR; // m_Res = EX_ERR;
} // }
else // else
{ // {
if (m_Flag == 1u) // if (m_Flag == 1u)
{ // {
IC2_SEG049 = IC_SEG_GREY; // IC2_SEG049 = IC_SEG_GREY;
IC2_SEG048 = IC_SEG_GREY; // IC2_SEG048 = IC_SEG_GREY;
IC2_SEG052 = IC_SEG_GREY; // IC2_SEG052 = IC_SEG_GREY;
IC2_SEG107 = IC_SEG_GREY; // IC2_SEG107 = IC_SEG_GREY;
IC2_SEG108 = IC_SEG_GREY; // IC2_SEG108 = IC_SEG_GREY;
IC2_SEG060 = IC_SEG_ON; // IC2_SEG060 = IC_SEG_ON;
IC2_SEG110 = IC_SEG_ON; // IC2_SEG110 = IC_SEG_ON;
IC2_SEG111 = IC_SEG_ON; // IC2_SEG111 = IC_SEG_ON;
IC2_SEG114 = IC_SEG_ON; // IC2_SEG114 = IC_SEG_ON;
IC2_SEG113 = IC_SEG_ON; // IC2_SEG113 = IC_SEG_ON;
IC2_SEG115 = IC_SEG_ON; // IC2_SEG115 = IC_SEG_ON;
IC2_SEG106 = IC_SEG_ON; // IC2_SEG106 = IC_SEG_ON;
IC2_SEG109 = IC_SEG_ON; // IC2_SEG109 = IC_SEG_ON;
m8 = SEG_DISPLAY_NUMBER0[m_SEG]; // m8 = SEG_DISPLAY_NUMBER0[m_SEG];
if (Bit_Is_Set(m8, 0)) // if (Bit_Is_Set(m8, 0))
{ // {
IC2_SEG059 = IC_SEG_ON; // IC2_SEG059 = IC_SEG_ON;
} // }
else // else
{ // {
IC2_SEG059 = IC_SEG_OFF; // IC2_SEG059 = IC_SEG_OFF;
} // }
if (Bit_Is_Set(m8, 1)) // if (Bit_Is_Set(m8, 1))
{ // {
IC2_SEG058 = IC_SEG_ON; // IC2_SEG058 = IC_SEG_ON;
} // }
else // else
{ // {
IC2_SEG058 = IC_SEG_OFF; // IC2_SEG058 = IC_SEG_OFF;
} // }
if (Bit_Is_Set(m8, 2)) // if (Bit_Is_Set(m8, 2))
{ // {
IC2_SEG056 = IC_SEG_ON; // IC2_SEG056 = IC_SEG_ON;
} // }
else // else
{ // {
IC2_SEG056 = IC_SEG_OFF; // IC2_SEG056 = IC_SEG_OFF;
} // }
if (Bit_Is_Set(m8, 3)) // if (Bit_Is_Set(m8, 3))
{ // {
IC2_SEG055 = IC_SEG_ON; // IC2_SEG055 = IC_SEG_ON;
} // }
else // else
{ // {
IC2_SEG055 = IC_SEG_OFF; // IC2_SEG055 = IC_SEG_OFF;
} // }
if (Bit_Is_Set(m8, 5)) // if (Bit_Is_Set(m8, 5))
{ // {
IC2_SEG053 = IC_SEG_ON; // IC2_SEG053 = IC_SEG_ON;
} // }
else // else
{ // {
IC2_SEG053 = IC_SEG_OFF; // IC2_SEG053 = IC_SEG_OFF;
} // }
if (Bit_Is_Set(m8, 4)) // if (Bit_Is_Set(m8, 4))
{ // {
IC2_SEG054 = IC_SEG_ON; // IC2_SEG054 = IC_SEG_ON;
} // }
else // else
{ // {
IC2_SEG054 = IC_SEG_OFF; // IC2_SEG054 = IC_SEG_OFF;
} // }
if (Bit_Is_Set(m8, 6)) // if (Bit_Is_Set(m8, 6))
{ // {
IC2_SEG057 = IC_SEG_ON; // IC2_SEG057 = IC_SEG_ON;
} // }
else // else
{ // {
IC2_SEG057 = IC_SEG_OFF; // IC2_SEG057 = IC_SEG_OFF;
} // }
} // }
else // else
{ // {
IC2_SEG049 = IC_SEG_OFF; // IC2_SEG049 = IC_SEG_OFF;
IC2_SEG048 = IC_SEG_OFF; // IC2_SEG048 = IC_SEG_OFF;
IC2_SEG052 = IC_SEG_OFF; // IC2_SEG052 = IC_SEG_OFF;
IC2_SEG107 = IC_SEG_OFF; // IC2_SEG107 = IC_SEG_OFF;
IC2_SEG108 = IC_SEG_OFF; // IC2_SEG108 = IC_SEG_OFF;
IC2_SEG060 = IC_SEG_OFF; // IC2_SEG060 = IC_SEG_OFF;
IC2_SEG110 = IC_SEG_OFF; // IC2_SEG110 = IC_SEG_OFF;
IC2_SEG111 = IC_SEG_OFF; // IC2_SEG111 = IC_SEG_OFF;
IC2_SEG114 = IC_SEG_OFF; // IC2_SEG114 = IC_SEG_OFF;
IC2_SEG113 = IC_SEG_OFF; // IC2_SEG113 = IC_SEG_OFF;
IC2_SEG115 = IC_SEG_OFF; // IC2_SEG115 = IC_SEG_OFF;
IC2_SEG106 = IC_SEG_OFF; // IC2_SEG106 = IC_SEG_OFF;
IC2_SEG109 = IC_SEG_OFF; // IC2_SEG109 = IC_SEG_OFF;
IC2_SEG116 = IC_SEG_OFF; // IC2_SEG116 = IC_SEG_OFF;
IC2_SEG112 = IC_SEG_OFF; // IC2_SEG112 = IC_SEG_OFF;
IC2_SEG053 = IC_SEG_OFF; // IC2_SEG053 = IC_SEG_OFF;
IC2_SEG054 = IC_SEG_OFF; // IC2_SEG054 = IC_SEG_OFF;
IC2_SEG055 = IC_SEG_OFF; // IC2_SEG055 = IC_SEG_OFF;
IC2_SEG056 = IC_SEG_OFF; // IC2_SEG056 = IC_SEG_OFF;
IC2_SEG057 = IC_SEG_OFF; // IC2_SEG057 = IC_SEG_OFF;
IC2_SEG058 = IC_SEG_OFF; // IC2_SEG058 = IC_SEG_OFF;
IC2_SEG059 = IC_SEG_OFF; // IC2_SEG059 = IC_SEG_OFF;
} // }
m_Res = EX_OK; // m_Res = EX_OK;
} // }
return m_Res; // return m_Res;
} // }
/**@brief 转速表盘显示函数 /**@brief 转速表盘显示函数
* @param[in] m_Flag 段与数字是否显示 -1 显示 -0 不显示 * @param[in] m_Flag 段与数字是否显示 -1 显示 -0 不显示
...@@ -2978,21 +2978,6 @@ _Fun_Res SEG_SET_Clock(uint8_t m_hour, uint8_t m_minute, uint8_t m_icon, uint8_t ...@@ -2978,21 +2978,6 @@ _Fun_Res SEG_SET_Clock(uint8_t m_hour, uint8_t m_minute, uint8_t m_icon, uint8_t
return m_Res; return m_Res;
} }
uint8_t fuel_check_SEG_step = 0;
void SEG_Scan_SET_FuelDial(void)
{
uint8_t a = 0;
a = fuel_check_SEG_step / 10u;
SEG_SET_FuelDial(1, a);
if (fuel_check_SEG_step < 59)
{
fuel_check_SEG_step++;
}
else
{
fuel_check_SEG_step = 0;
}
}
uint8_t Espeed_check_SEG_step = 0; uint8_t Espeed_check_SEG_step = 0;
...@@ -3026,15 +3011,12 @@ uint8_t check_SEG_step = 0; ...@@ -3026,15 +3011,12 @@ uint8_t check_SEG_step = 0;
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Fuel_Y, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_Fuel_W, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, LED_ON);
// RTE_GPIO_Set_Level(VSPEED_TEN_OUT, 1); // RTE_GPIO_Set_Level(VSPEED_TEN_OUT, 1);
// RTE_GPIO_Set_Level(VSPEED_HUNDREDS_OUT, 1); // RTE_GPIO_Set_Level(VSPEED_HUNDREDS_OUT, 1);
// SEG_Scan_SET_FuelDial();
// SEG_Scan_SET_EspeedDial(); // SEG_Scan_SET_EspeedDial();
// //
//} //}
...@@ -3047,21 +3029,17 @@ void Checkself_Init(void) ...@@ -3047,21 +3029,17 @@ void Checkself_Init(void)
Checkself_SEG_step_count = 0; Checkself_SEG_step_count = 0;
check_SEG_step = 0; check_SEG_step = 0;
Espeed_check_SEG_step = 0; Espeed_check_SEG_step = 0;
fuel_check_SEG_step = 0;
} }
void Checkself_SEG_Display(void) void Checkself_SEG_Display(void)
{ {
uint16_t Vspeed = 0; uint16_t Vspeed = 0;
uint16_t Espeed = 0; uint16_t Espeed = 0;
uint16_t Fuel = 0;
uint16_t Trip = 0; uint16_t Trip = 0;
uint16_t hour = 0; uint16_t hour = 0;
uint16_t min = 0; uint16_t min = 0;
uint32_t ODO = 0; uint32_t ODO = 0;
Fuel = Checkself_SEG_step / 5u;
SEG_SET_FuelDial(1, Fuel);
Espeed = (Checkself_SEG_step * 2 / 5) * 1000; Espeed = (Checkself_SEG_step * 2 / 5) * 1000;
SEG_SET_EspeedDial(1, Espeed / 1000, Espeed); SEG_SET_EspeedDial(1, Espeed / 1000, Espeed);
......
...@@ -9,7 +9,6 @@ typedef enum ...@@ -9,7 +9,6 @@ typedef enum
{ {
SEG_LED_Voltage = 0u, SEG_LED_Voltage = 0u,
SEG_LED_Auto_Start_Stop, SEG_LED_Auto_Start_Stop,
SEG_LED_Fuel,
SEG_LED_MAX SEG_LED_MAX
...@@ -32,8 +31,8 @@ _Fun_Res SEG_SET_GEAR(uint8_t m_Gear_Flag,uint8_t m_Gear); ...@@ -32,8 +31,8 @@ _Fun_Res SEG_SET_GEAR(uint8_t m_Gear_Flag,uint8_t m_Gear);
/**@brief 电量表盘显示函数*/ /**@brief 电量表盘显示函数*/
_Fun_Res SEG_SET_EleDial(uint8_t m_Flag,uint8_t m_SEG,uint8_t m_NUM); _Fun_Res SEG_SET_EleDial(uint8_t m_Flag,uint8_t m_SEG,uint8_t m_NUM);
/**@brief 燃油表盘显示函数*/ // /**@brief 燃油表盘显示函数*/
_Fun_Res SEG_SET_FuelDial(uint8_t m_Flag,uint8_t m_SEG); // _Fun_Res SEG_SET_FuelDial(uint8_t m_Flag,uint8_t m_SEG);
/**@brief 转速表盘显示函数*/ /**@brief 转速表盘显示函数*/
_Fun_Res SEG_SET_EspeedDial(uint8_t m_Flag, uint8_t m_SEG, uint16_t m_NUM); _Fun_Res SEG_SET_EspeedDial(uint8_t m_Flag, uint8_t m_SEG, uint16_t m_NUM);
...@@ -74,7 +73,6 @@ _Fun_Res SEG_SET_LED_STS(uint8_t LED_NUM , uint8_t m_Flag); ...@@ -74,7 +73,6 @@ _Fun_Res SEG_SET_LED_STS(uint8_t LED_NUM , uint8_t m_Flag);
_Fun_Res SEG_Scan_SET_EleDial(uint8_t m_SEG); _Fun_Res SEG_Scan_SET_EleDial(uint8_t m_SEG);
_Fun_Res SEG_Scan_SET_PowerDial(uint8_t m_SEG); _Fun_Res SEG_Scan_SET_PowerDial(uint8_t m_SEG);
void SEG_Scan_SET_FuelDial(void);
void SEG_Scan_SET_EspeedDial(void); void SEG_Scan_SET_EspeedDial(void);
extern void Checkself_Init (void); extern void Checkself_Init (void);
......
...@@ -30,8 +30,6 @@ enum ADCChName ...@@ -30,8 +30,6 @@ enum ADCChName
{ {
ADC_CH_KL30_VOLTAGE = 0, ADC_CH_KL30_VOLTAGE = 0,
ADC_CH_KL15_VOLTAGE, ADC_CH_KL15_VOLTAGE,
ADC_CH_FUEL_VREF,
ADC_CH_FUEL1,
}; };
/* Exported macro ------------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/
......
...@@ -52,25 +52,17 @@ static void Power_KL30_Init(void) ...@@ -52,25 +52,17 @@ static void Power_KL30_Init(void)
BackLight_Init(); BackLight_Init();
Sys_KL30_Init(); Sys_KL30_Init();
Checkself_Init(); Checkself_Init();
// Data_Vehicle_Speed_KL30_Init();
// Data_Engine_Speed_KL30_Wakeup_Init();
LINE_IN_Init(); LINE_IN_Init();
// Key_KL30_Init_EXample();
Light_Sensor_Init_Example();//注意顺序1 Light_Sensor_Init_Example();//注意顺序1
LED_Driver_Init_Example();//注意顺序2 LED_Driver_Init_Example();//注意顺序2
Data_User_Mileage_KL30Init(); Data_User_Mileage_KL30Init();
Fuel_KL30_Init();
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000); TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000); TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHB, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHB, ActiveLevel_High);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHC, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHC, ActiveLevel_High);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHD, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHD, ActiveLevel_High);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER1, TIMERM_CHB, ActiveLevel_High);
// Telltales_Auto_Start_Stop();
Telltales_Init(); Telltales_Init();
// MenuData_Unit_Init();
g_stRTCInformation.u8RTCSecond = 0; g_stRTCInformation.u8RTCSecond = 0;
g_stRTCInformation.u8RTCMinute = 0; g_stRTCInformation.u8RTCMinute = 0;
g_stRTCInformation.u8RTCHour = 0; g_stRTCInformation.u8RTCHour = 0;
...@@ -94,19 +86,12 @@ static void Power_Wakeup_Init(void) ...@@ -94,19 +86,12 @@ static void Power_Wakeup_Init(void)
BU98R10_Init(); BU98R10_Init();
BackLight_Init(); BackLight_Init();
Sys_WakeUp_Init(); Sys_WakeUp_Init();
// Data_Vehicle_Speed_KL30_Init();
// Data_Vehicle_Speed_Wakeup_Init();
// Data_Engine_Speed_KL30_Wakeup_Init();
LINE_IN_Init(); LINE_IN_Init();
// Key_KL30_Init_EXample();
Line_In_KL15_ON_Init(); Line_In_KL15_ON_Init();
Light_Sensor_Init_Example();//注意顺序1 Light_Sensor_Init_Example();//注意顺序1
LED_Driver_Init_Example();//注意顺序2 LED_Driver_Init_Example();//注意顺序2
Fuel_KL30_Init();
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000); TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000); TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHB, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHB, ActiveLevel_High);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHC, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHC, ActiveLevel_High);
TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHD, ActiveLevel_High); TimerM_PWM_CH_Output_init(TIMERM_COUNTER0, TIMERM_CHD, ActiveLevel_High);
...@@ -136,8 +121,6 @@ static void Power_IG_ON_Init(void) ...@@ -136,8 +121,6 @@ static void Power_IG_ON_Init(void)
Checkself_Init(); Checkself_Init();
Line_In_KL15_ON_Init(); Line_In_KL15_ON_Init();
Telltales_KL15_Init(); Telltales_KL15_Init();
Fuel_KL15_Init();
// Telltales_Auto_Start_Stop();
} }
static void Power_Sleep_Init(void) static void Power_Sleep_Init(void)
......
...@@ -41,11 +41,8 @@ void Sys_5ms_Tasks(void) ...@@ -41,11 +41,8 @@ void Sys_5ms_Tasks(void)
void Sys_10ms_Tasks(void) void Sys_10ms_Tasks(void)
{ {
Line_In_Debounce_Service(10u); Line_In_Debounce_Service(10u);
// Key_Service();
Data_Mileage_Write_EEPROM(); Data_Mileage_Write_EEPROM();
Can_BusOff_Recover(10u); Can_BusOff_Recover(10u);
// Turn_Left_Right_Lamp();
// Fuel_R_Cal(10u);
TYW_Check_Count(); TYW_Check_Count();
} }
...@@ -75,7 +72,6 @@ void Sys_100ms_Tasks(void) ...@@ -75,7 +72,6 @@ void Sys_100ms_Tasks(void)
// counter_val.time.RTC_Hours = RTC_Bcd2ToByte(counter_val.time.RTC_Hours); // counter_val.time.RTC_Hours = RTC_Bcd2ToByte(counter_val.time.RTC_Hours);
// counter_val.time.RTC_Minutes = RTC_Bcd2ToByte(counter_val.time.RTC_Minutes); // counter_val.time.RTC_Minutes = RTC_Bcd2ToByte(counter_val.time.RTC_Minutes);
// } // }
Fuel_Cal_Sevice(100u);
BackLight_Process(); BackLight_Process();
Interact_Light_Process(); Interact_Light_Process();
// Services_Mileage_Callback(); // Services_Mileage_Callback();
......
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