Commit 6f05650c authored by hu's avatar hu

调整报文外发

parent fe7244ef
......@@ -25,6 +25,7 @@ step 0 17 27 38 47 55 64 70 76
*-----------------------------------------------------------------------------------------------------------------------*/
static uint8_t Fuel_CurSeg = 0;
static uint8_t Fuel_CyrStep = 0u;
/*-------------------------------------------------------------------------
* Function Name : Fuel_User_KL30_Init
......@@ -101,7 +102,6 @@ void Fuel_User_Sleep_Init(void)
* Return : None
* onther : 10Ms调用
--------------------------------------------------------------------------*/
static uint8_t Fuel_CyrStep = 0u;
void Fuel_User_KL15_ON_Processing_Service(void)
{
AFC_PARA AFCPara;
......@@ -169,7 +169,7 @@ void Fuel_User_KL15_ON_Processing_Service(void)
if (FuelMode == FuelSensorNormal)
{
Fuel_CurSeg = (uint16_t)GetFuelSeg(); /*段*/
Fuel_CurSeg = (uint16_t)GetFuelSeg(); /*段*/
Fuel_CyrStep = (uint16_t)GetFuelStep(); /*步*/
}
else
......@@ -222,6 +222,11 @@ uint8_t Fuel_Get_CurSeg(void)
{
return Fuel_CurSeg;
}
uint8_t Fuel_Get_CyrStep(void)
{
return Fuel_CyrStep;
}
/*-------------------------------------------------------------------------
* Function Name : Fuel_Get_Percent
* Description : 燃油百分比
......@@ -260,7 +265,11 @@ uint16_t Fuel_Get_Res(void)
}
uint16_t Fuel_Get_Step(void)
{
return GetFuelStep();
uint16_t FuelStep = 0u;
FuelStep = GetFuelStep();
return FuelStep
}
uint8_t Fuel_Get_LowAlarm(void)
......
......@@ -20,6 +20,7 @@ extern uint8_t Fuel_Get_Percent(void) ;
extern uint16_t Fuel_Get_Res(void) ;
extern uint16_t Fuel_Get_Step(void) ;
extern uint8_t Fuel_Get_CyrStep(void);
extern uint8_t Fuel_Get_LowAlarm(void);
#endif
......@@ -255,9 +255,13 @@ void Can_Set_Buff_18FEFC17(uint8_t CopyData[])
uint8_t Fuel_Level_2 = 0u;
uint8_t Engine_Oil_Filter_Differential = 0u;
if (Fuel_Get_Step() > 10u)
uint16_t Get_Step = 0u;
Get_Step = Fuel_Get_Step();
if (Get_Step > 10u)
{
Fuel_Level_1 = (uint8_t)((Fuel_Get_Step() - 10u) * 50u / 24u);
Fuel_Level_1 = (uint8_t)((Get_Step - 10u) * 50u / 24u);
}
else
{
......@@ -440,14 +444,29 @@ void Can_Set_Buff_18FF2A17(uint8_t CopyData[])
/*-------------------------------------------------------------------------
* Function Name : Can_Set_Buff_18FF9D17
* Description :
* Input : None
* Input : None 18FF9D17
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
void Can_Set_Buff_18FF9D17(uint8_t CopyData[])
{
CopyData[0] = 0u; /* 1 */
uint8_t Fuel_Level = 0u;
uint16_t Get_Step = 0u;
Get_Step = Fuel_Get_Step();
/*燃油剩余百分比 精度 1% 偏移量 0 */
if (Get_Step > 10u)
{
Fuel_Level = (uint8_t)((Get_Step - 10u) * 100u / 120u);
}
else
{
Fuel_Level = 0u;
}
CopyData[0] = (uint8_t)(Fuel_Level & 0xFFu); /* 1 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
CopyData[3] = 0u; /* 4 */
......@@ -460,16 +479,27 @@ void Can_Set_Buff_18FF9D17(uint8_t CopyData[])
/*-------------------------------------------------------------------------
* Function Name : Can_Set_Buff_18FFE517
* Description :
* Input : None
* Input : None 18FFE517
* Output : None
* Return : None
* onther : Event triggered
* onther : Event triggered 事件型报文
--------------------------------------------------------------------------*/
void Can_Set_Buff_18FFE517(uint8_t CopyData[])
{
CopyData[0] = 0u; /* 1 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
uint8_t DTC_Clear_Request = 0u;
uint8_t Req_0Point = 0u;
uint8_t Ferry_Mode_Cancel = 0u;
uint8_t System_Demonstration_Request = 0u;
DTC_Clear_Request = 0u;
Req_0Point = 0u;
Ferry_Mode_Cancel = 0u;
System_Demonstration_Request = 0u;
CopyData[0] = (uint8_t)(DTC_Clear_Request & 0xFFu) ; /* 1 */
CopyData[1] = (uint8_t)(Req_0Point & 0xFFu) ; /* 2 */
CopyData[2] = (uint8_t)(((Ferry_Mode_Cancel << 7u) & 0x80U) |
(System_Demonstration_Request & 0x7Fu)) ; /* 3 */
CopyData[3] = 0u; /* 4 */
CopyData[4] = 0u; /* 5 */
CopyData[5] = 0u; /* 6 */
......@@ -479,7 +509,7 @@ void Can_Set_Buff_18FFE517(uint8_t CopyData[])
/*-------------------------------------------------------------------------
* Function Name : Can_Set_Buff_18EF2D17
* Description :
* Input : None
* Input : None 18EF2D17 未见此报文
* Output : None
* Return : None
* onther : None
......@@ -498,14 +528,18 @@ void Can_Set_Buff_18EF2D17(uint8_t CopyData[])
/*-------------------------------------------------------------------------
* Function Name : Can_Set_Buff_18033317
* Description :
* Input : None
* Input : None 18033317
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
void Can_Set_Buff_18033317(uint8_t CopyData[])
{
CopyData[0] = 0u; /* 1 */
uint8_t Pair_cmd = 0u;
Pair_cmd = 0u;
CopyData[0] = (uint8_t)(Pair_cmd & 0xFFu); /* 1 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
CopyData[3] = 0u; /* 4 */
......@@ -517,14 +551,18 @@ void Can_Set_Buff_18033317(uint8_t CopyData[])
/*-------------------------------------------------------------------------
* Function Name : Can_Set_Buff_180433A2
* Description :
* Input : None
* Input : None 180433A2
* Output : None
* Return : None
* onther : None
--------------------------------------------------------------------------*/
void Can_Set_Buff_180433A2(uint8_t CopyData[])
{
CopyData[0] = 0u; /* 1 */
uint8_t Setup_cmd = 0u;
Setup_cmd = 0u;
CopyData[0] = (uint8_t)(Setup_cmd & 0xFFu); /* 1 */
CopyData[1] = 0u; /* 2 */
CopyData[2] = 0u; /* 3 */
CopyData[3] = 0u; /* 4 */
......
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