Commit f60f32b1 authored by 郑萍's avatar 郑萍

Merge branch 'zhengping' into 'dev'

Zhengping

See merge request !4
parents d92fa485 51208c5e
...@@ -473,6 +473,11 @@ ...@@ -473,6 +473,11 @@
<FileType>5</FileType> <FileType>5</FileType>
<FilePath>..\..\..\..\Source\Application\CAN_User\Can_App.h</FilePath> <FilePath>..\..\..\..\Source\Application\CAN_User\Can_App.h</FilePath>
</File> </File>
<File>
<FileName>Can_RX_User.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\Source\Application\CAN_User\Can_RX_User.c</FilePath>
</File>
</Files> </Files>
</Group> </Group>
<Group> <Group>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h" #include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h"
#include "Can_User/Can_User.h" #include "Can_User/Can_User.h"
#include "Can_User/Can_App.h" #include "Can_User/Can_App.h"
#include "Can_User/Can_RX_User.h"
......
...@@ -6,12 +6,12 @@ ...@@ -6,12 +6,12 @@
#define BACK_LIGHT_DAY 200 #define BACK_LIGHT_DAY 200
#define openLED_flag ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) ) #define openLED_flag ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != POWER_CHECK_NULL))
uint8_t interact_PWM_Low_Duty = 0; uint8_t interact_PWM_Low_Duty = 0;
void BackLight_Process(void) void BackLight_Process(void)
{ {
if (openLED_flag && Charge_OFF_Flag != 2) if (openLED_flag)
{ {
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY); TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
//电量 //电量
...@@ -71,7 +71,7 @@ void BackLight_Clock_All_Process(void) ...@@ -71,7 +71,7 @@ void BackLight_Clock_All_Process(void)
void Interact_Light_Process(void) void Interact_Light_Process(void)
{ {
if (openLED_flag && (Charge_OFF_Flag == 0)) if ((Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != POWER_CHECK_NULL) && (Charge_OFF_Flag == 0))
{ {
TimerM_PWM_set_duty(TIMERM_COUNTER0, TIMERM_CHD, interact_PWM_Low_Duty * 10); TimerM_PWM_set_duty(TIMERM_COUNTER0, TIMERM_CHD, interact_PWM_Low_Duty * 10);
} }
......
...@@ -8,9 +8,9 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp; ...@@ -8,9 +8,9 @@ st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] = const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] =
{ {
{0x3A2ul, 200ul * 100ul, 0ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_3A2, (void *)0}, {0x3A2ul, 200ul * 1000ul, 0ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_3A2, (void *)0},
{0x3A7ul, 200ul * 100ul, 0ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_3A7, (void *)0}, {0x3A7ul, 200ul * 1000ul, 0ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_3A7, (void *)0},
{0x393ul, 200ul * 100ul, 0ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_393, (void *)0}, {0x393ul, 2000ul * 1000ul, 0ul, 0u, MSG_STD, 1u, 8u, CAN_MSG_TX_CYCLE, Can_Set_Buff_393, (void *)0},
}; };
uint8_t System_Indicator_CANFlag = 0; uint8_t System_Indicator_CANFlag = 0;
const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
...@@ -19,7 +19,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -19,7 +19,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
3000ul, 20000ul,
0x398ul, 0x398ul,
((void *)0), ((void *)0),
((void *)0), ((void *)0),
...@@ -29,7 +29,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -29,7 +29,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
3000ul, 20000ul,
0x39Dul, 0x39Dul,
((void *)0), ((void *)0),
((void *)0), ((void *)0),
...@@ -39,7 +39,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -39,7 +39,7 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
200ul, 500ul,
0x157ul, 0x157ul,
((void *)0), ((void *)0),
((void *)0), ((void *)0),
...@@ -129,261 +129,28 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] = ...@@ -129,261 +129,28 @@ const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] =
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
{0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u}, {0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u, 0x00u},
200ul, 500ul,
0x134ul, 0x134ul,
((void *)0), ((void *)0),
((void *)0), ((void *)0),
((void *)0), ((void *)0),
}, },
}; };
static uint8_t BMCU_ErrorGrage = 0; void System_Indicator_ON_callback(canlib_uint8_t CopyData[])
static uint8_t BMCU_BladeSpeedGear = 0;
static uint8_t BMCU_PTOSwicthState = 0;
static uint8_t BMCU_Moto2_Locked_RotorFault = 0;
static uint8_t BMCU_Moto1_Locked_RotorFault = 0;
static uint8_t MBMS_Soc = 0;
static uint8_t MBMS_TOTALWorkState = 0;
static uint8_t MBMS_TOTALSigOn = 0;
static uint8_t MBMS_TOTALSigAcc = 0;
static uint8_t MBMS_TOTALSigCharge = 0;
static uint8_t MBMS_StatSoc = 0;
static uint8_t MBMS_StatBattChargeState = 0;
static uint8_t MBMS_StatBattWorkState = 0;
static uint8_t MMCU_ErrorGrage = 0;
static uint8_t MMCU_ChgProtectState = 0;
static uint8_t MMCU_DCDCEnableState = 0;
static uint8_t MMCU_ParkingGearState = 0;
static uint8_t MMCU_SeatDetectState = 0;
static uint8_t MMCU_LockMotoState = 0;
static uint8_t MMCU_EBSState = 0;
static uint8_t MMCU_TravelSpeedGear = 0;
static uint8_t MMCU_PowerMode = 0;
static uint8_t MMCU_WorkState = 0;
static uint16_t MMCU_AccumulatedWorkHours = 0;
static uint8_t MMCU_SingleWorkingHours = 0;
static uint8_t SBMS_Soc = 0;
static uint8_t SMCU_ErrorGrage = 0;
void Set_CAN_ALL_Signal(void)
{
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x157_Msg)) == CAN_ERR_OK)
{
BMCU_ErrorGrage = Get_CAN_CH0_ID_157_Sig_BMCU_ErrorGrage();
BMCU_BladeSpeedGear = Get_CAN_CH0_ID_157_Sig_BMCU_BladeSpeedGear();
BMCU_PTOSwicthState = Get_CAN_CH0_ID_157_Sig_BMCU_PTOSwicthState();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x38E_Msg)) == CAN_ERR_OK)
{
BMCU_Moto1_Locked_RotorFault = Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1_Locked_RotorFault();
BMCU_Moto2_Locked_RotorFault = Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2_Locked_RotorFault();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A20_Msg)) == CAN_ERR_OK)
{
MBMS_Soc = Get_CAN_CH0_ID_18200A20_Sig_MBMS_Soc();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18202922_Msg)) == CAN_ERR_OK)
{
MBMS_TOTALWorkState = Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALWorkState();
MBMS_TOTALSigOn = Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigOn();
MBMS_TOTALSigAcc = Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigAcc();
MBMS_TOTALSigCharge = Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigCharge();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18203020_Msg)) == CAN_ERR_OK)
{
MBMS_StatSoc = Get_CAN_CH0_ID_18203020_Sig_MBMS_StatSoc();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18203220_Msg)) == CAN_ERR_OK)
{
MBMS_StatBattChargeState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattChargeState();
MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x125_Msg)) == CAN_ERR_OK)
{
MMCU_ErrorGrage = Get_CAN_CH0_ID_125_Sig_MMCU_ErrorGrage();
MMCU_ChgProtectState = Get_CAN_CH0_ID_125_Sig_MMCU_ChgProtectState();
MMCU_DCDCEnableState = Get_CAN_CH0_ID_125_Sig_MMCU_DCDCEnableState();
MMCU_ParkingGearState = Get_CAN_CH0_ID_125_Sig_MMCU_ParkingGearState();
MMCU_SeatDetectState = Get_CAN_CH0_ID_125_Sig_MMCU_SeatDetectState(); // 掉线需要做处理
MMCU_LockMotoState = Get_CAN_CH0_ID_125_Sig_MMCU_LockMotoState();
MMCU_EBSState = Get_CAN_CH0_ID_125_Sig_MMCU_EBSState();
MMCU_TravelSpeedGear = Get_CAN_CH0_ID_125_Sig_MMCU_TravelSpeedGear();
MMCU_PowerMode = Get_CAN_CH0_ID_125_Sig_MMCU_PowerMode();
MMCU_WorkState = Get_CAN_CH0_ID_125_Sig_MMCU_WorkState();
}
else
{
MMCU_SeatDetectState = Get_CAN_CH0_ID_125_Sig_MMCU_SeatDetectState(); // 掉线需要做处理
MMCU_PowerMode = Get_CAN_CH0_ID_125_Sig_MMCU_PowerMode();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x339_Msg)) == CAN_ERR_OK)
{
MMCU_AccumulatedWorkHours = Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours();
MMCU_SingleWorkingHours = Get_CAN_CH0_ID_339_Sig_MMCU_SingleWorkingHours();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A21_Msg)) == CAN_ERR_OK)
{
SBMS_Soc = Get_CAN_CH0_ID_18200A21_Sig_SBMS_Soc();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A21_Msg)) == CAN_ERR_OK)
{
SMCU_ErrorGrage = Get_CAN_CH0_ID_134_Sig_SMCU_ErrorGrage();
}
}
uint8_t Get_CAN_Num_BMCU_ErrorGrage(void)
{
return BMCU_ErrorGrage;
}
uint8_t Get_CAN_Num_BMCU_BladeSpeedGear(void)
{
return BMCU_BladeSpeedGear;
}
uint8_t Get_CAN_Num_BMCU_PTOSwicthState(void)
{
return BMCU_PTOSwicthState;
}
uint8_t Get_CAN_Num_BMCU_Moto2_Locked_RotorFault(void)
{
return BMCU_Moto2_Locked_RotorFault;
}
uint8_t Get_CAN_Num_BMCU_Moto1_Locked_RotorFault(void)
{
return BMCU_Moto1_Locked_RotorFault;
}
uint8_t Get_CAN_Num_MBMS_Soc(void)
{
return MBMS_Soc;
}
uint8_t Get_CAN_Num_MBMS_TOTALWorkState(void)
{
return MBMS_TOTALWorkState;
}
uint8_t Get_CAN_Num_MBMS_TOTALSigOn(void)
{
return MBMS_TOTALSigOn;
}
uint8_t Get_CAN_Num_MBMS_TOTALSigAcc(void)
{
return MBMS_TOTALSigAcc;
}
uint8_t Get_CAN_Num_MBMS_TOTALSigCharge(void)
{
return MBMS_TOTALSigCharge;
}
uint8_t Get_CAN_Num_MBMS_StatSoc(void)
{
return MBMS_StatSoc;
}
uint8_t Get_CAN_Num_MBMS_StatBattChargeState(void)
{
return MBMS_StatBattChargeState;
}
uint8_t Get_CAN_Num_MBMS_StatBattWorkState(void)
{
return MBMS_StatBattWorkState;
}
uint8_t Get_CAN_Num_MMCU_ErrorGrage(void)
{
return MMCU_ErrorGrage;
}
uint8_t Get_CAN_Num_MMCU_ChgProtectState(void)
{
return MMCU_ChgProtectState;
}
uint8_t Get_CAN_Num_MMCU_DCDCEnableState(void)
{
return MMCU_DCDCEnableState;
}
uint8_t Get_CAN_Num_MMCU_ParkingGearState(void)
{
return MMCU_ParkingGearState;
}
uint8_t Get_CAN_Num_MMCU_SeatDetectState(void)
{
return MMCU_SeatDetectState;
}
uint8_t Get_CAN_Num_MMCU_LockMotoState(void)
{
return MMCU_LockMotoState;
}
uint8_t Get_CAN_Num_MMCU_EBSState(void)
{
return MMCU_EBSState;
}
uint8_t Get_CAN_Num_MMCU_TravelSpeedGear(void)
{
return MMCU_TravelSpeedGear;
}
uint8_t Get_CAN_Num_MMCU_PowerMode(void)
{
return MMCU_PowerMode;
}
uint8_t Get_CAN_Num_MMCU_WorkState(void)
{
return MMCU_WorkState;
}
uint16_t Get_CAN_Num_MMCU_AccumulatedWorkHours(void)
{
return MMCU_AccumulatedWorkHours;
}
uint8_t Get_CAN_Num_MMCU_SingleWorkingHours(void)
{
return MMCU_SingleWorkingHours;
}
uint8_t Get_CAN_Num_SBMS_Soc(void)
{
return SBMS_Soc;
}
uint8_t Get_CAN_Num_SMCU_ErrorGrage(void)
{
return SMCU_ErrorGrage;
}
void System_Indicator_ON_callback(canlib_uint8_t CopyData [])
{ {
System_Indicator_CANFlag = 0; System_Indicator_CANFlag = 0;
} }
void System_Indicator_OFF_callback(canlib_uint8_t CopyData []) void System_Indicator_OFF_callback(canlib_uint8_t CopyData[])
{ {
System_Indicator_CANFlag = 1; System_Indicator_CANFlag = 1;
} uint8_t i = 0;
BUZZER_Init();
uint8_t Get_CAN_Power_State(void) poweroff_time = 0;
{ Clear_Bu98();
uint8_t state = 0; for (i = 0; i < LampCh0_MAX; i++)
uint8_t Power_State = Get_CAN_Num_MMCU_PowerMode();
switch (Power_State)
{ {
case 0x0: LED_Driver_Channel_Set(LampChannel_0, i, LED_OFF);
state = KEY_OFF;
break;
case 0x1:
state = PKEY_ON;
break;
case 0x2:
state = KEY_ACC;
break;
case 0x3:
state = READY;
break;
case 0x4:
state = CHRG_PLUGIN;
break;
case 0x5:
state = CHRGING;
break;
case 0x6:
state = CHRGEND;
break;
default:
break;
} }
return state;
} }
uint8_t Get_CAN_CH0_ID_398_Sig_ICU_SN0(void) uint8_t Get_CAN_CH0_ID_398_Sig_ICU_SN0(void)
......
...@@ -36,6 +36,7 @@ typedef enum ...@@ -36,6 +36,7 @@ typedef enum
CHRG_PLUGIN, CHRG_PLUGIN,
CHRGING, CHRGING,
CHRGEND, CHRGEND,
POWER_CHECK_NULL,
} POWER_CHECK_STATE_t; } POWER_CHECK_STATE_t;
typedef enum typedef enum
...@@ -106,39 +107,12 @@ extern uint8_t Get_CAN_CH0_ID_18200A21_Sig_SBMS_Soc(void); ...@@ -106,39 +107,12 @@ extern uint8_t Get_CAN_CH0_ID_18200A21_Sig_SBMS_Soc(void);
extern uint8_t Get_CAN_CH0_ID_134_Sig_SMCU_ErrorGrage(void); extern uint8_t Get_CAN_CH0_ID_134_Sig_SMCU_ErrorGrage(void);
extern uint8_t Get_CAN_Num_BMCU_ErrorGrage(void);
extern uint8_t Get_CAN_Num_BMCU_BladeSpeedGear(void);
extern uint8_t Get_CAN_Num_BMCU_PTOSwicthState(void);
extern uint8_t Get_CAN_Num_BMCU_Moto2_Locked_RotorFault(void);
extern uint8_t Get_CAN_Num_BMCU_Moto1_Locked_RotorFault(void);
extern uint8_t Get_CAN_Num_MBMS_Soc(void);
extern uint8_t Get_CAN_Num_MBMS_TOTALWorkState(void);
extern uint8_t Get_CAN_Num_MBMS_TOTALSigOn(void);
extern uint8_t Get_CAN_Num_MBMS_TOTALSigAcc(void);
extern uint8_t Get_CAN_Num_MBMS_TOTALSigCharge(void);
extern uint8_t Get_CAN_Num_MBMS_StatSoc(void);
extern uint8_t Get_CAN_Num_MBMS_StatBattChargeState(void);
extern uint8_t Get_CAN_Num_MBMS_StatBattWorkState(void);
extern uint8_t Get_CAN_Num_MMCU_ErrorGrage(void);
extern uint8_t Get_CAN_Num_MMCU_ChgProtectState(void);
extern uint8_t Get_CAN_Num_MMCU_DCDCEnableState(void);
extern uint8_t Get_CAN_Num_MMCU_ParkingGearState(void);
extern uint8_t Get_CAN_Num_MMCU_SeatDetectState(void);
extern uint8_t Get_CAN_Num_MMCU_LockMotoState(void);
extern uint8_t Get_CAN_Num_MMCU_EBSState(void);
extern uint8_t Get_CAN_Num_MMCU_TravelSpeedGear(void);
extern uint8_t Get_CAN_Num_MMCU_PowerMode(void);
extern uint8_t Get_CAN_Num_MMCU_WorkState(void);
extern uint16_t Get_CAN_Num_MMCU_AccumulatedWorkHours(void);
extern uint8_t Get_CAN_Num_MMCU_SingleWorkingHours(void);
extern uint8_t Get_CAN_Num_SBMS_Soc(void);
extern uint8_t Get_CAN_Num_SMCU_ErrorGrage(void);
extern uint8_t Co_Can_ConvertSubID_CAN_CH0(uint32_t MsgID); extern uint8_t Co_Can_ConvertSubID_CAN_CH0(uint32_t MsgID);
extern uint8_t System_Indicator_CANFlag; extern uint8_t System_Indicator_CANFlag;
extern void Set_CAN_ALL_Signal(void);
void System_Indicator_ON_callback(canlib_uint8_t CopyData []); void System_Indicator_ON_callback(canlib_uint8_t CopyData []);
void System_Indicator_OFF_callback(canlib_uint8_t CopyData []); void System_Indicator_OFF_callback(canlib_uint8_t CopyData []);
extern uint8_t Get_CAN_Power_State(void);
#endif #endif
...@@ -28,9 +28,9 @@ void Can_Set_Buff_3A2(canlib_uint8_t CopyData[]) ...@@ -28,9 +28,9 @@ void Can_Set_Buff_3A2(canlib_uint8_t CopyData[])
p3A2->Sig.Res6 = 0x00; p3A2->Sig.Res6 = 0x00;
p3A2->Sig.Res7 = 0x00; p3A2->Sig.Res7 = 0x00;
// p3A2->Sig.ICU_MasterBMSCommunicatlost = 1; // p3A2->Sig.ICU_MasterBMSCommunicatlost = 1;
// p3A2->Sig.ICU_SlaveBMSCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A21_Msg)) == CAN_ERR_OK); // p3A2->Sig.ICU_SlaveBMSCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A21_Msg)) == CAN_SIG_NORMAL);
// p3A2->Sig.ICU_MCUCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x157_Msg)) == CAN_ERR_OK); // p3A2->Sig.ICU_MCUCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x157_Msg)) == CAN_SIG_NORMAL);
// p3A2->Sig.ICU_VCUCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x125_Msg)) == CAN_ERR_OK); // p3A2->Sig.ICU_VCUCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x125_Msg)) == CAN_SIG_NORMAL);
// p3A2->Sig.Res0 = 0x0; // p3A2->Sig.Res0 = 0x0;
// p3A2->Sig.Res1 = 0x00; // p3A2->Sig.Res1 = 0x00;
// p3A2->Sig.Res2 = 0x00; // p3A2->Sig.Res2 = 0x00;
...@@ -52,10 +52,10 @@ void Can_Set_Buff_3A7(canlib_uint8_t CopyData[]) ...@@ -52,10 +52,10 @@ void Can_Set_Buff_3A7(canlib_uint8_t CopyData[])
p3A7 = (CANMsg3A7Union *)CopyData; p3A7 = (CANMsg3A7Union *)CopyData;
if (p3A7 != (void *)0) if (p3A7 != (void *)0)
{ {
p3A7->Sig.ICU_MasterBMSCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A20_Msg)) == CAN_ERR_OK); p3A7->Sig.ICU_MasterBMSCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A20_Msg)) == CAN_SIG_NORMAL);
p3A7->Sig.ICU_SlaveBMSCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A21_Msg)) == CAN_ERR_OK); p3A7->Sig.ICU_SlaveBMSCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A21_Msg)) == CAN_SIG_NORMAL);
p3A7->Sig.ICU_MCUCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x157_Msg)) == CAN_ERR_OK); p3A7->Sig.ICU_MCUCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x157_Msg)) == CAN_SIG_NORMAL);
p3A7->Sig.ICU_VCUCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x125_Msg)) == CAN_ERR_OK); p3A7->Sig.ICU_VCUCommunicatlost = (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x125_Msg)) == CAN_SIG_NORMAL);
p3A7->Sig.Res0 = 0x0; p3A7->Sig.Res0 = 0x0;
p3A7->Sig.Res1 = 0x00; p3A7->Sig.Res1 = 0x00;
p3A7->Sig.Res2 = 0x00; p3A7->Sig.Res2 = 0x00;
......
#include "Can_RX_User.h"
#include "DoCAN_ISO15765.h"
#include "can.h"
#include "RTE.h"
static uint8_t BMCU_ErrorGrage = 0;
static uint8_t BMCU_BladeSpeedGear = 0;
static uint8_t BMCU_PTOSwicthState = 0;
static uint8_t BMCU_Moto2_Locked_RotorFault = 0;
static uint8_t BMCU_Moto1_Locked_RotorFault = 0;
static uint8_t MBMS_Soc = 0;
static uint8_t MBMS_TOTALWorkState = 0;
static uint8_t MBMS_TOTALSigOn = 0;
static uint8_t MBMS_TOTALSigAcc = 0;
static uint8_t MBMS_TOTALSigCharge = 0;
static uint8_t MBMS_StatSoc = 0;
static uint8_t MBMS_StatBattChargeState = 0;
static uint8_t MBMS_StatBattWorkState = 0;
static uint8_t MMCU_ErrorGrage = 0;
static uint8_t MMCU_ChgProtectState = 0;
static uint8_t MMCU_DCDCEnableState = 0;
static uint8_t MMCU_ParkingGearState = 0;
static uint8_t MMCU_SeatDetectState = 0;
static uint8_t MMCU_LockMotoState = 0;
static uint8_t MMCU_EBSState = 0;
static uint8_t MMCU_TravelSpeedGear = 0;
static uint8_t MMCU_PowerMode = 0;
static uint8_t MMCU_WorkState = 0;
static uint16_t MMCU_AccumulatedWorkHours = 0;
static uint8_t MMCU_SingleWorkingHours = 0;
static uint8_t SBMS_Soc = 0;
static uint8_t SMCU_ErrorGrage = 0;
void Set_CAN_ALL_Signal(void)
{
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x157_Msg)) == CAN_SIG_NORMAL)
{
BMCU_ErrorGrage = Get_CAN_CH0_ID_157_Sig_BMCU_ErrorGrage();
BMCU_BladeSpeedGear = Get_CAN_CH0_ID_157_Sig_BMCU_BladeSpeedGear();
BMCU_PTOSwicthState = Get_CAN_CH0_ID_157_Sig_BMCU_PTOSwicthState();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x38E_Msg)) == CAN_SIG_NORMAL)
{
BMCU_Moto1_Locked_RotorFault = Get_CAN_CH0_ID_38E_Sig_BMCU_Moto1_Locked_RotorFault();
BMCU_Moto2_Locked_RotorFault = Get_CAN_CH0_ID_38E_Sig_BMCU_Moto2_Locked_RotorFault();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A20_Msg)) == CAN_SIG_NORMAL)
{
MBMS_Soc = Get_CAN_CH0_ID_18200A20_Sig_MBMS_Soc();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18202922_Msg)) == CAN_SIG_NORMAL)
{
MBMS_TOTALWorkState = Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALWorkState();
MBMS_TOTALSigOn = Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigOn();
MBMS_TOTALSigAcc = Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigAcc();
MBMS_TOTALSigCharge = Get_CAN_CH0_ID_18202922_Sig_MBMS_TOTALSigCharge();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18203020_Msg)) == CAN_SIG_NORMAL)
{
MBMS_StatSoc = Get_CAN_CH0_ID_18203020_Sig_MBMS_StatSoc();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18203220_Msg)) == CAN_SIG_NORMAL)
{
MBMS_StatBattChargeState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattChargeState();
MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x125_Msg)) == CAN_SIG_NORMAL)
{
MMCU_ErrorGrage = Get_CAN_CH0_ID_125_Sig_MMCU_ErrorGrage();
MMCU_ChgProtectState = Get_CAN_CH0_ID_125_Sig_MMCU_ChgProtectState();
MMCU_DCDCEnableState = Get_CAN_CH0_ID_125_Sig_MMCU_DCDCEnableState();
MMCU_ParkingGearState = Get_CAN_CH0_ID_125_Sig_MMCU_ParkingGearState();
MMCU_SeatDetectState = Get_CAN_CH0_ID_125_Sig_MMCU_SeatDetectState(); // 掉线需要做处理
MMCU_LockMotoState = Get_CAN_CH0_ID_125_Sig_MMCU_LockMotoState();
MMCU_EBSState = Get_CAN_CH0_ID_125_Sig_MMCU_EBSState();
MMCU_TravelSpeedGear = Get_CAN_CH0_ID_125_Sig_MMCU_TravelSpeedGear();
MMCU_PowerMode = Get_CAN_CH0_ID_125_Sig_MMCU_PowerMode();
MMCU_WorkState = Get_CAN_CH0_ID_125_Sig_MMCU_WorkState();
}
else
{
MMCU_SeatDetectState = Get_CAN_CH0_ID_125_Sig_MMCU_SeatDetectState(); // 掉线需要做处理
MMCU_PowerMode = POWER_CHECK_NULL;
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x339_Msg)) == CAN_SIG_NORMAL)
{
MMCU_AccumulatedWorkHours = Get_CAN_CH0_ID_339_Sig_MMCU_AccumulatedWorkHours();
MMCU_SingleWorkingHours = Get_CAN_CH0_ID_339_Sig_MMCU_SingleWorkingHours();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A21_Msg)) == CAN_SIG_NORMAL)
{
SBMS_Soc = Get_CAN_CH0_ID_18200A21_Sig_SBMS_Soc();
}
if (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A21_Msg)) == CAN_SIG_NORMAL)
{
SMCU_ErrorGrage = Get_CAN_CH0_ID_134_Sig_SMCU_ErrorGrage();
}
}
uint8_t Get_CAN_Num_BMCU_ErrorGrage(void)
{
return BMCU_ErrorGrage;
}
uint8_t Get_CAN_Num_BMCU_BladeSpeedGear(void)
{
return BMCU_BladeSpeedGear;
}
uint8_t Get_CAN_Num_BMCU_PTOSwicthState(void)
{
return BMCU_PTOSwicthState;
}
uint8_t Get_CAN_Num_BMCU_Moto2_Locked_RotorFault(void)
{
return BMCU_Moto2_Locked_RotorFault;
}
uint8_t Get_CAN_Num_BMCU_Moto1_Locked_RotorFault(void)
{
return BMCU_Moto1_Locked_RotorFault;
}
uint8_t Get_CAN_Num_MBMS_Soc(void)
{
return MBMS_Soc;
}
uint8_t Get_CAN_Num_MBMS_TOTALWorkState(void)
{
return MBMS_TOTALWorkState;
}
uint8_t Get_CAN_Num_MBMS_TOTALSigOn(void)
{
return MBMS_TOTALSigOn;
}
uint8_t Get_CAN_Num_MBMS_TOTALSigAcc(void)
{
return MBMS_TOTALSigAcc;
}
uint8_t Get_CAN_Num_MBMS_TOTALSigCharge(void)
{
return MBMS_TOTALSigCharge;
}
uint8_t Get_CAN_Num_MBMS_StatSoc(void)
{
return MBMS_StatSoc;
}
uint8_t Get_CAN_Num_MBMS_StatBattChargeState(void)
{
return MBMS_StatBattChargeState;
}
uint8_t Get_CAN_Num_MBMS_StatBattWorkState(void)
{
return MBMS_StatBattWorkState;
}
uint8_t Get_CAN_Num_MMCU_ErrorGrage(void)
{
return MMCU_ErrorGrage;
}
uint8_t Get_CAN_Num_MMCU_ChgProtectState(void)
{
return MMCU_ChgProtectState;
}
uint8_t Get_CAN_Num_MMCU_DCDCEnableState(void)
{
return MMCU_DCDCEnableState;
}
uint8_t Get_CAN_Num_MMCU_ParkingGearState(void)
{
return MMCU_ParkingGearState;
}
uint8_t Get_CAN_Num_MMCU_SeatDetectState(void)
{
return MMCU_SeatDetectState;
}
uint8_t Get_CAN_Num_MMCU_LockMotoState(void)
{
return MMCU_LockMotoState;
}
uint8_t Get_CAN_Num_MMCU_EBSState(void)
{
return MMCU_EBSState;
}
uint8_t Get_CAN_Num_MMCU_TravelSpeedGear(void)
{
return MMCU_TravelSpeedGear;
}
uint8_t Get_CAN_Num_MMCU_PowerMode(void)
{
return MMCU_PowerMode;
}
uint8_t Get_CAN_Num_MMCU_WorkState(void)
{
return MMCU_WorkState;
}
uint16_t Get_CAN_Num_MMCU_AccumulatedWorkHours(void)
{
return MMCU_AccumulatedWorkHours;
}
uint8_t Get_CAN_Num_MMCU_SingleWorkingHours(void)
{
return MMCU_SingleWorkingHours;
}
uint8_t Get_CAN_Num_SBMS_Soc(void)
{
return SBMS_Soc;
}
uint8_t Get_CAN_Num_SMCU_ErrorGrage(void)
{
return SMCU_ErrorGrage;
}
uint8_t Get_CAN_Power_State(void)
{
uint8_t state = 0;
uint8_t Power_State = Get_CAN_Num_MMCU_PowerMode();
switch (Power_State)
{
case 0x0:
state = KEY_OFF;
break;
case 0x1:
state = PKEY_ON;
break;
case 0x2:
state = KEY_ACC;
break;
case 0x3:
state = READY;
break;
case 0x4:
state = CHRG_PLUGIN;
break;
case 0x5:
state = CHRGING;
break;
case 0x6:
state = CHRGEND;
break;
case 0x7:
state = POWER_CHECK_NULL;
break;
default:
break;
}
return state;
}
#ifndef _CAN_RX_USER_H_
#define _CAN_RX_USER_H_
#include "RTE.h"
#include "Application.h"
#include "Components.h"
extern uint8_t Get_CAN_Num_BMCU_ErrorGrage(void);
extern uint8_t Get_CAN_Num_BMCU_BladeSpeedGear(void);
extern uint8_t Get_CAN_Num_BMCU_PTOSwicthState(void);
extern uint8_t Get_CAN_Num_BMCU_Moto2_Locked_RotorFault(void);
extern uint8_t Get_CAN_Num_BMCU_Moto1_Locked_RotorFault(void);
extern uint8_t Get_CAN_Num_MBMS_Soc(void);
extern uint8_t Get_CAN_Num_MBMS_TOTALWorkState(void);
extern uint8_t Get_CAN_Num_MBMS_TOTALSigOn(void);
extern uint8_t Get_CAN_Num_MBMS_TOTALSigAcc(void);
extern uint8_t Get_CAN_Num_MBMS_TOTALSigCharge(void);
extern uint8_t Get_CAN_Num_MBMS_StatSoc(void);
extern uint8_t Get_CAN_Num_MBMS_StatBattChargeState(void);
extern uint8_t Get_CAN_Num_MBMS_StatBattWorkState(void);
extern uint8_t Get_CAN_Num_MMCU_ErrorGrage(void);
extern uint8_t Get_CAN_Num_MMCU_ChgProtectState(void);
extern uint8_t Get_CAN_Num_MMCU_DCDCEnableState(void);
extern uint8_t Get_CAN_Num_MMCU_ParkingGearState(void);
extern uint8_t Get_CAN_Num_MMCU_SeatDetectState(void);
extern uint8_t Get_CAN_Num_MMCU_LockMotoState(void);
extern uint8_t Get_CAN_Num_MMCU_EBSState(void);
extern uint8_t Get_CAN_Num_MMCU_TravelSpeedGear(void);
extern uint8_t Get_CAN_Num_MMCU_PowerMode(void);
extern uint8_t Get_CAN_Num_MMCU_WorkState(void);
extern uint16_t Get_CAN_Num_MMCU_AccumulatedWorkHours(void);
extern uint8_t Get_CAN_Num_MMCU_SingleWorkingHours(void);
extern uint8_t Get_CAN_Num_SBMS_Soc(void);
extern uint8_t Get_CAN_Num_SMCU_ErrorGrage(void);
extern uint8_t Get_CAN_Power_State(void);
extern void Set_CAN_ALL_Signal(void);
#endif
...@@ -10,7 +10,7 @@ static uint32_t PowerSocTimeLine; ...@@ -10,7 +10,7 @@ static uint32_t PowerSocTimeLine;
static COMMON_PowerStatus_t PowerSts; /*1 ON ; 0 OFF*/ static COMMON_PowerStatus_t PowerSts; /*1 ON ; 0 OFF*/
static DataValid_t PowerSts_Valid; static DataValid_t PowerSts_Valid;
uint8_t Power_Stay_Flag = 0;
// static uint16_t u16SelfCheckTime; // static uint16_t u16SelfCheckTime;
/*每次唤醒调用*/ /*每次唤醒调用*/
void Common_DataInit(void) void Common_DataInit(void)
...@@ -30,7 +30,6 @@ uint8_t Common_Get_IG_Sts(void) ...@@ -30,7 +30,6 @@ uint8_t Common_Get_IG_Sts(void)
return (uint8_t)PowerSts; return (uint8_t)PowerSts;
} }
uint16_t Common_Get_TireSize(void) uint16_t Common_Get_TireSize(void)
{ {
return 1u; return 1u;
...@@ -50,23 +49,29 @@ void Common_Set_IG_Sts_Valid(DataValid_t Val) ...@@ -50,23 +49,29 @@ void Common_Set_IG_Sts_Valid(DataValid_t Val)
PowerSts_Valid = Val; PowerSts_Valid = Val;
} }
void Common_Input_Para(void) void Common_Input_Para(void)
{ {
if (SYS_OPR_STAT_IGN_ON) if (SYS_OPR_STAT_IGN_ON)
{ {
if ((Get_CAN_Power_State() != KEY_OFF)) if ((Get_CAN_Power_State() != KEY_OFF) && (System_Indicator_CANFlag != 1))
{ {
Common_Set_IG_Sts(COMMON_POWER_ON); Common_Set_IG_Sts(COMMON_POWER_ON);
Common_Set_IG_Sts_Valid(COMMON_Valid); Common_Set_IG_Sts_Valid(COMMON_Valid);
PowerIgnOffTimeLine = 0ul; PowerIgnOffTimeLine = 0ul;
if (PowerIgnOnTimeLine < 0x7ffffffful) if (PowerIgnOnTimeLine < 0x7ffffffful && (Get_CAN_Power_State() != PKEY_ON))
{ {
PowerIgnOnTimeLine += 2u; PowerIgnOnTimeLine += 2u;
} }
} }
else if (System_Indicator_CANFlag == 1)
{
Common_Set_IG_Sts(COMMON_POWER_ON);
Common_Set_IG_Sts_Valid(COMMON_Valid);
PowerIgnOffTimeLine = 0ul;
PowerIgnOnTimeLine = 0ul;
}
else else
{ {
PowerIgnOnTimeLine = 0ul; PowerIgnOnTimeLine = 0ul;
...@@ -77,9 +82,10 @@ void Common_Input_Para(void) ...@@ -77,9 +82,10 @@ void Common_Input_Para(void)
Common_Set_IG_Sts(COMMON_POWER_OFF); Common_Set_IG_Sts(COMMON_POWER_OFF);
Common_Set_IG_Sts_Valid(COMMON_Valid); Common_Set_IG_Sts_Valid(COMMON_Valid);
} }
if ((Get_CAN_Power_State() == PKEY_ON)) if ((Get_CAN_Power_State() == PKEY_ON) || (Power_Stay_Flag == 1))
{ {
PowerIgnOnTimeLine = 0ul; PowerIgnOnTimeLine = 0ul;
Power_Stay_Flag = 0;
} }
} }
else else
...@@ -108,4 +114,3 @@ uint32_t Common_GetSocTime(void) ...@@ -108,4 +114,3 @@ uint32_t Common_GetSocTime(void)
{ {
return PowerSocTimeLine; return PowerSocTimeLine;
} }
...@@ -72,7 +72,7 @@ extern void Common_Set_Disp_V_Speed_Valid(DataValid_t Val); ...@@ -72,7 +72,7 @@ extern void Common_Set_Disp_V_Speed_Valid(DataValid_t Val);
// extern uint16_t Common_Get_DispSpeed(void); // extern uint16_t Common_Get_DispSpeed(void);
extern uint32_t Common_GetIgnOnTime(void); /*ms*/ extern uint32_t Common_GetIgnOnTime(void); /*ms*/
extern uint32_t Common_GetIgnOffTime(void); /*ms*/ extern uint32_t Common_GetIgnOffTime(void); /*ms*/
extern uint8_t Power_Stay_Flag;
#endif #endif
...@@ -84,74 +84,74 @@ void Gpio_Init(_GpioUser_Enum InitMode) ...@@ -84,74 +84,74 @@ void Gpio_Init(_GpioUser_Enum InitMode)
} }
else else
{ {
RTE_GPIO_Config(RTE_GPIO_PORT00_PIN00, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT00_PIN00, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT00_PIN01, RTE_GPIO_DIR_IN); RTE_GPIO_Config(RTE_GPIO_PORT00_PIN01, RTE_GPIO_DIR_IN); //KL15
RTE_GPIO_Config(RTE_GPIO_PORT00_PIN02, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT00_PIN02, RTE_GPIO_DIR_IN); //段码SPI10-SD-1
RTE_GPIO_Config(RTE_GPIO_PORT00_PIN03, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT00_PIN03, RTE_GPIO_DIR_IN); //段码SPI10-CSB-1
RTE_GPIO_Config(RTE_GPIO_PORT00_PIN04, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT00_PIN04, RTE_GPIO_DIR_IN); //段码SPI10-SCL-1
RTE_GPIO_Config(RTE_GPIO_PORT00_PIN05, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT00_PIN05, RTE_GPIO_DIR_IN); //按键E信号_N_IN_MCU
RTE_GPIO_Config(RTE_GPIO_PORT00_PIN06, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT00_PIN06, RTE_GPIO_DIR_IN); //按键D信号_N_IN_MCU
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN00, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT01_PIN00, RTE_GPIO_DIR_IN); //表盘背光-PWM
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN01, RTE_GPIO_DIR_IN); RTE_GPIO_Config(RTE_GPIO_PORT01_PIN01, RTE_GPIO_DIR_IN); //RXD-ESP-IN-MCU
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN02, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT01_PIN02, GpioOut_Low); //TXD-ESP-IN-MCU
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN03, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT01_PIN03, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN04, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT01_PIN04, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN05, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT01_PIN05, GpioOut_Low); //总计工作时长统计千位_MCU_OUT
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN06, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT01_PIN06, GpioOut_Low); //总计工作时长统计百十位_MCU_OUT
RTE_GPIO_Config(RTE_GPIO_PORT01_PIN07, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT01_PIN07, GpioOut_Low); //交互指示灯_PWM_MCU_OUT
RTE_GPIO_Config(RTE_GPIO_PORT02_PIN00, GpioOut_High); RTE_GPIO_Config(RTE_GPIO_PORT02_PIN00, RTE_GPIO_DIR_IN); //AVDD
RTE_GPIO_Config(RTE_GPIO_PORT02_PIN01, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT02_PIN01, RTE_GPIO_DIR_IN); //GND
RTE_GPIO_Config(RTE_GPIO_PORT02_PIN02, RTE_GPIO_DIR_IN); RTE_GPIO_Config(RTE_GPIO_PORT02_PIN02, RTE_GPIO_DIR_IN); //KL30-AD
RTE_GPIO_Config(RTE_GPIO_PORT02_PIN03, RTE_GPIO_DIR_IN); RTE_GPIO_Config(RTE_GPIO_PORT02_PIN03, RTE_GPIO_DIR_IN); //KL15-AD
RTE_GPIO_Config(RTE_GPIO_PORT02_PIN04, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT02_PIN04, GpioOut_Low); //电量十位_MCU_OUT
RTE_GPIO_Config(RTE_GPIO_PORT02_PIN05, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT02_PIN05, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT02_PIN06, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT02_PIN06, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT02_PIN07, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT02_PIN07, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT03_PIN00, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT03_PIN00, GpioOut_Low); //电量百位_MCU_OUT
RTE_GPIO_Config(RTE_GPIO_PORT03_PIN01, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT03_PIN01, GpioOut_Low); //SDB_LED_DRIVER
RTE_GPIO_Config(RTE_GPIO_PORT04_PIN00, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT04_PIN00, GpioOut_Low); //SEDIO-编程
RTE_GPIO_Config(RTE_GPIO_PORT04_PIN01, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT04_PIN01, GpioOut_Low); //OUT_EN_1
RTE_GPIO_Config(RTE_GPIO_PORT04_PIN02, RTE_GPIO_DIR_IN);// RTE_GPIO_Config(RTE_GPIO_PORT04_PIN02, RTE_GPIO_DIR_IN); //OUT_ST
RTE_GPIO_Config(RTE_GPIO_PORT04_PIN03, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT04_PIN03, GpioOut_Low); //OUT_EN
RTE_GPIO_Config(RTE_GPIO_PORT05_PIN00, RTE_GPIO_DIR_IN);// RTE_GPIO_Config(RTE_GPIO_PORT05_PIN00, RTE_GPIO_DIR_IN); //CAN_MCU_RXD
RTE_GPIO_Config(RTE_GPIO_PORT05_PIN01, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT05_PIN01, GpioOut_Low); //CAN_MCU_TXD
RTE_GPIO_Config(RTE_GPIO_PORT05_PIN02, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT05_PIN02, GpioOut_High); //CAN_STB_MCU
RTE_GPIO_Config(RTE_GPIO_PORT05_PIN03, GpioOut_Low);/// RTE_GPIO_Config(RTE_GPIO_PORT05_PIN03, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT05_PIN04, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT05_PIN05, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT05_PIN05, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT06_PIN00, GpioOut_High); RTE_GPIO_Config(RTE_GPIO_PORT06_PIN00, GpioOut_High); //存储SCL
RTE_GPIO_Config(RTE_GPIO_PORT06_PIN01, GpioOut_High); RTE_GPIO_Config(RTE_GPIO_PORT06_PIN01, GpioOut_High); //存储SDA
RTE_GPIO_Config(RTE_GPIO_PORT06_PIN02, GpioOut_High); RTE_GPIO_Config(RTE_GPIO_PORT06_PIN02, GpioOut_High); //SCL_MCU
RTE_GPIO_Config(RTE_GPIO_PORT06_PIN03, GpioOut_High); RTE_GPIO_Config(RTE_GPIO_PORT06_PIN03, GpioOut_High); //SDA_MCU
RTE_GPIO_Config(RTE_GPIO_PORT07_PIN00, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT07_PIN00, RTE_GPIO_DIR_IN); //段码SPI20-SCL-2
RTE_GPIO_Config(RTE_GPIO_PORT07_PIN01, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT07_PIN01, RTE_GPIO_DIR_IN); //段码SPI20-CSB-2
RTE_GPIO_Config(RTE_GPIO_PORT07_PIN02, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT07_PIN02, RTE_GPIO_DIR_IN); //段码SPI20-SD-2
RTE_GPIO_Config(RTE_GPIO_PORT07_PIN03, RTE_GPIO_DIR_IN);// RTE_GPIO_Config(RTE_GPIO_PORT07_PIN03, RTE_GPIO_DIR_IN); //按键C信号-P-MCU-IN
RTE_GPIO_Config(RTE_GPIO_PORT07_PIN04, RTE_GPIO_DIR_IN);// RTE_GPIO_Config(RTE_GPIO_PORT07_PIN04, RTE_GPIO_DIR_IN); //按键B信号-P-MCU-IN
RTE_GPIO_Config(RTE_GPIO_PORT07_PIN05, RTE_GPIO_DIR_IN);// RTE_GPIO_Config(RTE_GPIO_PORT07_PIN05, RTE_GPIO_DIR_IN); //按键A信号-P-MCU-IN
RTE_GPIO_Config(RTE_GPIO_PORT07_PIN06, RTE_GPIO_DIR_IN);// RTE_GPIO_Config(RTE_GPIO_PORT07_PIN06, RTE_GPIO_DIR_IN); //草满指示信号-P-MCU-IN
RTE_GPIO_Config(RTE_GPIO_PORT07_PIN07, RTE_GPIO_DIR_IN);// RTE_GPIO_Config(RTE_GPIO_PORT07_PIN07, RTE_GPIO_DIR_IN); //大灯开启信号-P-MCU-IN
RTE_GPIO_Config(RTE_GPIO_PORT12_PIN00, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT12_PIN00, GpioOut_Low); //L_BiasBitSW_POW---
RTE_GPIO_Config(RTE_GPIO_PORT12_PIN01, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT12_PIN01, GpioOut_Low); //X1
RTE_GPIO_Config(RTE_GPIO_PORT12_PIN02, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT12_PIN02, GpioOut_Low); //X2
RTE_GPIO_Config(RTE_GPIO_PORT12_PIN03, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT12_PIN03, GpioOut_Low); //XT1
RTE_GPIO_Config(RTE_GPIO_PORT12_PIN04, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT12_PIN04, GpioOut_Low); //XT2
RTE_GPIO_Config(RTE_GPIO_PORT13_PIN00, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT13_PIN00, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT13_PIN06, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT13_PIN06, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT13_PIN07, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT13_PIN07, GpioOut_Low); //SWCLK-编程
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN00, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT14_PIN00, GpioOut_Low); //L_BD433Ctrl_OUT
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN01, GpioOut_Low);// RTE_GPIO_Config(RTE_GPIO_PORT14_PIN01, GpioOut_Low); //空
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN06, RTE_GPIO_DIR_IN); RTE_GPIO_Config(RTE_GPIO_PORT14_PIN06, RTE_GPIO_DIR_IN); //A_Version---
RTE_GPIO_Config(RTE_GPIO_PORT14_PIN07, GpioOut_Low); RTE_GPIO_Config(RTE_GPIO_PORT14_PIN07, GpioOut_Low); //空
} }
} }
#include "GUI_Display\GUI_Display.h" #include "GUI_Display\GUI_Display.h"
#include "SEG_DISPLAY\SEG_DISPLAY.h" #include "SEG_DISPLAY\SEG_DISPLAY.h"
#include "Application.h" #include "Application.h"
#define DISPLAY_OPEN ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != PKEY_ON) && (System_Indicator_CANFlag != 1))
uint16_t poweroff_time = 0; uint16_t poweroff_time = 0;
uint8_t SOC_Count_Time = 0; uint8_t SOC_Count_Time = 0;
...@@ -11,7 +11,7 @@ uint8_t Charge_OFF_Flag = 0; ...@@ -11,7 +11,7 @@ uint8_t Charge_OFF_Flag = 0;
void Gauge_Power_SOC_pull_Display(void) void Gauge_Power_SOC_pull_Display(void)
{ {
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState(); // uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if (DISPLAY_OPEN)
{ {
uint8_t Current_1_Grid = Get_CAN_Num_MBMS_Soc_1_Grid(); uint8_t Current_1_Grid = Get_CAN_Num_MBMS_Soc_1_Grid();
uint8_t Current_2_Grid = Get_CAN_Num_SBMS_Soc_2_Grid(); uint8_t Current_2_Grid = Get_CAN_Num_SBMS_Soc_2_Grid();
...@@ -30,7 +30,7 @@ void Gauge_Cutterhead_Gear_Display(void) ...@@ -30,7 +30,7 @@ void Gauge_Cutterhead_Gear_Display(void)
uint8_t Signal1 = Get_CAN_Num_BMCU_BladeSpeedGear(); uint8_t Signal1 = Get_CAN_Num_BMCU_BladeSpeedGear();
uint8_t Signal2 = Get_CAN_Num_BMCU_ErrorGrage(); uint8_t Signal2 = Get_CAN_Num_BMCU_ErrorGrage();
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState(); // uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0) && (Get_CAN_Power_State() == READY)) if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0) && (System_Indicator_CANFlag != 1))
{ {
if ((Signal2 == 0x1) || (Signal2 == 0x2) || (Signal2 == 0x3) || (Signal2 == 0x4)) if ((Signal2 == 0x1) || (Signal2 == 0x2) || (Signal2 == 0x3) || (Signal2 == 0x4))
{ {
...@@ -59,7 +59,7 @@ void Gauge_Gears_Display(void) ...@@ -59,7 +59,7 @@ void Gauge_Gears_Display(void)
uint8_t Signal1 = Get_CAN_Num_MMCU_TravelSpeedGear(); uint8_t Signal1 = Get_CAN_Num_MMCU_TravelSpeedGear();
uint8_t Signal2 = Get_CAN_Num_MMCU_ParkingGearState(); uint8_t Signal2 = Get_CAN_Num_MMCU_ParkingGearState();
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState(); // uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0) && (Get_CAN_Power_State() != KEY_OFF) && (System_Indicator_CANFlag != 1))
{ {
if (Signal2 != 0x1) if (Signal2 != 0x1)
{ {
...@@ -67,6 +67,10 @@ void Gauge_Gears_Display(void) ...@@ -67,6 +67,10 @@ void Gauge_Gears_Display(void)
{ {
SEG_SET_GEAR(1, Signal1, 0); SEG_SET_GEAR(1, Signal1, 0);
} }
else
{
SEG_SET_GEAR(1, Gear_OFF, 0);
}
} }
else else
{ {
...@@ -84,19 +88,18 @@ uint8_t Get_CAN_Num_MBMS_Soc_1_Grid(void) ...@@ -84,19 +88,18 @@ uint8_t Get_CAN_Num_MBMS_Soc_1_Grid(void)
uint8_t num = 0; uint8_t num = 0;
uint8_t Current_SOC_1_Num = Get_CAN_Num_MBMS_Soc(); uint8_t Current_SOC_1_Num = Get_CAN_Num_MBMS_Soc();
num = (Current_SOC_1_Num / 10); num = (Current_SOC_1_Num / 10);
if((Current_SOC_1_Num % 10) != 0) if ((Current_SOC_1_Num % 10) != 0)
{ {
num++; num++;
} }
return num; return num;
} }
uint8_t Get_CAN_Num_SBMS_Soc_2_Grid(void) uint8_t Get_CAN_Num_SBMS_Soc_2_Grid(void)
{ {
uint8_t num = 0; uint8_t num = 0;
uint8_t Current_SOC_2_Num = Get_CAN_Num_SBMS_Soc(); uint8_t Current_SOC_2_Num = Get_CAN_Num_SBMS_Soc();
num = (Current_SOC_2_Num / 10); num = (Current_SOC_2_Num / 10);
if((Current_SOC_2_Num % 10) != 0) if ((Current_SOC_2_Num % 10) != 0)
{ {
num++; num++;
} }
...@@ -110,7 +113,7 @@ void Gauge_Power_SOC_CHAGING_Display(void) ...@@ -110,7 +113,7 @@ void Gauge_Power_SOC_CHAGING_Display(void)
uint8_t MBMS_TOTALSigCharge = Get_CAN_Num_MBMS_TOTALSigCharge(); uint8_t MBMS_TOTALSigCharge = Get_CAN_Num_MBMS_TOTALSigCharge();
uint8_t MBMS_StatBattWorkState = Get_CAN_Num_MBMS_StatBattWorkState(); uint8_t MBMS_StatBattWorkState = Get_CAN_Num_MBMS_StatBattWorkState();
// uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState(); // uint8_t MBMS_StatBattWorkState = Get_CAN_CH0_ID_18203220_Sig_MBMS_StatBattWorkState();
if (Common_Get_IG_Sts() == COMMON_POWER_ON) if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (System_Indicator_CANFlag != 1))
{ {
uint8_t Current_1_Grid = Get_CAN_Num_MBMS_Soc_1_Grid(); uint8_t Current_1_Grid = Get_CAN_Num_MBMS_Soc_1_Grid();
uint8_t Current_2_Grid = Get_CAN_Num_SBMS_Soc_2_Grid(); uint8_t Current_2_Grid = Get_CAN_Num_SBMS_Soc_2_Grid();
...@@ -210,9 +213,13 @@ uint8_t AllSOC_DIS = 0; ...@@ -210,9 +213,13 @@ uint8_t AllSOC_DIS = 0;
void Gauge_EleDial_AllSOC_Display(void) void Gauge_EleDial_AllSOC_Display(void)
{ {
if (Common_Get_IG_Sts() == COMMON_POWER_ON) if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != PKEY_ON) && (System_Indicator_CANFlag != 1))
{ {
AllSOC_DIS = Get_CAN_Num_MBMS_StatSoc(); AllSOC_DIS = Get_CAN_Num_MBMS_StatSoc();
if (AllSOC_DIS > 100)
{
AllSOC_DIS = 100;
}
SEG_SET_EleDial_AllSOC(1, AllSOC_DIS); SEG_SET_EleDial_AllSOC(1, AllSOC_DIS);
} }
else else
...@@ -238,11 +245,11 @@ uint8_t Clockonetime_flag = 0; ...@@ -238,11 +245,11 @@ uint8_t Clockonetime_flag = 0;
void Gauge_Clock_Display(void) void Gauge_Clock_Display(void)
{ {
uint32_t Clock_all = 0; uint32_t Clock_all = 0;
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if (DISPLAY_OPEN)
{ {
Clock_all = Get_CAN_Num_MMCU_SingleWorkingHours(); Clock_all = Get_CAN_Num_MMCU_SingleWorkingHours();
uint8_t Clock_hours = Clock_all / 10; uint8_t Clock_hours = Clock_all / 10;
uint8_t Clock_min = (Clock_all % 10)*6; uint8_t Clock_min = (Clock_all % 10) * 6;
SEG_SET_Clock(Clock_hours, Clock_min, FLASH_SYNC_1Hz, 1, 1); SEG_SET_Clock(Clock_hours, Clock_min, FLASH_SYNC_1Hz, 1, 1);
Clockonetime_flag = 1; Clockonetime_flag = 1;
} }
...@@ -257,32 +264,40 @@ uint8_t Get_Clockonetime_lenth(void) ...@@ -257,32 +264,40 @@ uint8_t Get_Clockonetime_lenth(void)
return Clockonetime_flag; return Clockonetime_flag;
} }
uint16_t EEPROM_Write_Time = 0; uint32_t u32Data_read[1] = {0};
uint32_t CumulativeWorkHours_Writeback = 0;
uint8_t CumulativeWorkHours_readDiffer = 0;
void Data_CumulativeWorkHours_EEPROM_Write(void) void Data_CumulativeWorkHours_EEPROM_Write(void)
{ {
uint32_t CurrentData = 0;
uint32_t u32Data[1] = {0}; uint32_t u32Data[1] = {0};
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if (DISPLAY_OPEN)
{ {
u32Data[0] = Get_CAN_Num_MMCU_AccumulatedWorkHours(); CurrentData = Get_CAN_Num_MMCU_AccumulatedWorkHours();
if (++EEPROM_Write_Time > 6000) // 一分钟存一次 if (CurrentData > CumulativeWorkHours_Writeback)
{ {
EEPROM_Write_Time = 0; CumulativeWorkHours_readDiffer = CurrentData - CumulativeWorkHours_Writeback;
eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data_read, 4);
u32Data[0] = u32Data_read[0] + CumulativeWorkHours_readDiffer;
eeprom_WriteRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data, 4);
CumulativeWorkHours_Writeback = CurrentData;
} }
if (EEPROM_Write_Time == 0) else if (CurrentData < CumulativeWorkHours_Writeback)
{ {
CumulativeWorkHours_readDiffer = CumulativeWorkHours_Writeback - CurrentData;
eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data_read, 4);
u32Data[0] = u32Data_read[0] - CumulativeWorkHours_readDiffer;
eeprom_WriteRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data, 4); eeprom_WriteRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data, 4);
CumulativeWorkHours_Writeback = CurrentData;
} }
} }
else
{
EEPROM_Write_Time = 0;
}
} }
uint32_t u32Data_read[1] = {0};
void Gauge_Clock_All_Display(void) void Gauge_Clock_All_Display(void)
{ {
eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data_read, 4); eeprom_ReadRecord(EEPROM_BLOCK_00, (uint8_t *)u32Data_read, 4);
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if (DISPLAY_OPEN)
{ {
SEG_SET_Clock_ALL(1, u32Data_read[0]); SEG_SET_Clock_ALL(1, u32Data_read[0]);
} }
...@@ -306,7 +321,7 @@ uint8_t Get_Clock_All_lenth(void) ...@@ -306,7 +321,7 @@ uint8_t Get_Clock_All_lenth(void)
} }
void Gauge_Frame_Display(void) void Gauge_Frame_Display(void)
{ {
if ((Common_Get_IG_Sts() == COMMON_POWER_ON) && (Charge_OFF_Flag == 0)) if (DISPLAY_OPEN)
{ {
SEG_SET_Frame(1); SEG_SET_Frame(1);
} }
...@@ -331,19 +346,25 @@ void Gauge_Service(void) ...@@ -331,19 +346,25 @@ void Gauge_Service(void)
uint8_t i = 0; uint8_t i = 0;
if (Common_Get_IG_Sts() == COMMON_POWER_ON) if (Common_Get_IG_Sts() == COMMON_POWER_ON)
{ {
if (Get_CAN_Power_State() != PKEY_ON) if ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != POWER_CHECK_NULL))
{ {
BUZZER_Init(); BUZZER_Init();
interact_PWM_Low_Duty = 100;
if (Common_GetIgnOnTime() > 1500) if (Common_GetIgnOnTime() > 1500)
{ {
SOC_charge_seg_Flag = 0; SOC_charge_seg_Flag = 0;
Checkself_Init(); Checkself_Init();
interact_PWM_Low_Duty = 100;
Gauge_CAN_setup_Service(); Gauge_CAN_setup_Service();
} }
else else
{ {
checkself_seg_Flag = 1; checkself_seg_Flag = 1;
if(Get_CAN_Power_State() == KEY_ACC)
{
interact_PWM_Low_Duty = 0;
}
Checkself_LED_Display(); Checkself_LED_Display();
// Checkself_SEG_Display(); // Checkself_SEG_Display();
} }
...@@ -358,13 +379,12 @@ void Gauge_Service(void) ...@@ -358,13 +379,12 @@ void Gauge_Service(void)
{ {
LED_Driver_Channel_Set(LampChannel_0, i, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, i, LED_OFF);
} }
Checkself_Init();
// Gpio_Init(Gpio_Sleep_Init); // Gpio_Init(Gpio_Sleep_Init);
} }
interact_PWM_Low_Duty = 50; interact_PWM_Low_Duty = 50;
if (FLASH_SYNC_05Hz) if (FLASH_SYNC_05Hz)
{ {
SEG_SET_GEAR(1, Gear_P, 0);
if (Buzzer_time <= 6000) if (Buzzer_time <= 6000)
{ {
RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_HIGH); // OUT_EN_1 RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_HIGH); // OUT_EN_1
...@@ -378,7 +398,6 @@ void Gauge_Service(void) ...@@ -378,7 +398,6 @@ void Gauge_Service(void)
} }
else else
{ {
SEG_SET_GEAR(1, Gear_OFF, 0);
RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_LOW); // OUT_EN_1 RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_LOW); // OUT_EN_1
BUZZER_ON = 0; BUZZER_ON = 0;
} }
...@@ -393,6 +412,7 @@ void Gauge_Service(void) ...@@ -393,6 +412,7 @@ void Gauge_Service(void)
BUZZER_Init(); BUZZER_Init();
poweroff_time = 0; poweroff_time = 0;
Clear_Bu98(); Clear_Bu98();
interact_PWM_Low_Duty = 100;
for (i = 0; i < LampCh0_MAX; i++) for (i = 0; i < LampCh0_MAX; i++)
{ {
LED_Driver_Channel_Set(LampChannel_0, i, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, i, LED_OFF);
...@@ -411,6 +431,8 @@ void Gauge_CAN_setup_Service(void) ...@@ -411,6 +431,8 @@ void Gauge_CAN_setup_Service(void)
Gauge_Frame_Display(); Gauge_Frame_Display();
Gauge_Cutterhead_Gear_Display(); Gauge_Cutterhead_Gear_Display();
Gauge_Gears_Display(); Gauge_Gears_Display();
uint8_t MBMS_TOTALSigAcc = Get_CAN_Num_MBMS_TOTALSigAcc();
uint8_t MBMS_TOTALSigCharge = Get_CAN_Num_MBMS_TOTALSigCharge();
switch (state) switch (state)
{ {
case KEY_ACC: case KEY_ACC:
...@@ -435,24 +457,21 @@ void Gauge_CAN_setup_Service(void) ...@@ -435,24 +457,21 @@ void Gauge_CAN_setup_Service(void)
if (poweroff_time < 3600) if (poweroff_time < 3600)
{ {
Gauge_Power_SOC_CHAGING_Display(); Gauge_Power_SOC_CHAGING_Display();
if (poweroff_time == 0) if (MBMS_TOTALSigAcc == 0x0 && MBMS_TOTALSigCharge == 0x1) // 下电充电)
{ {
Charge_OFF_Flag = 0; Charge_OFF_Flag = 1;
} }
else else
{ {
Charge_OFF_Flag = 1; Charge_OFF_Flag = 0;
} }
} }
else else
{ {
Charge_OFF_Flag = 2; Charge_OFF_Flag = 2;
uint8_t MBMS_TOTALSigAcc = Get_CAN_Num_MBMS_TOTALSigAcc();
uint8_t MBMS_TOTALSigCharge = Get_CAN_Num_MBMS_TOTALSigCharge();
SEG_SET_EleDial_AllSOC(0, 0);
SEG_SET_EleDial_1SOC(0, 0); SEG_SET_EleDial_1SOC(0, 0);
SEG_SET_EleDial_2SOC(0, 0); SEG_SET_EleDial_2SOC(0, 0);
if (MBMS_TOTALSigAcc == 0x1 && MBMS_TOTALSigCharge == 0x1) // 电充电) if (MBMS_TOTALSigAcc == 0x1 && MBMS_TOTALSigCharge == 0x1) // 电充电)
{ {
Charge_OFF_Flag = 0; Charge_OFF_Flag = 0;
poweroff_time = 0; poweroff_time = 0;
...@@ -461,17 +480,23 @@ void Gauge_CAN_setup_Service(void) ...@@ -461,17 +480,23 @@ void Gauge_CAN_setup_Service(void)
} }
break; break;
case CHRG_PLUGIN: case CHRG_PLUGIN:
{
Charge_OFF_Flag = 0;
Gauge_Power_SOC_pull_Display();
poweroff_time = 0;
}
break;
case CHRGEND: case CHRGEND:
{ {
if (MBMS_TOTALSigAcc == 0x0 && MBMS_TOTALSigCharge == 0x1) // 下电充电)
{
Charge_OFF_Flag = 2;
SEG_SET_EleDial_AllSOC(0, 0);
SEG_SET_EleDial_1SOC(0, 0);
SEG_SET_EleDial_2SOC(0, 0);
SOC1_Count = 0;
SOC2_Count = 0;
}
else
{
Charge_OFF_Flag = 0;
Gauge_Power_SOC_pull_Display();
}
poweroff_time = 0; poweroff_time = 0;
Charge_OFF_Flag = 0;
Gauge_Power_SOC_pull_Display();
} }
break; break;
...@@ -484,8 +509,8 @@ void Checkself_LED_Display(void) ...@@ -484,8 +509,8 @@ void Checkself_LED_Display(void)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_00_Grass_Full_R, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_00_Grass_Full_R, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_ON);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Gears_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_ON);
...@@ -502,7 +527,7 @@ void Checkself_LED_Display(void) ...@@ -502,7 +527,7 @@ void Checkself_LED_Display(void)
LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Working_Hours_One_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Working_Hours_One_W, LED_ON);
LED_Driver_Channel_Set(LampChannel_0, LampCh0_32_Charging_Connection_R, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_32_Charging_Connection_R, LED_ON);
SEG_SET_LED_STS(SEG_LED_Recharge, 1); SEG_SET_LED_STS(SEG_LED_Recharge, 1);
// SEG_SET_LED_STS(SEG_LED_System_Light, 1); SEG_SET_LED_STS(SEG_LED_System_Light, 1);
SEG_SET_LED_STS(SEG_LED_Chloramine, 1); SEG_SET_LED_STS(SEG_LED_Chloramine, 1);
SEG_SET_LED_STS(SEG_LED_Cutter_Overload, 1); SEG_SET_LED_STS(SEG_LED_Cutter_Overload, 1);
SEG_SET_LED_STS(SEG_LED_Seat_Detection, 1); SEG_SET_LED_STS(SEG_LED_Seat_Detection, 1);
...@@ -512,11 +537,12 @@ void Checkself_LED_Display(void) ...@@ -512,11 +537,12 @@ void Checkself_LED_Display(void)
// SEG_SET_LED_STS(SEG_LED_External_Discharge, 1); // SEG_SET_LED_STS(SEG_LED_External_Discharge, 1);
SEG_SET_LED_STS(SEG_LED_Distance_Light, 1); SEG_SET_LED_STS(SEG_LED_Distance_Light, 1);
SEG_SET_LED_STS(SEG_LED_HHT_Charger, 1); SEG_SET_LED_STS(SEG_LED_HHT_Charger, 1);
SEG_SET_Frame(1);
} }
void BUZZER_Init(void) void BUZZER_Init(void)
{ {
Buzzer_time = 0; Buzzer_time = 0;
BUZZER_ON = 0; BUZZER_ON = 0;
RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, GpioOut_Low); // OUT_EN_1 RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_LOW); // OUT_EN_1
} }
...@@ -39,6 +39,7 @@ typedef struct ...@@ -39,6 +39,7 @@ typedef struct
extern uint8_t BUZZER_ON; extern uint8_t BUZZER_ON;
extern uint8_t Charge_OFF_Flag; extern uint8_t Charge_OFF_Flag;
extern uint8_t EEPROM_Cumulativee_clean; extern uint8_t EEPROM_Cumulativee_clean;
extern uint16_t poweroff_time;
void Gauge_Power_SOC_pull_Display(void); void Gauge_Power_SOC_pull_Display(void);
// void Gauge_Power_2_SOC_Display(void); // void Gauge_Power_2_SOC_Display(void);
......
#include "SEG_DISPLAY\SEG_DISPLAY.h" #include "SEG_DISPLAY\SEG_DISPLAY.h"
#include "GPIO_USER\GpioUser.h" #include "GPIO_USER\GpioUser.h"
#include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h"
#define Clr_Bit(p, b) (p) &= (~(1u << (b))) #define Clr_Bit(p, b) (p) &= (~(1u << (b)))
#define Set_Bit(p, b) (p) |= (1u << (b)) #define Set_Bit(p, b) (p) |= (1u << (b))
...@@ -250,7 +251,6 @@ _Fun_Res SEG_SET_Cutterhead(uint8_t m_Flag, uint8_t LED_NUM, uint8_t checkself) ...@@ -250,7 +251,6 @@ _Fun_Res SEG_SET_Cutterhead(uint8_t m_Flag, uint8_t LED_NUM, uint8_t checkself)
} }
else else
{ {
IC1_SEG117 = IC_SEG_OFF;
IC1_SEG075 = IC_SEG_OFF; IC1_SEG075 = IC_SEG_OFF;
IC1_SEG082 = IC_SEG_OFF; IC1_SEG082 = IC_SEG_OFF;
IC1_SEG081 = IC_SEG_OFF; IC1_SEG081 = IC_SEG_OFF;
...@@ -258,13 +258,6 @@ _Fun_Res SEG_SET_Cutterhead(uint8_t m_Flag, uint8_t LED_NUM, uint8_t checkself) ...@@ -258,13 +258,6 @@ _Fun_Res SEG_SET_Cutterhead(uint8_t m_Flag, uint8_t LED_NUM, uint8_t checkself)
IC1_SEG078 = IC_SEG_OFF; IC1_SEG078 = IC_SEG_OFF;
IC1_SEG076 = IC_SEG_OFF; IC1_SEG076 = IC_SEG_OFF;
IC1_SEG077 = IC_SEG_OFF; IC1_SEG077 = IC_SEG_OFF;
IC1_SEG118 = IC_SEG_OFF;
IC1_SEG073 = IC_SEG_OFF;
IC1_SEG074 = IC_SEG_OFF;
IC1_SEG079 = IC_SEG_OFF;
IC1_SEG083 = IC_SEG_OFF;
IC1_SEG116 = IC_SEG_OFF;
} }
} }
} }
...@@ -321,16 +314,16 @@ _Fun_Res SEG_SET_GEAR(uint8_t m_Gear_Flag, uint8_t m_Gear, uint8_t checkself) ...@@ -321,16 +314,16 @@ _Fun_Res SEG_SET_GEAR(uint8_t m_Gear_Flag, uint8_t m_Gear, uint8_t checkself)
if (checkself == 1) if (checkself == 1)
{ {
m8 = SEG_DISPLAY_NUMBER0[m_Gear]; m8 = SEG_DISPLAY_NUMBER0[m_Gear];
if (m_Gear == 8) // if (m_Gear == 8)
{ // {
IC2_SEG096 = IC_SEG_ON; // IC2_SEG096 = IC_SEG_ON;
IC2_SEG142 = IC_SEG_ON; // IC2_SEG142 = IC_SEG_ON;
} // }
else // else
{ // {
IC2_SEG096 = IC_SEG_OFF; // IC2_SEG096 = IC_SEG_OFF;
IC2_SEG142 = IC_SEG_OFF; // IC2_SEG142 = IC_SEG_OFF;
} // }
if (Bit_Is_Set(m8, 0)) if (Bit_Is_Set(m8, 0))
{ {
IC2_SEG148 = IC_SEG_ON; IC2_SEG148 = IC_SEG_ON;
...@@ -571,7 +564,7 @@ _Fun_Res SEG_SET_EleDial_1SOC(uint8_t m_Flag, uint8_t m_SEG) ...@@ -571,7 +564,7 @@ _Fun_Res SEG_SET_EleDial_1SOC(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 == 1u) if (((m_Flag == 1u) && (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A20_Msg)) == CAN_SIG_NORMAL)) || (checkself_seg_Flag == 1))
{ {
IC1_SEG136 = IC_SEG_GREY; IC1_SEG136 = IC_SEG_GREY;
IC1_SEG137 = IC_SEG_GREY; IC1_SEG137 = IC_SEG_GREY;
...@@ -663,7 +656,7 @@ _Fun_Res SEG_SET_EleDial_2SOC(uint8_t m_Flag, uint8_t m_SEG) ...@@ -663,7 +656,7 @@ _Fun_Res SEG_SET_EleDial_2SOC(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 == 1u) if (((m_Flag == 1u) && (CAN_MSG_Status(&CAN_CH0_CanMsgOp, Co_Can_ConvertSubID_CAN_CH0(CAN_CH0_ID_CAN_0x18200A21_Msg)) == CAN_SIG_NORMAL)) || (checkself_seg_Flag == 1))
{ {
IC1_SEG124 = IC_SEG_ON; IC1_SEG124 = IC_SEG_ON;
IC1_SEG123 = IC_SEG_ON; IC1_SEG123 = IC_SEG_ON;
...@@ -2613,31 +2606,36 @@ void Checkself_SEG_Display(void) ...@@ -2613,31 +2606,36 @@ void Checkself_SEG_Display(void)
uint16_t Trip = 0; uint16_t Trip = 0;
uint16_t hour = 0; uint16_t hour = 0;
uint16_t min = 0; uint16_t min = 0;
uint8_t Checkself_num = ((Checkself_SEG_step*10) / 48);
soc_all = (Checkself_SEG_step / 1) * 11 + 100; if(Checkself_num >= 10)
uint32_t allhour = (Checkself_SEG_step / 1) * 11111; {
Checkself_num = 9;
}
uint32_t allhour = Checkself_num * 11111;
// Fuel = Checkself_SEG_step / 5u; // Fuel = Checkself_SEG_step / 5u;
// SEG_SET_FuelDial(1, Fuel); // SEG_SET_FuelDial(1, Fuel);
uint32_t EleDial_2SOC = ((Checkself_SEG_step*10) / 48);
SEG_SET_EleDial_2SOC(1, EleDial_2SOC);
SEG_SET_EleDial_1SOC(1, EleDial_2SOC);
soc_all = Checkself_num * 11 + 100;
SEG_SET_EleDial_AllSOC(1, soc_all); SEG_SET_EleDial_AllSOC(1, soc_all);
SEG_SET_EleDial_2SOC(1, (Checkself_SEG_step / 1) + 1);
SEG_SET_EleDial_1SOC(1, (Checkself_SEG_step / 1) + 1);
SEG_SET_Clock_ALL(1, allhour); SEG_SET_Clock_ALL(1, allhour);
hour = (Checkself_SEG_step / 1) * 11; hour = Checkself_num * 11;
min = (Checkself_SEG_step / 1) * 11; min = Checkself_num * 11;
SEG_SET_Clock(hour, min, 1, 1, 1); SEG_SET_Clock(hour, min, 1, 1, 1);
SEG_SET_GEAR(1, (Checkself_SEG_step / 1), 1); SEG_SET_GEAR(1, Checkself_num, 1);
SEG_SET_Cutterhead(1, (Checkself_SEG_step / 1), 1); SEG_SET_Cutterhead(1, Checkself_num, 1);
if (Checkself_SEG_step_count < 20) if (Checkself_SEG_step_count < 100)
{ {
Checkself_SEG_step_count++; Checkself_SEG_step_count++;
} }
else else
{ {
Checkself_SEG_step_count = 20; Checkself_SEG_step_count = 100;
} }
if (Checkself_SEG_step_count < 10) if (Checkself_SEG_step_count < 50)
{ {
Checkself_SEG_step++; Checkself_SEG_step++;
} }
......
...@@ -16,7 +16,7 @@ typedef enum ...@@ -16,7 +16,7 @@ typedef enum
LampCh0_00_Grass_Full_R = 0, //草满指示灯-R-AW21036-OUT LampCh0_00_Grass_Full_R = 0, //草满指示灯-R-AW21036-OUT
LampCh0_01_Power_Battery_Failure_R, //动力电池故障指示灯-R-AW21036-OUT LampCh0_01_Power_Battery_Failure_R, //动力电池故障指示灯-R-AW21036-OUT
LampCh0_02_System_Indicator_R, //系统指示灯-R-AW21036-OUT LampCh0_02_System_Indicator_R, //系统指示灯-R-AW21036-OUT
LampCh0_03_P_GEAR_G, //空挡指示灯-G-AW21036-OUT LampCh0_03_N_GEAR_G, //空挡指示灯-G-AW21036-OUT
LampCh0_04_GEAR_W, //GEAR-W-AW21036-OUT LampCh0_04_GEAR_W, //GEAR-W-AW21036-OUT
LampCh0_05_Gears_W, //挡位-WAW21036-OUT LampCh0_05_Gears_W, //挡位-WAW21036-OUT
LampCh0_06_Oil_Pressure_R, //机油压力指示灯-R-AW21036-OUT LampCh0_06_Oil_Pressure_R, //机油压力指示灯-R-AW21036-OUT
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] = const Line_In_Attribute_st g_stLineInAttribute[LINE_IN_MAX] =
{ {
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 120U, 20U, Get_LINE_IN_GrassFull, }, {LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 470U, 20U, Get_LINE_IN_GrassFull, },
{LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 120U, 20U, Get_LINE_IN_BigLED, }, {LEVEL_LOW, LEVEL_HIGH, LINE_IN_IG_ON, 470U, 20U, Get_LINE_IN_BigLED, },
}; };
......
...@@ -69,7 +69,7 @@ static void Power_KL30_Init(void) ...@@ -69,7 +69,7 @@ static void Power_KL30_Init(void)
g_stRTCInformation.u8RTCMonth = 1; g_stRTCInformation.u8RTCMonth = 1;
g_stRTCInformation.u8RTCYear = 20; g_stRTCInformation.u8RTCYear = 20;
RTE_RTC_Init(g_stRTCInformation); RTE_RTC_Init(g_stRTCInformation);
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(CAN_MCU_RXD,Trigger_Rising); RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN,Trigger_Rising);
} }
extern uint32_t PowerIgnOffTimeLine; extern uint32_t PowerIgnOffTimeLine;
...@@ -91,7 +91,7 @@ static void Power_Wakeup_Init(void) ...@@ -91,7 +91,7 @@ static void Power_Wakeup_Init(void)
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_Init(); Telltales_Init();
RTE_DEEPSLEEP_GPIO_Interrupt_Enable(CAN_MCU_RXD,Trigger_Rising); RTE_DEEPSLEEP_GPIO_Interrupt_Enable(KL15_AD_IN,Trigger_Rising);
} }
static void Power_LVP_Init(void) static void Power_LVP_Init(void)
...@@ -165,7 +165,7 @@ static Power_Status_em Power_Stay_OFF(void) ...@@ -165,7 +165,7 @@ static Power_Status_em Power_Stay_OFF(void)
} }
else else
{ {
if ((Common_GetIgnOffTime() < 2500)) if ((Common_GetIgnOffTime() < 5000))
{ {
u8PowerSts = EM_IGN_OFF; u8PowerSts = EM_IGN_OFF;
} }
...@@ -199,6 +199,11 @@ static Power_Status_em Power_Stay_Protect(void) ...@@ -199,6 +199,11 @@ static Power_Status_em Power_Stay_Protect(void)
{ {
RTE_WDT_Clear(); RTE_WDT_Clear();
Gen_TimeDelay(2000u, 50u); Gen_TimeDelay(2000u, 50u);
BU98R10_Shutdown( );
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, 0);
TimerM_PWM_set_duty(TIMERM_COUNTER0, TIMERM_CHD, 1000);
RTE_GPIO_Set_Level(RTE_GPIO_PORT04_PIN01, RTE_GPIO_LEVEL_LOW); // OUT_EN_1
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Disable);
for(LED = 0u; LED < LampCh0_MAX; LED++) for(LED = 0u; LED < LampCh0_MAX; LED++)
{ {
LED_Driver_Channel_Set(0u, LED, 0u); LED_Driver_Channel_Set(0u, LED, 0u);
...@@ -236,12 +241,9 @@ static Power_Status_em Power_Stay_Protect(void) ...@@ -236,12 +241,9 @@ static Power_Status_em Power_Stay_Protect(void)
} }
BU98R10_Init( ); BU98R10_Init( );
CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable); CAN_TX_SetEnable(&CAN_CH0_CanMsgTxOp, CAN_N_TX_Enable);
Power_Stay_Flag = 1;
return u8PowerSts; return u8PowerSts;
} }
if ( SYS_OPR_STAT_IGN_OFF )
{
break;
}
} }
} }
...@@ -252,7 +254,7 @@ static Power_Status_em Power_Stay_Sleep(void) ...@@ -252,7 +254,7 @@ static Power_Status_em Power_Stay_Sleep(void)
while (1) while (1)
{ {
RTE_WDT_Clear(); RTE_WDT_Clear();
if (RTE_GPIO_Get_Level(CAN_MCU_RXD))/* KL15 */ if (RTE_GPIO_Get_Level(KL15_AD_IN))/* KL15 */
{ {
u8PowerSts = EM_IGN_Wakeup; u8PowerSts = EM_IGN_Wakeup;
break; break;
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#define u16ENTER_LOW_Y_RANGE 9000U #define u16ENTER_LOW_Y_RANGE 9000U
#define u16EXIT_LOW_Y_RANGE 10000U #define u16EXIT_LOW_Y_RANGE 10000U
#define u16EXIT_HIGH_Y_RANGE 16000U #define u16EXIT_HIGH_Y_RANGE 16500U
#define u16ENTER_HIGH_Y_RANGE 16500U #define u16ENTER_HIGH_Y_RANGE 17000U
#define u16EXIT_HIGH_N_RANGE 17500U #define u16EXIT_HIGH_N_RANGE 17500U
#define u16ENTER_HIGH_N_RANGE 18000U #define u16ENTER_HIGH_N_RANGE 18000U
#define u16Top_Vol 0xffffu #define u16Top_Vol 0xffffu
...@@ -105,7 +105,7 @@ monitorlib_uint8_t Sys_Read_KL15_Valid(void) ...@@ -105,7 +105,7 @@ monitorlib_uint8_t Sys_Read_KL15_Valid(void)
monitorlib_uint8_t System_LINE_KL15(void) monitorlib_uint8_t System_LINE_KL15(void)
{ {
static monitorlib_uint8_t u8KL15 = 0; static monitorlib_uint8_t u8KL15 = 0;
if (Get_CAN_CH0_ID_125_Sig_MMCU_PowerMode() != 0x0 ) if ((Get_CAN_Num_MMCU_PowerMode() != 0x0) || (System_Indicator_CANFlag == 1) )
{ {
u8KL15 = 1u; u8KL15 = 1u;
} }
......
...@@ -6,120 +6,115 @@ ...@@ -6,120 +6,115 @@
#include "Application.h" #include "Application.h"
#include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h" #include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h"
#include "Components.h" #include "Components.h"
#define openLED_flag ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Charge_OFF_Flag == 0)) #define openLED_flag ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Charge_OFF_Flag == 0) && (Get_CAN_Power_State() != POWER_CHECK_NULL))
static Tellib_uint16_t LED_EFI_failure_Judgement(void); static Tellib_uint16_t LED_EFI_failure_Judgement(void);
static void LED_EFI_failure_Execution(Tellib_uint16_t led_status); static void LED_EFI_failure_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Fuel_Alarm_Judgement(void); static Tellib_uint16_t LED_Fuel_Alarm_Judgement(void);
static void LED_Fuel_Alarm_Execution(Tellib_uint16_t led_status); static void LED_Fuel_Alarm_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Lead_Acid_Battery_Failure_Judgement(void); static Tellib_uint16_t LED_Lead_Acid_Battery_Failure_Judgement(void);
static void LED_Lead_Acid_Battery_Failure_Execution(Tellib_uint16_t led_status); static void LED_Lead_Acid_Battery_Failure_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Oil_Pressure_Judgement(void); static Tellib_uint16_t LED_Oil_Pressure_Judgement(void);
static void LED_Oil_Pressure_Execution(Tellib_uint16_t led_status); static void LED_Oil_Pressure_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Grass_Full_Judgement(void); static Tellib_uint16_t LED_Grass_Full_Judgement(void);
static void LED_Grass_Full_Execution(Tellib_uint16_t led_status); static void LED_Grass_Full_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_OVERLOAD_Judgement(void); static Tellib_uint16_t LED_OVERLOAD_Judgement(void);
static void LED_OVERLOAD_Execution(Tellib_uint16_t led_status); static void LED_OVERLOAD_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_READY_Judgement(void); static Tellib_uint16_t LED_READY_Judgement(void);
static void LED_READY_Execution(Tellib_uint16_t led_status); static void LED_READY_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Seat_Detection_Judgement(void); static Tellib_uint16_t LED_Seat_Detection_Judgement(void);
static void LED_Seat_Detection_Execution(Tellib_uint16_t led_status); static void LED_Seat_Detection_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Key_Access_Judgement(void); static Tellib_uint16_t LED_Key_Access_Judgement(void);
static void LED_Key_Access_Execution(Tellib_uint16_t led_status); static void LED_Key_Access_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Battery_Charging_Judgement(void); static Tellib_uint16_t LED_Battery_Charging_Judgement(void);
static void LED_Battery_Charging_Execution(Tellib_uint16_t led_status); static void LED_Battery_Charging_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Cutterhead_Switch_Judgement(void); static Tellib_uint16_t LED_Cutterhead_Switch_Judgement(void);
static void LED_Cutterhead_Switch_Execution(Tellib_uint16_t led_status); static void LED_Cutterhead_Switch_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_GEAR_Judgement(void); static Tellib_uint16_t LED_GEAR_Judgement(void);
static void LED_GEAR_Execution(Tellib_uint16_t led_status); static void LED_GEAR_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_External_Discharge_Judgement(void); static Tellib_uint16_t LED_External_Discharge_Judgement(void);
static void LED_External_Discharge_Execution(Tellib_uint16_t led_status); static void LED_External_Discharge_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Engine_Works_Judgement(void); static Tellib_uint16_t LED_Engine_Works_Judgement(void);
static void LED_Engine_Works_Execution(Tellib_uint16_t led_status); static void LED_Engine_Works_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Bluetooth_Connection_Judgement(void); static Tellib_uint16_t LED_Bluetooth_Connection_Judgement(void);
static void LED_Bluetooth_Connection_Execution(Tellib_uint16_t led_status); static void LED_Bluetooth_Connection_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_LED_Open_Judgement(void); static Tellib_uint16_t LED_LED_Open_Judgement(void);
static void LED_LED_Open_Execution(Tellib_uint16_t led_status); static void LED_LED_Open_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Cruise_Control_Judgement(void); static Tellib_uint16_t LED_Cruise_Control_Judgement(void);
static void LED_Cruise_Control_Execution(Tellib_uint16_t led_status); static void LED_Cruise_Control_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Tire_pressure_F_Judgement(void); static Tellib_uint16_t LED_Tire_pressure_F_Judgement(void);
static void LED_Tire_pressure_F_Execution(Tellib_uint16_t led_status); static void LED_Tire_pressure_F_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Tire_pressure_R_Judgement(void); static Tellib_uint16_t LED_Tire_pressure_R_Judgement(void);
static void LED_Tire_pressure_R_Execution(Tellib_uint16_t led_status); static void LED_Tire_pressure_R_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Gears_Judgement(void);
static void LED_Gears_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Cutterhead_Gear_Judgement(void); static Tellib_uint16_t LED_Cutterhead_Gear_Judgement(void);
static void LED_Cutterhead_Gear_Execution(Tellib_uint16_t led_status); static void LED_Cutterhead_Gear_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Working_Hours_One_Judgement(void); static Tellib_uint16_t LED_Working_Hours_One_Judgement(void);
static void LED_Working_Hours_One_Execution(Tellib_uint16_t led_status); static void LED_Working_Hours_One_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Fault_Codes_Judgement(void); static Tellib_uint16_t LED_Fault_Codes_Judgement(void);
static void LED_Fault_Codes_Execution(Tellib_uint16_t led_status); static void LED_Fault_Codes_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_SystIndicator_R_Judgement(void); static Tellib_uint16_t LED_SystIndicator_R_Judgement(void);
static void LED_SystIndicator_R_Execution(Tellib_uint16_t led_status); static void LED_SystIndicator_R_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_P_GEAR_G_Judgement(void); static Tellib_uint16_t LED_P_GEAR_G_Judgement(void);
static void LED_P_GEAR_G_Execution(Tellib_uint16_t led_status); static void LED_P_GEAR_G_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Fuel_Alarm_W_Judgement(void); static Tellib_uint16_t LED_Fuel_Alarm_W_Judgement(void);
static void LED_Fuel_Alarm_W_Execution(Tellib_uint16_t led_status); static void LED_Fuel_Alarm_W_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Charging_Connection_R_Judgement(void); static Tellib_uint16_t LED_Charging_Connection_R_Judgement(void);
static void LED_Charging_Connection_R_Execution(Tellib_uint16_t led_status); static void LED_Charging_Connection_R_Execution(Tellib_uint16_t led_status);
static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void); static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void);
static void LED_Power_Battery_Failure_R_Execution(Tellib_uint16_t led_status); static void LED_Power_Battery_Failure_R_Execution(Tellib_uint16_t led_status);
uint8_t u8CanId401Flag = 0; uint8_t u8CanId401Flag = 0;
const LED_Attribute_st LED_Attribute [ LED_Max ] = { const LED_Attribute_st LED_Attribute[LED_Max] = {
/* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */ /* 指示灯索引 是否自检 外部信号自检 工作电源状态 自检开始时间 自检持续时间 指示灯点亮条件 指示灯执行函数 */
{em_LED_EFI_failure_Y, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_EFI_failure_Judgement, LED_EFI_failure_Execution }, {em_LED_EFI_failure_Y, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_EFI_failure_Judgement, LED_EFI_failure_Execution},
{em_LED_Fuel_Alarm_Y, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Fuel_Alarm_Judgement, LED_Fuel_Alarm_Execution }, {em_LED_Fuel_Alarm_Y, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Fuel_Alarm_Judgement, LED_Fuel_Alarm_Execution},
{em_LED_Lead_Acid_Battery_Failure_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Lead_Acid_Battery_Failure_Judgement, LED_Lead_Acid_Battery_Failure_Execution }, {em_LED_Lead_Acid_Battery_Failure_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Lead_Acid_Battery_Failure_Judgement, LED_Lead_Acid_Battery_Failure_Execution},
{em_LED_Oil_Pressure_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Oil_Pressure_Judgement, LED_Oil_Pressure_Execution }, {em_LED_Oil_Pressure_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Oil_Pressure_Judgement, LED_Oil_Pressure_Execution},
{em_LED_Grass_Full_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Grass_Full_Judgement, LED_Grass_Full_Execution }, {em_LED_Grass_Full_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Grass_Full_Judgement, LED_Grass_Full_Execution},
{em_LED_OVERLOAD_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_OVERLOAD_Judgement, LED_OVERLOAD_Execution }, {em_LED_OVERLOAD_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_OVERLOAD_Judgement, LED_OVERLOAD_Execution},
{em_LED_READY_G, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_READY_Judgement, LED_READY_Execution }, {em_LED_READY_G, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_READY_Judgement, LED_READY_Execution},
{em_LED_Seat_Detection_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Seat_Detection_Judgement, LED_Seat_Detection_Execution }, {em_LED_Seat_Detection_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Seat_Detection_Judgement, LED_Seat_Detection_Execution},
{em_LED_Key_Access_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Key_Access_Judgement, LED_Key_Access_Execution }, {em_LED_Key_Access_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Key_Access_Judgement, LED_Key_Access_Execution},
{em_LED_Battery_Charging_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Battery_Charging_Judgement, LED_Battery_Charging_Execution }, {em_LED_Battery_Charging_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Battery_Charging_Judgement, LED_Battery_Charging_Execution},
{em_LED_Cutterhead_Switch_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Cutterhead_Switch_Judgement, LED_Cutterhead_Switch_Execution }, {em_LED_Cutterhead_Switch_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Cutterhead_Switch_Judgement, LED_Cutterhead_Switch_Execution},
{em_LED_GEAR_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_GEAR_Judgement, LED_GEAR_Execution }, {em_LED_GEAR_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_GEAR_Judgement, LED_GEAR_Execution},
{em_LED_External_Discharge_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_External_Discharge_Judgement, LED_External_Discharge_Execution }, {em_LED_External_Discharge_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_External_Discharge_Judgement, LED_External_Discharge_Execution},
{em_LED_Engine_Works_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Engine_Works_Judgement, LED_Engine_Works_Execution }, {em_LED_Engine_Works_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Engine_Works_Judgement, LED_Engine_Works_Execution},
{em_LED_Bluetooth_Connection_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Bluetooth_Connection_Judgement, LED_Bluetooth_Connection_Execution }, {em_LED_Bluetooth_Connection_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Bluetooth_Connection_Judgement, LED_Bluetooth_Connection_Execution},
{em_LED_LED_Open_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_LED_Open_Judgement, LED_LED_Open_Execution }, {em_LED_LED_Open_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_LED_Open_Judgement, LED_LED_Open_Execution},
{em_LED_Cruise_Control_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Cruise_Control_Judgement, LED_Cruise_Control_Execution }, {em_LED_Cruise_Control_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Cruise_Control_Judgement, LED_Cruise_Control_Execution},
{em_LED_Tire_pressure_F_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Tire_pressure_F_Judgement, LED_Tire_pressure_F_Execution }, {em_LED_Tire_pressure_F_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Tire_pressure_F_Judgement, LED_Tire_pressure_F_Execution},
{em_LED_Tire_pressure_R_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Tire_pressure_R_Judgement, LED_Tire_pressure_R_Execution }, {em_LED_Tire_pressure_R_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Tire_pressure_R_Judgement, LED_Tire_pressure_R_Execution},
{em_LED_Gears_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Gears_Judgement, LED_Gears_Execution }, {em_LED_Cutterhead_Gear_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Cutterhead_Gear_Judgement, LED_Cutterhead_Gear_Execution},
{em_LED_Cutterhead_Gear_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Cutterhead_Gear_Judgement, LED_Cutterhead_Gear_Execution }, {em_LED_Working_Hours_One_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Working_Hours_One_Judgement, LED_Working_Hours_One_Execution},
{em_LED_Working_Hours_One_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Working_Hours_One_Judgement, LED_Working_Hours_One_Execution }, {em_LED_Fault_Codes_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Fault_Codes_Judgement, LED_Fault_Codes_Execution},
{em_LED_Fault_Codes_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Fault_Codes_Judgement, LED_Fault_Codes_Execution }, {em_LED_System_Indicator_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_SystIndicator_R_Judgement, LED_SystIndicator_R_Execution},
{em_LED_System_Indicator_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_SystIndicator_R_Judgement, LED_SystIndicator_R_Execution }, {em_LED_P_GEAR_G, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_P_GEAR_G_Judgement, LED_P_GEAR_G_Execution},
{em_LED_P_GEAR_G, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_P_GEAR_G_Judgement, LED_P_GEAR_G_Execution }, {em_LED_Fuel_Alarm_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Fuel_Alarm_W_Judgement, LED_Fuel_Alarm_W_Execution},
{em_LED_Fuel_Alarm_W, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Fuel_Alarm_W_Judgement, LED_Fuel_Alarm_W_Execution }, {em_LED_Charging_Connection_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Charging_Connection_R_Judgement, LED_Charging_Connection_R_Execution},
{em_LED_Charging_Connection_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Charging_Connection_R_Judgement, LED_Charging_Connection_R_Execution }, {em_LED_Power_Battery_Failure_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Power_Battery_Failure_R_Judgement, LED_Power_Battery_Failure_R_Execution},
{em_LED_Power_Battery_Failure_R, NoSelfCheck, ExterNalCheck, LED_IGN_ON, 0u, 3000ul, LED_Power_Battery_Failure_R_Judgement, LED_Power_Battery_Failure_R_Execution },
}; };
Tellib_uint8_t Tel_Mem[Tel_MEM_Block_Size * LED_Max + Tel_MEM_Block_Addition];
Tellib_uint8_t Tel_Mem [ Tel_MEM_Block_Size * LED_Max + Tel_MEM_Block_Addition ];
uint8_t PowerSts_num; uint8_t PowerSts_num;
void Telltales_Init(void) void Telltales_Init(void)
{ {
TelExtPara m_ExtPara; TelExtPara m_ExtPara;
m_ExtPara.TotalLength = LED_Max; m_ExtPara.TotalLength = LED_Max;
m_ExtPara.LED_PowerOFF_TimerCbk = Common_GetIgnOffTime; m_ExtPara.LED_PowerOFF_TimerCbk = Common_GetIgnOffTime;
m_ExtPara.LED_PowerON_TimerCbk = Common_GetIgnOnTime; m_ExtPara.LED_PowerON_TimerCbk = Common_GetIgnOnTime;
m_ExtPara.LED_PowerCbk = Common_Get_IG_Sts; m_ExtPara.LED_PowerCbk = Common_Get_IG_Sts;
PowerSts_num = Common_Get_IG_Sts(); PowerSts_num = Common_Get_IG_Sts();
u8CanId401Flag = 0; u8CanId401Flag = 0;
Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara); Telltales_KL30_Wakeup_Init(Tel_Mem, LED_Attribute, &m_ExtPara);
} }
void Can_ID_401(uint8_t CopyData[])
void Can_ID_401(uint8_t CopyData [])
{ {
u8CanId401Flag = 1; u8CanId401Flag = 1;
} }
static Tellib_uint16_t LED_EFI_failure_Judgement(void) static Tellib_uint16_t LED_EFI_failure_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
// if (Line_In_Get_Status(LINE_IN_HighBeam)) // if (Line_In_Get_Status(LINE_IN_HighBeam))
// { // {
...@@ -130,20 +125,20 @@ void Can_ID_401(uint8_t CopyData []) ...@@ -130,20 +125,20 @@ void Can_ID_401(uint8_t CopyData [])
// LED_STATE = 0; // LED_STATE = 0;
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_EFI_failure_Execution(Tellib_uint16_t led_status) static void LED_EFI_failure_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
static Tellib_uint16_t LED_Fuel_Alarm_Judgement(void) static Tellib_uint16_t LED_Fuel_Alarm_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
...@@ -157,17 +152,17 @@ static Tellib_uint16_t LED_Fuel_Alarm_Judgement(void) ...@@ -157,17 +152,17 @@ static Tellib_uint16_t LED_Fuel_Alarm_Judgement(void)
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Fuel_Alarm_Execution(Tellib_uint16_t led_status) static void LED_Fuel_Alarm_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
static Tellib_uint16_t LED_Lead_Acid_Battery_Failure_Judgement(void) static Tellib_uint16_t LED_Lead_Acid_Battery_Failure_Judgement(void)
...@@ -183,17 +178,17 @@ static Tellib_uint16_t LED_Lead_Acid_Battery_Failure_Judgement(void) ...@@ -183,17 +178,17 @@ static Tellib_uint16_t LED_Lead_Acid_Battery_Failure_Judgement(void)
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Lead_Acid_Battery_Failure_Execution(Tellib_uint16_t led_status) static void LED_Lead_Acid_Battery_Failure_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
static Tellib_uint16_t LED_Oil_Pressure_Judgement(void) static Tellib_uint16_t LED_Oil_Pressure_Judgement(void)
...@@ -209,19 +204,19 @@ static Tellib_uint16_t LED_Oil_Pressure_Judgement(void) ...@@ -209,19 +204,19 @@ static Tellib_uint16_t LED_Oil_Pressure_Judgement(void)
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Oil_Pressure_Execution(Tellib_uint16_t led_status) static void LED_Oil_Pressure_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
static Tellib_uint16_t LED_Grass_Full_Judgement(void) static Tellib_uint16_t LED_Grass_Full_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
...@@ -235,18 +230,18 @@ static Tellib_uint16_t LED_Grass_Full_Judgement(void) ...@@ -235,18 +230,18 @@ static Tellib_uint16_t LED_Grass_Full_Judgement(void)
} }
return LED_STATE; return LED_STATE;
} }
static void LED_Grass_Full_Execution(Tellib_uint16_t led_status) static void LED_Grass_Full_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_00_Grass_Full_R, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_00_Grass_Full_R, LED_ON);
SEG_SET_LED_STS(SEG_LED_Chloramine,1); SEG_SET_LED_STS(SEG_LED_Chloramine, 1);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_00_Grass_Full_R, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_00_Grass_Full_R, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Chloramine,0); SEG_SET_LED_STS(SEG_LED_Chloramine, 0);
} }
} }
static Tellib_uint16_t LED_OVERLOAD_Judgement(void) static Tellib_uint16_t LED_OVERLOAD_Judgement(void)
...@@ -264,17 +259,17 @@ static Tellib_uint16_t LED_OVERLOAD_Judgement(void) ...@@ -264,17 +259,17 @@ static Tellib_uint16_t LED_OVERLOAD_Judgement(void)
} }
return LED_STATE; return LED_STATE;
} }
static void LED_OVERLOAD_Execution(Tellib_uint16_t led_status) static void LED_OVERLOAD_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_13_OVERLOAD_R, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_13_OVERLOAD_R, LED_ON);
SEG_SET_LED_STS(SEG_LED_Cutter_Overload,1); SEG_SET_LED_STS(SEG_LED_Cutter_Overload, 1);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_13_OVERLOAD_R, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_13_OVERLOAD_R, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Cutter_Overload,0); SEG_SET_LED_STS(SEG_LED_Cutter_Overload, 0);
} }
} }
static Tellib_uint16_t LED_READY_Judgement(void) static Tellib_uint16_t LED_READY_Judgement(void)
...@@ -291,17 +286,17 @@ static Tellib_uint16_t LED_READY_Judgement(void) ...@@ -291,17 +286,17 @@ static Tellib_uint16_t LED_READY_Judgement(void)
} }
return LED_STATE; return LED_STATE;
} }
static void LED_READY_Execution(Tellib_uint16_t led_status) static void LED_READY_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_10_READY_G, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_10_READY_G, LED_ON);
SEG_SET_LED_STS(SEG_LED_Ready,1); SEG_SET_LED_STS(SEG_LED_Ready, 1);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_10_READY_G, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_10_READY_G, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Ready,0); SEG_SET_LED_STS(SEG_LED_Ready, 0);
} }
} }
static Tellib_uint16_t LED_Seat_Detection_Judgement(void) static Tellib_uint16_t LED_Seat_Detection_Judgement(void)
...@@ -318,26 +313,26 @@ static Tellib_uint16_t LED_Seat_Detection_Judgement(void) ...@@ -318,26 +313,26 @@ static Tellib_uint16_t LED_Seat_Detection_Judgement(void)
} }
return LED_STATE; return LED_STATE;
} }
static void LED_Seat_Detection_Execution(Tellib_uint16_t led_status) static void LED_Seat_Detection_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_Seat_Detection_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_Seat_Detection_W, LED_ON);
SEG_SET_LED_STS(SEG_LED_Seat_Detection,1); SEG_SET_LED_STS(SEG_LED_Seat_Detection, 1);
} }
else else
{ {
if(FLASH_SYNC_1Hz && openLED_flag) if (FLASH_SYNC_1Hz && openLED_flag)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_Seat_Detection_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_Seat_Detection_W, LED_ON);
SEG_SET_LED_STS(SEG_LED_Seat_Detection,1); SEG_SET_LED_STS(SEG_LED_Seat_Detection, 1);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_Seat_Detection_W, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_12_Seat_Detection_W, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Seat_Detection,0); SEG_SET_LED_STS(SEG_LED_Seat_Detection, 0);
} }
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
static Tellib_uint16_t LED_Key_Access_Judgement(void) static Tellib_uint16_t LED_Key_Access_Judgement(void)
...@@ -354,17 +349,17 @@ static Tellib_uint16_t LED_Key_Access_Judgement(void) ...@@ -354,17 +349,17 @@ static Tellib_uint16_t LED_Key_Access_Judgement(void)
} }
return LED_STATE; return LED_STATE;
} }
static void LED_Key_Access_Execution(Tellib_uint16_t led_status) static void LED_Key_Access_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Key_Access_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Key_Access_W, LED_ON);
SEG_SET_LED_STS(SEG_LED_Key_Access,1); SEG_SET_LED_STS(SEG_LED_Key_Access, 1);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Key_Access_W, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_11_Key_Access_W, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Key_Access,0); SEG_SET_LED_STS(SEG_LED_Key_Access, 0);
} }
} }
static Tellib_uint16_t LED_Battery_Charging_Judgement(void) static Tellib_uint16_t LED_Battery_Charging_Judgement(void)
...@@ -373,15 +368,15 @@ static Tellib_uint16_t LED_Battery_Charging_Judgement(void) ...@@ -373,15 +368,15 @@ static Tellib_uint16_t LED_Battery_Charging_Judgement(void)
Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_TOTALSigAcc(); Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_TOTALSigAcc();
Tellib_uint8_t Signal2 = Get_CAN_Num_MBMS_TOTALSigCharge(); Tellib_uint8_t Signal2 = Get_CAN_Num_MBMS_TOTALSigCharge();
Tellib_uint8_t Signal3 = Get_CAN_Power_State(); Tellib_uint8_t Signal3 = Get_CAN_Power_State();
if((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF)) if ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != POWER_CHECK_NULL))
{ {
if (((Signal1 == 0x1) || (Signal1 == 0x0) ) && (Signal2 == 0X1)) if (((Signal1 == 0x1) || (Signal1 == 0x0)) && (Signal2 == 0X1))
{ {
if((Signal3 == CHRG_PLUGIN) || (Signal3 == CHRGEND)) if ((Signal3 == CHRG_PLUGIN) || (Signal3 == CHRGEND))
{ {
LED_STATE = 2; LED_STATE = 2;
} }
else if(Signal3 == CHRGING) else if (Signal3 == CHRGING)
{ {
LED_STATE = 1; LED_STATE = 1;
} }
...@@ -391,33 +386,33 @@ static Tellib_uint16_t LED_Battery_Charging_Judgement(void) ...@@ -391,33 +386,33 @@ static Tellib_uint16_t LED_Battery_Charging_Judgement(void)
LED_STATE = 0; LED_STATE = 0;
} }
} }
return LED_STATE; return LED_STATE;
} }
static void LED_Battery_Charging_Execution(Tellib_uint16_t led_status) static void LED_Battery_Charging_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_ON);
SEG_SET_LED_STS(SEG_LED_Recharge,1); SEG_SET_LED_STS(SEG_LED_Recharge, 1);
} }
else if(led_status == 2u) else if (led_status == 2u)
{ {
if(FLASH_SYNC_1Hz) if (FLASH_SYNC_1Hz)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_ON);
SEG_SET_LED_STS(SEG_LED_Recharge,1); SEG_SET_LED_STS(SEG_LED_Recharge, 1);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Recharge,0); SEG_SET_LED_STS(SEG_LED_Recharge, 0);
} }
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_08_Battery_Charging_W, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Recharge,0); SEG_SET_LED_STS(SEG_LED_Recharge, 0);
} }
} }
// static Tellib_uint16_t LED_Battery_Charging_POWEROFF_Judgement(void) // static Tellib_uint16_t LED_Battery_Charging_POWEROFF_Judgement(void)
...@@ -443,14 +438,14 @@ static void LED_Battery_Charging_Execution(Tellib_uint16_t led_status ...@@ -443,14 +438,14 @@ static void LED_Battery_Charging_Execution(Tellib_uint16_t led_status
// { // {
// LED_STATE = 0; // LED_STATE = 0;
// } // }
// } // }
// return LED_STATE; // return LED_STATE;
// } // }
static Tellib_uint16_t LED_Cutterhead_Switch_Judgement(void) static Tellib_uint16_t LED_Cutterhead_Switch_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_BMCU_PTOSwicthState(); Tellib_uint8_t Signal1 = Get_CAN_Num_BMCU_PTOSwicthState();
if ((Signal1 == 0x1) && openLED_flag && ((Get_CAN_Power_State() == READY))) if ((Signal1 == 0x1) && openLED_flag)
{ {
LED_STATE = 1; LED_STATE = 1;
} }
...@@ -459,57 +454,47 @@ static Tellib_uint16_t LED_Cutterhead_Switch_Judgement(void) ...@@ -459,57 +454,47 @@ static Tellib_uint16_t LED_Cutterhead_Switch_Judgement(void)
LED_STATE = 0; LED_STATE = 0;
} }
return LED_STATE; return LED_STATE;
} }
static void LED_Cutterhead_Switch_Execution(Tellib_uint16_t led_status) static void LED_Cutterhead_Switch_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_14_Cutterhead_Switch_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_14_Cutterhead_Switch_W, LED_ON);
SEG_SET_LED_STS(SEG_LED_Cutter_Head_switch,1); SEG_SET_LED_STS(SEG_LED_Cutter_Head_switch, 1);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_14_Cutterhead_Switch_W, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_14_Cutterhead_Switch_W, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Cutter_Head_switch,0); SEG_SET_LED_STS(SEG_LED_Cutter_Head_switch, 0);
} }
} }
static Tellib_uint16_t LED_GEAR_Judgement(void) static Tellib_uint16_t LED_GEAR_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_TravelSpeedGear(); if((Charge_OFF_Flag == 0) && (System_Indicator_CANFlag != 1))
Tellib_uint8_t Signal2 = Get_CAN_Num_MMCU_ParkingGearState();
if((Signal2 != 0x1) && (Charge_OFF_Flag == 0))
{ {
if ((Signal1 == 0x1) || (Signal1 == 0x2)) LED_STATE = 1;
{
LED_STATE = 1;
}
else
{
LED_STATE = 0;
}
} }
else if(Charge_OFF_Flag == 0) else
{ {
LED_STATE = 1; LED_STATE = 0;
} }
return LED_STATE;
} }
static void LED_GEAR_Execution(Tellib_uint16_t led_status) static void LED_GEAR_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_ON);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_04_GEAR_W, LED_OFF);
} }
} }
static Tellib_uint16_t LED_External_Discharge_Judgement(void) static Tellib_uint16_t LED_External_Discharge_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
// if (Line_In_Get_Status(LINE_IN_HighBeam)) // if (Line_In_Get_Status(LINE_IN_HighBeam))
// { // {
// LED_STATE = 1; // LED_STATE = 1;
...@@ -520,22 +505,22 @@ static Tellib_uint16_t LED_External_Discharge_Judgement(void) ...@@ -520,22 +505,22 @@ static Tellib_uint16_t LED_External_Discharge_Judgement(void)
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_External_Discharge_Execution(Tellib_uint16_t led_status) static void LED_External_Discharge_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
static Tellib_uint16_t LED_Engine_Works_Judgement(void) static Tellib_uint16_t LED_Engine_Works_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
// if (Line_In_Get_Status(LINE_IN_HighBeam)) // if (Line_In_Get_Status(LINE_IN_HighBeam))
// { // {
// LED_STATE = 1; // LED_STATE = 1;
...@@ -546,19 +531,19 @@ static Tellib_uint16_t LED_Engine_Works_Judgement(void) ...@@ -546,19 +531,19 @@ static Tellib_uint16_t LED_Engine_Works_Judgement(void)
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Engine_Works_Execution(Tellib_uint16_t led_status) static void LED_Engine_Works_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
static Tellib_uint16_t LED_Bluetooth_Connection_Judgement(void) static Tellib_uint16_t LED_Bluetooth_Connection_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
...@@ -573,23 +558,23 @@ static Tellib_uint16_t LED_Bluetooth_Connection_Judgement(void) ...@@ -573,23 +558,23 @@ static Tellib_uint16_t LED_Bluetooth_Connection_Judgement(void)
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Bluetooth_Connection_Execution(Tellib_uint16_t led_status) static void LED_Bluetooth_Connection_Execution(Tellib_uint16_t led_status)
{ {
// if ( led_status == 1u ) // if ( led_status == 1u )
// { // {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_22_Bluetooth_Connection_W, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_22_Bluetooth_Connection_W, LED_ON);
// SEG_SET_LED_STS(SEG_LED_bluetooth,1); // SEG_SET_LED_STS(SEG_LED_bluetooth,1);
// } // }
// else // else
// { // {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_22_Bluetooth_Connection_W, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_22_Bluetooth_Connection_W, LED_OFF);
// SEG_SET_LED_STS(SEG_LED_bluetooth,0); // SEG_SET_LED_STS(SEG_LED_bluetooth,0);
// } // }
} }
static Tellib_uint16_t LED_LED_Open_Judgement(void) static Tellib_uint16_t LED_LED_Open_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
if (Line_In_Get_Status(LINE_IN_BigLED) && openLED_flag) if (Line_In_Get_Status(LINE_IN_BigLED) && openLED_flag)
{ {
LED_STATE = 1; LED_STATE = 1;
} }
...@@ -599,22 +584,22 @@ static Tellib_uint16_t LED_LED_Open_Judgement(void) ...@@ -599,22 +584,22 @@ static Tellib_uint16_t LED_LED_Open_Judgement(void)
} }
return LED_STATE; return LED_STATE;
} }
static void LED_LED_Open_Execution(Tellib_uint16_t led_status) static void LED_LED_Open_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_21_LED_Open_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_21_LED_Open_W, LED_ON);
SEG_SET_LED_STS(SEG_LED_Distance_Light,1); SEG_SET_LED_STS(SEG_LED_Distance_Light, 1);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_21_LED_Open_W, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_21_LED_Open_W, LED_OFF);
SEG_SET_LED_STS(SEG_LED_Distance_Light,0); SEG_SET_LED_STS(SEG_LED_Distance_Light, 0);
} }
} }
static Tellib_uint16_t LED_Cruise_Control_Judgement(void) static Tellib_uint16_t LED_Cruise_Control_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
// if (Line_In_Get_Status(LINE_IN_HighBeam)) // if (Line_In_Get_Status(LINE_IN_HighBeam))
// { // {
// LED_STATE = 1; // LED_STATE = 1;
...@@ -625,22 +610,22 @@ static Tellib_uint16_t LED_Cruise_Control_Judgement(void) ...@@ -625,22 +610,22 @@ static Tellib_uint16_t LED_Cruise_Control_Judgement(void)
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Cruise_Control_Execution(Tellib_uint16_t led_status) static void LED_Cruise_Control_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
static Tellib_uint16_t LED_Tire_pressure_F_Judgement(void) static Tellib_uint16_t LED_Tire_pressure_F_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
// if (Line_In_Get_Status(LINE_IN_HighBeam)) // if (Line_In_Get_Status(LINE_IN_HighBeam))
// { // {
// LED_STATE = 1; // LED_STATE = 1;
...@@ -651,22 +636,22 @@ static Tellib_uint16_t LED_Tire_pressure_F_Judgement(void) ...@@ -651,22 +636,22 @@ static Tellib_uint16_t LED_Tire_pressure_F_Judgement(void)
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Tire_pressure_F_Execution(Tellib_uint16_t led_status) static void LED_Tire_pressure_F_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
static Tellib_uint16_t LED_Tire_pressure_R_Judgement(void) static Tellib_uint16_t LED_Tire_pressure_R_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
// if (Line_In_Get_Status(LINE_IN_HighBeam)) // if (Line_In_Get_Status(LINE_IN_HighBeam))
// { // {
// LED_STATE = 1; // LED_STATE = 1;
...@@ -676,108 +661,64 @@ static Tellib_uint16_t LED_Tire_pressure_R_Judgement(void) ...@@ -676,108 +661,64 @@ static Tellib_uint16_t LED_Tire_pressure_R_Judgement(void)
// LED_STATE = 0; // LED_STATE = 0;
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Tire_pressure_R_Execution(Tellib_uint16_t led_status) static void LED_Tire_pressure_R_Execution(Tellib_uint16_t led_status)
{
if ( led_status == 1u )
{
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1);
}
else
{
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0);
}
}
static Tellib_uint16_t LED_Gears_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; if (led_status == 1u)
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_TravelSpeedGear();
Tellib_uint8_t Signal2 = Get_CAN_Num_MMCU_ParkingGearState();
if((Signal2 != 0x1 ) && openLED_flag)
{ {
if ((Signal1 == 0x1) || (Signal1 == 0x2)) // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
{ // SEG_SET_LED_STS(1,1);
LED_STATE = 1;
}
else
{
LED_STATE = 0;
}
} }
else else
{ {
LED_STATE = 0; // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0);
} }
return LED_STATE; }
}
static void LED_Gears_Execution(Tellib_uint16_t led_status)
{
if ( led_status == 1u )
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Gears_W, LED_ON);
// SEG_SET_LED_STS(1,1);
}
else
{
LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Gears_W, LED_OFF);
// SEG_SET_LED_STS(1,0);
}
}
static Tellib_uint16_t LED_Cutterhead_Gear_Judgement(void) static Tellib_uint16_t LED_Cutterhead_Gear_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_BMCU_BladeSpeedGear(); Tellib_uint8_t Signal1 = Get_CAN_Num_BMCU_BladeSpeedGear();
Tellib_uint8_t Signal2 = Get_CAN_Num_BMCU_ErrorGrage(); Tellib_uint8_t Signal2 = Get_CAN_Num_BMCU_ErrorGrage();
if(((Signal2 == 0x1) || (Signal2 == 0x2 )|| (Signal2 == 0x3) || (Signal2 == 0x4)) && openLED_flag && (Get_CAN_Power_State() == READY)) if (((Signal2 == 0x1) || (Signal2 == 0x2) || (Signal2 == 0x3) || (Signal2 == 0x4)) && openLED_flag)
{ {
if((Signal1 == 0x1) || (Signal1 == 0x2) || (Signal1 == 0x3)) LED_STATE = 2;
{
LED_STATE = 2;
}
else
{
LED_STATE = 0;
}
} }
else if ((Signal2 == 0x0) && openLED_flag && (Get_CAN_Power_State() == READY)) else if ((Signal2 == 0x0) && openLED_flag)
{ {
if((Signal1 == 0x1) || (Signal1 == 0x2) || (Signal1 == 0x3)) LED_STATE = 1;
{ }
LED_STATE = 1; else
} {
else LED_STATE = 0;
{
LED_STATE = 0;
}
} }
return LED_STATE; return LED_STATE;
} }
static void LED_Cutterhead_Gear_Execution(Tellib_uint16_t led_status) static void LED_Cutterhead_Gear_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_Cutterhead_Gear_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_Cutterhead_Gear_W, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else if(led_status == 2u) else if (led_status == 2u)
{ {
if(FLASH_SYNC_1Hz) if (FLASH_SYNC_1Hz)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_Cutterhead_Gear_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_Cutterhead_Gear_W, LED_ON);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_Cutterhead_Gear_W, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_Cutterhead_Gear_W, LED_OFF);
} }
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_Cutterhead_Gear_W, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_15_Cutterhead_Gear_W, LED_OFF);
} }
} }
static Tellib_uint16_t LED_Working_Hours_One_Judgement(void) static Tellib_uint16_t LED_Working_Hours_One_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
...@@ -791,19 +732,19 @@ static Tellib_uint16_t LED_Working_Hours_One_Judgement(void) ...@@ -791,19 +732,19 @@ static Tellib_uint16_t LED_Working_Hours_One_Judgement(void)
} }
return LED_STATE; return LED_STATE;
} }
static void LED_Working_Hours_One_Execution(Tellib_uint16_t led_status) static void LED_Working_Hours_One_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Working_Hours_One_W, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Working_Hours_One_W, LED_ON);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Working_Hours_One_W, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_31_Working_Hours_One_W, LED_OFF);
} }
} }
static Tellib_uint16_t LED_Fault_Codes_Judgement(void) static Tellib_uint16_t LED_Fault_Codes_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
// if (Line_In_Get_Status(LINE_IN_HighBeam)) // if (Line_In_Get_Status(LINE_IN_HighBeam))
// { // {
...@@ -815,17 +756,17 @@ static Tellib_uint16_t LED_Fault_Codes_Judgement(void) ...@@ -815,17 +756,17 @@ static Tellib_uint16_t LED_Fault_Codes_Judgement(void)
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Fault_Codes_Execution(Tellib_uint16_t led_status) static void LED_Fault_Codes_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
...@@ -835,7 +776,7 @@ static Tellib_uint16_t LED_SystIndicator_R_Judgement(void) ...@@ -835,7 +776,7 @@ static Tellib_uint16_t LED_SystIndicator_R_Judgement(void)
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_ErrorGrage(); Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_ErrorGrage();
Tellib_uint8_t Signal2 = Get_CAN_Num_SMCU_ErrorGrage(); Tellib_uint8_t Signal2 = Get_CAN_Num_SMCU_ErrorGrage();
Tellib_uint8_t Signal3 = System_Indicator_CANFlag; Tellib_uint8_t Signal3 = System_Indicator_CANFlag;
if (((Signal1 == 0x4) || (Signal1 == 0x5) ||(Signal2 == 0x4) || (Signal2 == 0x5) || (Signal3 == 1)) && openLED_flag) if (((Signal1 == 0x4) || (Signal1 == 0x5) || (Signal2 == 0x4) || (Signal2 == 0x5) || (Signal3 == 1)))
{ {
LED_STATE = 1; LED_STATE = 1;
...@@ -845,63 +786,65 @@ static Tellib_uint16_t LED_SystIndicator_R_Judgement(void) ...@@ -845,63 +786,65 @@ static Tellib_uint16_t LED_SystIndicator_R_Judgement(void)
LED_STATE = 0; LED_STATE = 0;
} }
return LED_STATE; return LED_STATE;
} }
static void LED_SystIndicator_R_Execution(Tellib_uint16_t led_status) static void LED_SystIndicator_R_Execution(Tellib_uint16_t led_status)
{ {
// if ( led_status == 1u ) if (led_status == 1u)
// { {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_ON);
// SEG_SET_LED_STS(SEG_LED_System_Light,1); SEG_SET_LED_STS(SEG_LED_System_Light, 1);
// } }
// else else
// { {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_System_Indicator_R, LED_OFF);
// SEG_SET_LED_STS(SEG_LED_System_Light,0); SEG_SET_LED_STS(SEG_LED_System_Light, 0);
// } }
} }
static Tellib_uint16_t LED_P_GEAR_G_Judgement(void) static Tellib_uint16_t LED_P_GEAR_G_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MMCU_ParkingGearState();
Tellib_uint8_t Signal2 = Get_CAN_Power_State(); Tellib_uint8_t Signal2 = Get_CAN_Power_State();
if ( (Signal1 == 0x1) && openLED_flag && (checkself_seg_Flag == 0)) if (checkself_seg_Flag == 0)
{ {
LED_STATE = 1; if ((Signal2 == PKEY_ON))
} {
else if((Signal2 == PKEY_ON )&& (checkself_seg_Flag == 0)) LED_STATE = 2;
{ }
LED_STATE = 2; else if (openLED_flag)
{
LED_STATE = 1;
}
} }
else else
{ {
LED_STATE = 0; LED_STATE = 0;
} }
return LED_STATE; return LED_STATE;
} }
static void LED_P_GEAR_G_Execution(Tellib_uint16_t led_status) static void LED_P_GEAR_G_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Gears_W, LED_ON);
SEG_SET_GEAR(1, Gear_P, 0);
} }
else if(led_status == 2u) else if (led_status == 2u)
{ {
if(FLASH_SYNC_05Hz) if (FLASH_SYNC_1Hz)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Gears_W, LED_ON);
SEG_SET_GEAR(1, Gear_P, 0);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Gears_W, LED_OFF);
} SEG_SET_GEAR(1, Gear_OFF, 0);
}
} }
else if(checkself_seg_Flag == 0) else if (checkself_seg_Flag == 0)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_P_GEAR_G, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_05_Gears_W, LED_OFF);
SEG_SET_GEAR(0, Gear_P, 0);
} }
} }
static Tellib_uint16_t LED_Fuel_Alarm_W_Judgement(void) static Tellib_uint16_t LED_Fuel_Alarm_W_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
...@@ -915,24 +858,24 @@ static Tellib_uint16_t LED_Fuel_Alarm_W_Judgement(void) ...@@ -915,24 +858,24 @@ static Tellib_uint16_t LED_Fuel_Alarm_W_Judgement(void)
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Fuel_Alarm_W_Execution(Tellib_uint16_t led_status) static void LED_Fuel_Alarm_W_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_ON);
// SEG_SET_LED_STS(1,1); // SEG_SET_LED_STS(1,1);
} }
else else
{ {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, LED_OFF);
// SEG_SET_LED_STS(1,0); // SEG_SET_LED_STS(1,0);
} }
} }
static Tellib_uint16_t LED_Charging_Connection_R_Judgement(void) static Tellib_uint16_t LED_Charging_Connection_R_Judgement(void)
{ {
Tellib_uint16_t LED_STATE = 0u; Tellib_uint16_t LED_STATE = 0u;
Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_StatBattChargeState(); Tellib_uint8_t Signal1 = Get_CAN_Num_MBMS_StatBattChargeState();
if (((Signal1 == 0x1) || (Signal1 == 0x2) ||(Signal1 == 0x3)) && ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF))) if (((Signal1 == 0x1) || (Signal1 == 0x2) || (Signal1 == 0x3)) && ((Get_CAN_Power_State() != PKEY_ON) && (Get_CAN_Power_State() != KEY_OFF) && (Get_CAN_Power_State() != POWER_CHECK_NULL)))
{ {
LED_STATE = 1; LED_STATE = 1;
} }
...@@ -941,20 +884,20 @@ static Tellib_uint16_t LED_Charging_Connection_R_Judgement(void) ...@@ -941,20 +884,20 @@ static Tellib_uint16_t LED_Charging_Connection_R_Judgement(void)
LED_STATE = 0; LED_STATE = 0;
} }
return LED_STATE; return LED_STATE;
} }
static void LED_Charging_Connection_R_Execution(Tellib_uint16_t led_status) static void LED_Charging_Connection_R_Execution(Tellib_uint16_t led_status)
{ {
if ( led_status == 1u ) if (led_status == 1u)
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_32_Charging_Connection_R, LED_ON); LED_Driver_Channel_Set(LampChannel_0, LampCh0_32_Charging_Connection_R, LED_ON);
SEG_SET_LED_STS(SEG_LED_HHT_Charger,1); SEG_SET_LED_STS(SEG_LED_HHT_Charger, 1);
} }
else else
{ {
LED_Driver_Channel_Set(LampChannel_0, LampCh0_32_Charging_Connection_R, LED_OFF); LED_Driver_Channel_Set(LampChannel_0, LampCh0_32_Charging_Connection_R, LED_OFF);
SEG_SET_LED_STS(SEG_LED_HHT_Charger,0); SEG_SET_LED_STS(SEG_LED_HHT_Charger, 0);
} }
} }
static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void) static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void)
{ {
...@@ -969,17 +912,17 @@ static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void) ...@@ -969,17 +912,17 @@ static Tellib_uint16_t LED_Power_Battery_Failure_R_Judgement(void)
// LED_STATE = 0; // LED_STATE = 0;
// } // }
return LED_STATE; return LED_STATE;
} }
static void LED_Power_Battery_Failure_R_Execution(Tellib_uint16_t led_status) static void LED_Power_Battery_Failure_R_Execution(Tellib_uint16_t led_status)
{ {
// if ( (led_status == 1u ) && openLED_flag) // if ( (led_status == 1u ) && openLED_flag)
// { // {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_ON); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_ON);
// SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,1); // SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,1);
// } // }
// else // else
// { // {
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_OFF); // LED_Driver_Channel_Set(LampChannel_0, LampCh0_01_Power_Battery_Failure_R, LED_OFF);
// SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,0); // SEG_SET_LED_STS(SEG_LED_Power_Battery_Failure,0);
// } // }
} }
...@@ -26,7 +26,6 @@ typedef enum ...@@ -26,7 +26,6 @@ typedef enum
em_LED_Cruise_Control_W, em_LED_Cruise_Control_W,
em_LED_Tire_pressure_F_W, em_LED_Tire_pressure_F_W,
em_LED_Tire_pressure_R_W, em_LED_Tire_pressure_R_W,
em_LED_Gears_W,
em_LED_Cutterhead_Gear_W, em_LED_Cutterhead_Gear_W,
em_LED_Working_Hours_One_W, em_LED_Working_Hours_One_W,
......
...@@ -9,7 +9,7 @@ typedef struct ...@@ -9,7 +9,7 @@ typedef struct
uint32_t u32Task10msCnt; uint32_t u32Task10msCnt;
uint32_t u32Task20msCnt; uint32_t u32Task20msCnt;
uint32_t u32Task50msCnt; uint32_t u32Task50msCnt;
uint32_t u32Task75msCnt; uint32_t u32Task15msCnt;
uint32_t u32Task100msCnt; uint32_t u32Task100msCnt;
} Sys_Scheduler_st_t; } Sys_Scheduler_st_t;
...@@ -246,7 +246,7 @@ void Sys_Scheduler_Start(uint32_t u32SchCycle) ...@@ -246,7 +246,7 @@ void Sys_Scheduler_Start(uint32_t u32SchCycle)
g_stSysScheduler.u32Task10msCnt = 1UL; g_stSysScheduler.u32Task10msCnt = 1UL;
g_stSysScheduler.u32Task20msCnt = 3UL; g_stSysScheduler.u32Task20msCnt = 3UL;
g_stSysScheduler.u32Task50msCnt = 5UL; g_stSysScheduler.u32Task50msCnt = 5UL;
g_stSysScheduler.u32Task75msCnt = 6UL; g_stSysScheduler.u32Task15msCnt = 2UL;
g_stSysScheduler.u32Task100msCnt = 7UL; g_stSysScheduler.u32Task100msCnt = 7UL;
} }
...@@ -303,11 +303,11 @@ void Sys_Scheduling_Service(void) ...@@ -303,11 +303,11 @@ void Sys_Scheduling_Service(void)
Sys_50ms_Tasks(); Sys_50ms_Tasks();
} }
g_stSysScheduler.u32Task75msCnt += u32msDelta; g_stSysScheduler.u32Task15msCnt += u32msDelta;
if (g_stSysScheduler.u32Task75msCnt >= 75UL) if (g_stSysScheduler.u32Task15msCnt >= 15UL)
{ {
g_stSysScheduler.u32Task75msCnt %= 75UL; g_stSysScheduler.u32Task15msCnt %= 15UL;
Sys_75ms_Tasks(); Sys_15ms_Tasks();
} }
g_stSysScheduler.u32Task100msCnt += u32msDelta; g_stSysScheduler.u32Task100msCnt += u32msDelta;
......
...@@ -41,5 +41,5 @@ extern void Sys_5ms_Tasks(void); ...@@ -41,5 +41,5 @@ extern void Sys_5ms_Tasks(void);
extern void Sys_10ms_Tasks(void); extern void Sys_10ms_Tasks(void);
extern void Sys_20ms_Tasks(void); extern void Sys_20ms_Tasks(void);
extern void Sys_50ms_Tasks(void); extern void Sys_50ms_Tasks(void);
extern void Sys_75ms_Tasks(void); extern void Sys_15ms_Tasks(void);
extern void Sys_100ms_Tasks(void); extern void Sys_100ms_Tasks(void);
...@@ -48,37 +48,11 @@ void Sys_50ms_Tasks(void) ...@@ -48,37 +48,11 @@ void Sys_50ms_Tasks(void)
Gauge_Service(); Gauge_Service();
} }
void Sys_75ms_Tasks(void) void Sys_15ms_Tasks(void)
{ {
if (checkself_seg_Flag == 1) if ((Common_GetIgnOnTime() <= 1500) && (Common_GetIgnOnTime() > 0) && (checkself_seg_Flag == 1))
{ {
Checkself_SEG_Display(); Checkself_SEG_Display();
// if (Checkself_SEG_step_count < 20)
// {
// Checkself_SEG_step_count++;
// }
// else
// {
// Checkself_SEG_step_count = 20;
// }
// if (Checkself_SEG_step_count < 10)
// {
// Checkself_SEG_step++;
// }
// else
// {
// if (Checkself_SEG_step == 0)
// {
// Checkself_SEG_step = 0;
// SEG_SET_EleDial_2SOC(1, 0);
// SEG_SET_EleDial_1SOC(1, 0);
// }
// else
// {
// Checkself_SEG_step--;
// }
// }
} }
} }
......
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