Commit 8887ee3a authored by 李俭双's avatar 李俭双

feat:增加电压数据处理

parent be2b5525
SET PATH=C:\Keil_v5\ARM\ARMCC\Bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\tyw05\AppData\Local\Microsoft\WindowsApps;
SET ARMCC5_ASMOPT=--diag_suppress=9931
SET ARMCC5_CCOPT=--diag_suppress=9931
SET ARMCC5_LINKOPT=--diag_suppress=9931
SET CPU_TYPE=BAT32G139GK64FB
SET CPU_VENDOR=Cmsemicon
SET UV2_TARGET=TianYing200
......
#include "Application.h"
#include "Data_Voltage\Data_Voltage.h"
uint8_t voltage_value = 0;
void Data_Voltage_Init ( void )
{
voltage_value = 0;
}
void Data_Voltage_Processing_Service ( void )
{
if ( Common_Get_IG_Sts() == COMMON_POWER_ON )
{
if(CAN_MSG_Status(&CAN_CH0_CanMsgOp, CAN_CH0_ID_CAN_0x401_Msg_Count) == CAN_SIG_LOST)
{
voltage_value = 0;
}
else
{
voltage_value = Get_CAN_CH0_ID_401_Sig_ECU_Battery_Voltage();
}
}
else
{
voltage_value = 0;
}
}
//10倍
uint8_t Get_Battery_Voltage(void)
{
return voltage_value;
}
\ No newline at end of file
......@@ -2,4 +2,8 @@
#define _DATA_VOLTAGE_H_
#include "common.h"
void Data_Voltage_Init ( void );
void Data_Voltage_Processing_Service ( void );
uint8_t Get_Battery_Voltage(void);
#endif
......@@ -62,6 +62,7 @@ static void Power_KL30_Init(void)
LED_Driver_Init_Example();//注意顺序2
Data_User_Mileage_KL30Init();
Fuel_KL30_Init();
Data_Voltage_Init();
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400);
......@@ -105,6 +106,7 @@ static void Power_Wakeup_Init(void)
//Light_Sensor_Init_Example();//注意顺序1
LED_Driver_Init_Example();//注意顺序2
Fuel_KL30_Init();
Data_Voltage_Init();
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400, 64000000);
TimerM_PWM_counter_Output_Init(TIMERM_COUNTER1, 400, 64000000);
// TimerM_PWM_counter_Output_Init(TIMERM_COUNTER0, 400);
......@@ -141,6 +143,7 @@ static void Power_IG_ON_Init(void)
Telltales_KL15_Init();
Telltales_UserInit();
Fuel_KL15_Init();
Data_Voltage_Init();
Data_Coolant_Temp_KL15_Init();
}
......
......@@ -79,6 +79,7 @@ void Sys_100ms_Tasks(void)
Fuel_Cal_Sevice(100u);
BackLight_Process();
Services_Mileage_Callback();
Data_Voltage_Processing_Service();
S3_ServerCNTT();
if (u8LEDDriverCheckCount >= 10U)
......
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