Commit 7c419289 authored by hu's avatar hu

增加气压表配置功能

parent e6df2277
No preview for this file type
This diff is collapsed.
project .intvect 1536 project .intvect 1536
project .text 297644 project .text 297884
project .rodata 412311 project .rodata 412311
project .secinfo 120 project .secinfo 120
project .syscall 6 project .syscall 6
......
...@@ -4,27 +4,26 @@ ...@@ -4,27 +4,26 @@
#include "CAN_Communication_Matrix.h" #include "CAN_Communication_Matrix.h"
#include "RTE_ADC.h" #include "RTE_ADC.h"
//------------------------------------------- #include "Common_Interface.h"
//主负气压 数据处理 wangboyu
//-------------------------------------------
//断码显示 //断码显示
//------------------------------------------- //-------------------------------------------
//344 - 3.1.2.FRONT/REAR空气计显示 //344 - 3.1.2.FRONT/REAR空气计显示
//342 - 3.3. FRONT/REAR气压指针 //342 - 3.3. FRONT/REAR气压指针
//------------------------------------------- //-------------------------------------------
#define PRI_ID 0 #define PRI_ID 0
#define SEC_ID 1 #define SEC_ID 1
#define TableLenMax 6u #define TableLenMax 6u
#define EnTable 0 // 0 - 计算 1 - 查表 #define EnTable 0 // 0 - 计算 1 - 查表
#define VALID_TIME 100 // 2S #define VALID_TIME 100 // 2S
static struct static struct
{ {
uint8_t SumCnt ; uint8_t SumCnt ;
uint32_t Voltage ; uint32_t Voltage ;
uint16_t Result ; uint16_t Result ;
} AirPressureFilter[2u] ; } AirPressureFilter[2u] ;
...@@ -57,23 +56,23 @@ void AirPressure_KL30_Init(void) ...@@ -57,23 +56,23 @@ void AirPressure_KL30_Init(void)
{ {
uint8_t i = 0 ; uint8_t i = 0 ;
uint32_t u32slope = 0 ; uint32_t u32slope = 0 ;
AirPressureVariable.VoltageTable[ 0 ] = 500 ; AirPressureVariable.VoltageTable[ 0 ] = 500 ;
AirPressureVariable.kPaTable[ 0 ] = 0 ; AirPressureVariable.kPaTable[ 0 ] = 0 ;
AirPressureVariable.VoltageTable[ 1 ] = 1750 ; AirPressureVariable.VoltageTable[ 1 ] = 1750 ;
AirPressureVariable.kPaTable[ 1 ] = 500 ; AirPressureVariable.kPaTable[ 1 ] = 500 ;
AirPressureVariable.VoltageTable[ 2 ] = 1960 ; AirPressureVariable.VoltageTable[ 2 ] = 1960 ;
AirPressureVariable.kPaTable[ 2 ] = 583 ; AirPressureVariable.kPaTable[ 2 ] = 583 ;
AirPressureVariable.VoltageTable[ 3 ] = 2000 ; AirPressureVariable.VoltageTable[ 3 ] = 2000 ;
AirPressureVariable.kPaTable[ 3 ] = 600 ; AirPressureVariable.kPaTable[ 3 ] = 600 ;
AirPressureVariable.VoltageTable[ 4 ] = 3000 ; AirPressureVariable.VoltageTable[ 4 ] = 3000 ;
AirPressureVariable.kPaTable[ 4 ] = 1000 ; AirPressureVariable.kPaTable[ 4 ] = 1000 ;
AirPressureVariable.VoltageTable[ 5 ] = 4250 ; AirPressureVariable.VoltageTable[ 5 ] = 4250 ;
AirPressureVariable.kPaTable[ 5 ] = 1500 ; AirPressureVariable.kPaTable[ 5 ] = 1500 ;
for (i = 0; i < (TableLenMax - 1); i ++) for (i = 0; i < (TableLenMax - 1); i ++)
...@@ -256,8 +255,22 @@ void AirPressure_AdcData_Filter(void) ...@@ -256,8 +255,22 @@ void AirPressure_AdcData_Filter(void)
uint16_t PriVoltage = 0 ; uint16_t PriVoltage = 0 ;
uint16_t SecVoltage = 0 ; uint16_t SecVoltage = 0 ;
u8PriValid = RTE_Read_PRIMARY_AIR_Valid(); if ((K_Line_Set.K_Line_LID42 == 0x00) || (K_Line_Set.K_Line_LID42 == 0x02))
u8SecValid = RTE_Read_SECONDARY_AIR_Valid(); {
u8PriValid = RTE_Read_PRIMARY_AIR_Valid();
u8SecValid = RTE_Read_SECONDARY_AIR_Valid();
}
else if ((K_Line_Set.K_Line_LID42 == 0x01) || (K_Line_Set.K_Line_LID42 == 0x03))
{
u8PriValid = RTE_Read_SECONDARY_AIR_Valid();
u8SecValid = RTE_Read_PRIMARY_AIR_Valid();
}
else /*配置无效时*/
{
u8PriValid = RTE_Read_PRIMARY_AIR_Valid();
u8SecValid = RTE_Read_SECONDARY_AIR_Valid();
}
if (u8PriValid) if (u8PriValid)
{ {
if (AirPressureFilter[PRI_ID].SumCnt < 10) if (AirPressureFilter[PRI_ID].SumCnt < 10)
......
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