Commit 7cc6189c authored by 王金山's avatar 王金山

Merge branch 'feature/TYW-2025-00990-2-Add-AEBS-and-LDWS-switch-signal-output' into 'dev'

变更项2、增加AEBS、LDWS开关信号外发

See merge request !23
parents 59d4ed26 27c5bd9c
......@@ -203,8 +203,9 @@ void Drive_Info_Export_Init(void)
ICM_1_STATUS |= CAN_TX_EN; //����
ICM_2_STATUS |= CAN_TX_EN; //����
ICM_3_STATUS |= CAN_TX_EN; //����
ICM_4_STATUS |= CAN_TX_EN; //����
ICM_4_STATUS |= CAN_TX_EN; //����
ICM_5_STATUS |= CAN_TX_EN; //����
ICM_6_STATUS |= CAN_TX_EN; //����
}
/***************************************�ⷢ����**************************************/
static void Drive_Info_IC1_STATUS_Tx(void)
......
......@@ -1389,6 +1389,7 @@ void Telltales_Management(void)
if (STEPPER_MOTOR_0_CUR_STEP >= 520)
TelltaleLCD_Flag33 = 0;
}
#if 0
//锟斤拷锟斤拷锟斤拷锟斤拷 硬锟斤拷 21
if (LINE_IN_FILT_BLOCK_SIGNAL)
{
......@@ -1428,7 +1429,7 @@ void Telltales_Management(void)
FILT_BLOCK_Count = 0;
TelltaleLCDFlag.Sig.LCD03 = 0;
}
#endif
//EBS EBS锟斤拷凭锟斤拷锟 42
if (NVM_CONFIG_EBS == 0) //20190808
{
......
......@@ -226,6 +226,15 @@ extern volatile uint8_t KeyEnterinStatus;
#define LINE_IN_GEAR_SIGNAL LineInGEARStatus
#define LINE_IN_GEAR_DEFAULT 0
#endif
/*** LINE_IN_AEBS_SIGNAL ***/
#if ((defined LINE_IN_AEBS) || (defined LINE_IN_AEBSn))
extern volatile uint8_t LineInAEBSStatus;
#define LINE_IN_AEBS_SIGNAL LineInAEBSStatus
#define LINE_IN_AEBS_DEFAULT 0
#endif
/******************************************************************************
函数声明
******************************************************************************/
......
......@@ -7,6 +7,7 @@
******************************************************************************/
#include "Line_In.h"
#include "CAN_Communication_Matrix.h"
uint8_t LineInEnable;
volatile uint8_t KeyLeftinStatus;
......@@ -84,7 +85,7 @@ volatile uint8_t KeyEnterinStatus;
LineInDebounceStruct LineInPTODeb;
#endif
#ifdef LINE_IN_FILT_BLOCK_SIGNAL // FILT_BLOCK
#ifdef LINE_IN_FILT_BLOCK_SIGNAL // FILT_BLOCK,改为LDWS
volatile uint8_t LineInFILTBLOCKStatus;
LineInDebounceStruct LineInFILTBLOCKDeb;
#endif
......@@ -98,6 +99,11 @@ volatile uint8_t KeyEnterinStatus;
volatile uint8_t LineInGEARStatus;
LineInDebounceStruct LineInGEARDeb;
#endif
#ifdef LINE_IN_AEBS_SIGNAL // AEBS
volatile uint8_t LineInAEBSStatus;
LineInDebounceStruct LineInAEBSDeb;
#endif
/******************************************************************************
函数名:Line_In_Enable
功 能:线路输入功能使能
......@@ -163,6 +169,9 @@ uint8_t Line_In_Debounce (uint8_t Input, uint8_t DebCycleRise, uint16_t DebCycle
参 数:无
返回值:无
******************************************************************************/
uint8_t LINE_IN_FILT_BLOCK_SIGNAL_Last;
uint8_t LINE_IN_AEBS_SIGNAL_Last;
void Line_In_Status_Reset(void)
{
#ifdef KEY_LEFT_SIGNAL //
......@@ -232,6 +241,8 @@ void Line_In_Status_Reset(void)
#ifdef LINE_IN_FILT_BLOCK_SIGNAL // FILT_BLOCK
LINE_IN_FILT_BLOCK_SIGNAL = LINE_IN_FILT_BLOCK_DEFAULT;
LINE_IN_FILT_BLOCK_SIGNAL_Last = LINE_IN_FILT_BLOCK_SIGNAL;
LDWenableCommand = 0;
LineInFILTBLOCKDeb .Timer = 0;
#endif
......@@ -244,6 +255,13 @@ void Line_In_Status_Reset(void)
LINE_IN_GEAR_SIGNAL = LINE_IN_GEAR_DEFAULT;
LineInGEARDeb .Timer = 0;
#endif
#ifdef LINE_IN_AEBS_SIGNAL // AEBS
LINE_IN_AEBS_SIGNAL = LINE_IN_AEBS_DEFAULT;
LINE_IN_AEBS_SIGNAL_Last = LINE_IN_AEBS_SIGNAL;
DriverActivationDemandForAEBS = 0;
LineInAEBSDeb .Timer = 0;
#endif
/////////////////////////////////////////////////////////////////////////
}
......@@ -255,6 +273,8 @@ void Line_In_Status_Reset(void)
******************************************************************************
注 意:该服务函数必须每20ms被调用一次
******************************************************************************/
uint8_t PowerOnSts_Last = 0;
void Line_In_Debounce_Service(void)
{
uint8_t LineStatus;
......@@ -321,7 +341,33 @@ void Line_In_Debounce_Service(void)
if (LineInEnable == 0)
return;
if (AnalogKL15Voltage <= 8000)
{
PowerOnSts_Last = 0;
}
else
{
if (PowerOnSts_Last == 0)
{
PowerOnSts_Last = 1;
#ifdef LINE_IN_FILT_BLOCK_SIGNAL // FILT_BLOCK
LINE_IN_FILT_BLOCK_SIGNAL = LINE_IN_FILT_BLOCK_DEFAULT;
LINE_IN_FILT_BLOCK_SIGNAL_Last = LINE_IN_FILT_BLOCK_SIGNAL;
LDWenableCommand = 0;
LineInFILTBLOCKDeb .Timer = 0;
#endif
#ifdef LINE_IN_AEBS_SIGNAL // AEBS
LINE_IN_AEBS_SIGNAL = LINE_IN_AEBS_DEFAULT;
LINE_IN_AEBS_SIGNAL_Last = LINE_IN_AEBS_SIGNAL;
DriverActivationDemandForAEBS = 0;
LineInAEBSDeb .Timer = 0;
#endif
}
}
// LED_RIGHT_G
#ifdef LINE_IN_RIGHT_SIGNAL
#ifdef LINE_IN_RIGHT
......@@ -606,6 +652,18 @@ void Line_In_Debounce_Service(void)
LineInFILTBLOCKDeb.Timer = 0;
LineInFILTBLOCKDeb.Last = LineStatus;
}
if (AnalogKL15Voltage > 8000)
{
if (LINE_IN_FILT_BLOCK_SIGNAL_Last != LINE_IN_FILT_BLOCK_SIGNAL)
{
LINE_IN_FILT_BLOCK_SIGNAL_Last = LINE_IN_FILT_BLOCK_SIGNAL;
if (LINE_IN_FILT_BLOCK_SIGNAL_Last == 1)
{
LDWenableCommand ^= 1;
}
}
}
#endif
//CHARGE
......@@ -655,4 +713,40 @@ void Line_In_Debounce_Service(void)
LineInGEARDeb.Last = LineStatus;
}
#endif
//AEBS
#ifdef LINE_IN_AEBS_SIGNAL
#ifdef LINE_IN_AEBS
LineStatus = LINE_IN_AEBS;
#else
LineStatus = !LINE_IN_AEBSn;
#endif
if (LineStatus == LineInAEBSDeb.Last)
{
LineInAEBSDeb.Timer++;
if (LineInAEBSDeb.Timer >= LINE_IN_DEBOUNCE_L_CNT)
{
LineInAEBSDeb.Timer = 0;
LINE_IN_AEBS_SIGNAL = LineStatus;
}
}
else
{
LineInAEBSDeb.Timer = 0;
LineInAEBSDeb.Last = LineStatus;
}
if (AnalogKL15Voltage > 8000)
{
if (LINE_IN_AEBS_SIGNAL_Last != LINE_IN_AEBS_SIGNAL)
{
LINE_IN_AEBS_SIGNAL_Last = LINE_IN_AEBS_SIGNAL;
if (LINE_IN_AEBS_SIGNAL_Last == 1)
{
DriverActivationDemandForAEBS ^= 1;
}
}
}
#endif
}
......@@ -89,12 +89,12 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------
| 名称 | 端口 | 引脚 | 方向 | 初值 | 上下拉使能 | 上/下拉 | 说明
===================================================================================================================================================*/
//#define N.C. PTH_PTH0 // 63 OUT 0 0 0 --
#define LINE_IN_AEBSn PTH_PTH0 // 63 IN 0 0 0 --AEBS开关信号
//#define N.C. PTH_PTH1 // 64 OUT 0 0 0 --
//#define N.C. PTH_PTH2 // 65 OUT 0 0 0 --
//#define N.C. PTH_PTH3 // 66 OUT 0 0 0 --
#define LINE_IN_CAB_LOCKn PTH_PTH4 // 75 IN 0 0 0 --驾驶室锁死
#define LINE_IN_FILT_BLOCKn PTH_PTH5 // 76 IN 0 0 0 --空滤器阻塞
#define LINE_IN_FILT_BLOCKn PTH_PTH5 // 76 IN 0 0 0 --空滤器阻塞,改成LDWS开关信号
#define LCD_1530EN PTH_PTH6 // 83 OUT 0 0 0 --TFT电源
//#define N.C. PTH_PTH7 // 84 OUT 0 0 0 --
/*===================================================================================================================================================
......
......@@ -48,7 +48,7 @@ void GPIO_Init(void)
PPSP = 0x00; //上下拉选择寄存器
// PORTH
DDRH = 0xCF; //方向控制寄存器
DDRH = 0xCE; //方向控制寄存器
PTH = 0x00; //数据寄存器
PERH = 0x00; //上下拉使能寄存器
PPSH = 0x00; //上下拉选择寄存器
......
......@@ -2333,6 +2333,70 @@ extern volatile uint8_t CANMsg18FDC40BStatus;
static const uint8_t CANMsg18FDC40BInit[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t CANMsg18FDC40BTimeout[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t CANMsg18FDC40BMask[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
/******************************************************************************
ICM5
ID:0x0C0B2A17
******************************************************************************/
typedef union
{
uint8_t Msg[8];
struct
{
uint8_t b00_01 : 2; //DriverActivationDemandForAEBS
uint8_t b02_01 : 6;
uint8_t b08_15 : 8; //
uint8_t b16_23 : 8; //
uint8_t b24_31 : 8; //
uint8_t b32_39 : 8; //
uint8_t b40_47 : 8; //
uint8_t b48_55 : 8; //
uint8_t b56_63 : 8; //
} Sig;
} CANMsg0C0B2A17Union;
extern volatile CANMsg0C0B2A17Union CANMsg0C0B2A17;
extern volatile uint8_t CANMsg0C0B2A17Status;
#define ICM_5 0x0C0B2A17
#define ICM_5_STATUS CANMsg0C0B2A17Status
#define DriverActivationDemandForAEBS CANMsg0C0B2A17.Sig.b00_01
static const uint8_t CANMsg0C0B2A17Init[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t CANMsg0C0B2A17Timeout[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t CANMsg0C0B2A17Mask[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
/******************************************************************************
ICM6
ID:0x18A92A17
******************************************************************************/
typedef union
{
uint8_t Msg[8];
struct
{
uint8_t b00_01 : 2; //LDWenableCommand
uint8_t b02_01 : 6;
uint8_t b08_15 : 8; //
uint8_t b16_23 : 8; //
uint8_t b24_31 : 8; //
uint8_t b32_39 : 8; //
uint8_t b40_47 : 8; //
uint8_t b48_55 : 8; //
uint8_t b56_63 : 8; //
} Sig;
} CANMsg18A92A17Union;
extern volatile CANMsg18A92A17Union CANMsg18A92A17;
extern volatile uint8_t CANMsg18A92A17Status;
#define ICM_6 0x18A92A17
#define ICM_6_STATUS CANMsg18A92A17Status
#define LDWenableCommand CANMsg18A92A17.Sig.b00_01
static const uint8_t CANMsg18A92A17Init[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t CANMsg18A92A17Timeout[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
static const uint8_t CANMsg18A92A17Mask[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
/*****************************************************************************************************************************************************************************
报文属性预定义
*****************************************************************************************************************************************************************************/
......@@ -2414,6 +2478,8 @@ static const CANMsgAttrStruct CANMsgAttrTable[] =
{ ICM_2, CANMsg18FEF117.Msg, 8, 8, CAN_MSG_Tx, CAN_MSG_CYCLE, 100, 3, &CANMsg18FEF117Status, CANMsg18FEF117Init, CANMsg18FEF117Timeout, CANMsg18FEF117Mask,},
//{ ICM_3, CANMsg18FF0A17.Msg, 8, 8, CAN_MSG_Tx, CAN_MSG_CYCLE, 100, 11, &CANMsg18FF0A17Status, CANMsg18FF0A17Init, CANMsg18FF0A17Timeout, CANMsg18FF0A17Mask,},
{ ICM_4, CANMsg18FEFC17.Msg, 8, 8, CAN_MSG_Tx, CAN_MSG_CYCLE, 1000, 9, &CANMsg18FEFC17Status, CANMsg18FEFC17Init, CANMsg18FEFC17Timeout, CANMsg18FEFC17Mask,},
{ ICM_5, CANMsg0C0B2A17.Msg, 8, 8, CAN_MSG_Tx, CAN_MSG_CYCLE, 50, 5, &CANMsg0C0B2A17Status, CANMsg0C0B2A17Init, CANMsg0C0B2A17Timeout, CANMsg0C0B2A17Mask,},
{ ICM_6, CANMsg18A92A17.Msg, 8, 8, CAN_MSG_Tx, CAN_MSG_CYCLE, 200, 19, &CANMsg18A92A17Status, CANMsg18A92A17Init, CANMsg18A92A17Timeout, CANMsg18A92A17Mask,},
{ NWM_TBOX, CANMsg18EFCD27.Msg, 8, 8, CAN_MSG_Rx, CAN_MSG_CYCLE, 10000, 0, &CANMsg18EFCD27Status, CANMsg18EFCD27Init, CANMsg18EFCD27Timeout, CANMsg18EFCD27Mask,},
{ ADAS_1, CANMsg10F007E8.Msg, 8, 8, CAN_MSG_Rx, CAN_MSG_CYCLE, 2000, 0, &CANMsg10F007E8Status, CANMsg10F007E8Init, CANMsg10F007E8Timeout, CANMsg10F007E8Mask,},
......@@ -2457,7 +2523,7 @@ static const CANMsgAttrStruct CANMsgAttrTable[] =
{ EBS5, CANMsg18FDC40B.Msg, 8, 8, CAN_MSG_Rx, CAN_MSG_CYCLE, 1000, 0, &CANMsg18FDC40BStatus, CANMsg18FDC40BInit, CANMsg18FDC40BTimeout, CANMsg18FDC40BMask,},
/*==========================================================================================================================================================================*/
};
#define CAN_TX_MSG_NUM 8
#define CAN_TX_MSG_NUM 10
#define CAN_RX_MSG_NUM 44
#endif
......@@ -236,3 +236,11 @@ volatile uint8_t CANMsg18FFEB4EStatus;
//EBS5
volatile CANMsg18FDC40BUnion CANMsg18FDC40B;
volatile uint8_t CANMsg18FDC40BStatus;
//ICM5
volatile CANMsg0C0B2A17Union CANMsg0C0B2A17;
volatile uint8_t CANMsg0C0B2A17Status;
//ICM6
volatile CANMsg18A92A17Union CANMsg18A92A17;
volatile uint8_t CANMsg18A92A17Status;
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