Commit c477b0fe authored by hu's avatar hu

调整硬线消抖时间

parent c73e1db2
...@@ -43,39 +43,39 @@ LINE_IN_TriggerLevel_en_t LINE_IN_Get_A20(void); /*A20 */ ...@@ -43,39 +43,39 @@ LINE_IN_TriggerLevel_en_t LINE_IN_Get_A20(void); /*A20 */
const Line_In_Attribute_st_t g_stLineInAttribute[LINE_IN_MAX] = const Line_In_Attribute_st_t g_stLineInAttribute[LINE_IN_MAX] =
{ {
/*指示灯信号 硬线输入*/ /*指示灯信号 硬线输入*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ABS,}, /*A22 ABS*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ABS,}, /*A22 ABS*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_PARK_BRAKE,}, /*A23 PARK BRAKE*/ { LINE_IN_LEVEL_LOW, 500U, 0U, LINE_IN_IG_ON, LINE_IN_Get_PARK_BRAKE,}, /*A23 PARK BRAKE*/
{ LINE_IN_LEVEL_HIGH, 60U, 0U, LINE_IN_IG_ON, LINE_IN_Get_HI_BEAM,}, /*A25 HI BEAM*/ { LINE_IN_LEVEL_HIGH, 60U, 0U, LINE_IN_IG_ON, LINE_IN_Get_HI_BEAM,}, /*A25 HI BEAM*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_BRAKE_AIR_EBS,}, /*A28 BRAKE AIR/EBS*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_BRAKE_AIR_EBS,}, /*A28 BRAKE AIR/EBS*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_SEAT_BELT,}, /*A30 SEAT BELT*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_SEAT_BELT,}, /*A30 SEAT BELT*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_MIL,}, /*A31 MIL*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_MIL,}, /*A31 MIL*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ENG_OIL,}, /*A32 ENG OIL*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ENG_OIL,}, /*A32 ENG OIL*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_CHARGE,}, /*A34 CHARGE*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_CHARGE,}, /*A34 CHARGE*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_TRAILER_ABS_INFO,}, /*B03 TRAILER ABS INFO*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_TRAILER_ABS_INFO,}, /*B03 TRAILER ABS INFO*/
{ LINE_IN_LEVEL_HIGH, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_Rr_FOG_LAMP,}, /*B14 Rr FOG LAMP*/ { LINE_IN_LEVEL_HIGH, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_Rr_FOG_LAMP,}, /*B14 Rr FOG LAMP*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ACC_AIR,}, /*B15 ACC AIR*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ACC_AIR,}, /*B15 ACC AIR*/
{ LINE_IN_LEVEL_HIGH, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_AIR_SUS,}, /*B30 AIR SUS*/ { LINE_IN_LEVEL_HIGH, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_AIR_SUS,}, /*B30 AIR SUS*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_TRAILER_BRAKE,}, /*B31 TRAILER BRAKE*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_TRAILER_BRAKE,}, /*B31 TRAILER BRAKE*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_TRAILER_ABS,}, /*B33 TRAILER ABS*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_TRAILER_ABS,}, /*B33 TRAILER ABS*/
{ LINE_IN_LEVEL_HIGH, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_RR_DIFF_LOCK,}, /*B36 RR DIFF LOCK*/ { LINE_IN_LEVEL_HIGH, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_RR_DIFF_LOCK,}, /*B36 RR DIFF LOCK*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_WEAR_IND,}, /*B38 WEAR IND*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_WEAR_IND,}, /*B38 WEAR IND*/
/*非指示灯信号 硬线输入*/ /*非指示灯信号 硬线输入*/
{ LINE_IN_LEVEL_HIGH, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ILLUMINATION,}, /*A06 ILLUMINATION 背光有效*/ { LINE_IN_LEVEL_HIGH, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ILLUMINATION,}, /*A06 ILLUMINATION 背光有效*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_RET_BLENDING,}, /*A10 RET_BLENDING*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_RET_BLENDING,}, /*A10 RET_BLENDING*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_BRAKE,}, /*A21 BRAKE*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_BRAKE,}, /*A21 BRAKE*/
{ LINE_IN_LEVEL_HIGH, 20U, 0U, LINE_IN_IG_ONOFF, LINE_IN_Get_TURN_R,}, /*A26 TURN_R*/ { LINE_IN_LEVEL_HIGH, 20U, 0U, LINE_IN_IG_ONOFF, LINE_IN_Get_TURN_R,}, /*A26 TURN_R*/
{ LINE_IN_LEVEL_HIGH, 20U, 0U, LINE_IN_IG_ONOFF, LINE_IN_Get_TURN_L,}, /*A27 TURN_L*/ { LINE_IN_LEVEL_HIGH, 20U, 0U, LINE_IN_IG_ONOFF, LINE_IN_Get_TURN_L,}, /*A27 TURN_L*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ABS_DETECT,}, /*A33 ABS_DETECT*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ABS_DETECT,}, /*A33 ABS_DETECT*/
{ LINE_IN_LEVEL_HIGH, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_PTO,}, /*B01 PTO*/ { LINE_IN_LEVEL_HIGH, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_PTO,}, /*B01 PTO*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_GLOW,}, /*B05 GLOW*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_GLOW,}, /*B05 GLOW*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_TRAILER_CONNECT,}, /*B06 TRAILER_CONNECT*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_TRAILER_CONNECT,}, /*B06 TRAILER_CONNECT*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_LOW_COOLANT,}, /*B32 LOW_COOLANT*/ { LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_LOW_COOLANT,}, /*B32 LOW_COOLANT*/
{ LINE_IN_LEVEL_HIGH, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ACC,}, /*B39 ACC*/ { LINE_IN_LEVEL_HIGH, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_ACC,}, /*B39 ACC*/
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_WEAR2,}, /*B40 WEAR2*/ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_WEAR2,}, /*B40 WEAR2*/
{ LINE_IN_LEVEL_HIGH, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_A19,}, /*A19 */ { LINE_IN_LEVEL_HIGH, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_A19,}, /*A19 */
{ LINE_IN_LEVEL_HIGH, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_A03,}, /*A03 */ { LINE_IN_LEVEL_HIGH, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_A03,}, /*A03 */
{ LINE_IN_LEVEL_LOW, 200U, 0U, LINE_IN_IG_ON, LINE_IN_Get_A20,}, /*A20 */ { LINE_IN_LEVEL_LOW, 100U, 0U, LINE_IN_IG_ON, LINE_IN_Get_A20,}, /*A20 */
}; };
/*A22 ABS*/ /*A22 ABS*/
......
...@@ -21,16 +21,21 @@ static void CheckCrc32(unsigned char *buf, int len) ...@@ -21,16 +21,21 @@ static void CheckCrc32(unsigned char *buf, int len)
int n = 0; int n = 0;
unsigned char tmp = 0; unsigned char tmp = 0;
unsigned int crc = CRC32_VAL; // Initial value unsigned int crc = CRC32_VAL; // Initial value
for (n = 0; n < len; n++) { for (n = 0; n < len; n++)
{
tmp = buf[n]; tmp = buf[n];
tmp = (tmp >> 4) | (tmp << 4); tmp = (tmp >> 4) | (tmp << 4);
tmp = (((tmp & 0xcc) >> 2) | ((tmp & 0x33) << 2)); tmp = (((tmp & 0xcc) >> 2) | ((tmp & 0x33) << 2));
tmp = (((tmp & 0xaa) >> 1) | ((tmp & 0x55) << 1)); tmp = (((tmp & 0xaa) >> 1) | ((tmp & 0x55) << 1));
crc ^= (unsigned int)(tmp) << 24; crc ^= (unsigned int)(tmp) << 24;
for (i = 0; i < 8; ++i) { for (i = 0; i < 8; ++i)
if (crc & 0x80000000L) { {
if (crc & 0x80000000L)
{
crc = (crc << 1) ^ 0x04C11DB7; crc = (crc << 1) ^ 0x04C11DB7;
} else { }
else
{
crc <<= 1; crc <<= 1;
} }
} }
...@@ -63,7 +68,8 @@ unsigned char CheckSpiFlashCRC(void) ...@@ -63,7 +68,8 @@ unsigned char CheckSpiFlashCRC(void)
CheckCrc = DCRA0COUT; CheckCrc = DCRA0COUT;
} }
tmp = *((unsigned int *)(CheckCrcAddr + (i * 4))); tmp = *((unsigned int *)(CheckCrcAddr + (i * 4)));
if (BinCrcLen % 4 != 0u) { if (BinCrcLen % 4 != 0u)
{
CheckCrc = CheckCrc ^ 0xffffffff; CheckCrc = CheckCrc ^ 0xffffffff;
CheckCrc = SwapData_32(CheckCrc); CheckCrc = SwapData_32(CheckCrc);
CRC32_VAL = CheckCrc; CRC32_VAL = CheckCrc;
......
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