Commit 64956c03 authored by 李俭双's avatar 李俭双

Merge branch 'lijianshuang' into 'master'

Lijianshuang

See merge request !22
parents cba3bc64 9db46191
......@@ -8,5 +8,5 @@
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/*.tyw05
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/*.tyw05
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/*.tyw05
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/HaoJin.uvoptx
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/TianYing.uvoptx
/Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/*.uvoptx
;/**************************************************************************//**
; * @file startup_BAT32A239.s
; * @file startup_BAT32G139.s
; * @brief CMSIS Cortex-M ARMv6-M based Core Device Startup File for
; * Device BAT32A239
; * Device BAT32G139
; * @version V1.00
; * @date 2019/04/24
; ******************************************************************************/
......@@ -32,7 +32,7 @@
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Stack_Size EQU 0x00000600
Stack_Size EQU 0x00000400
AREA STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem SPACE Stack_Size
......
/**************************************************************************//**
* @file system_BAT32A239.c
* @file system_BAT32G139.c
* @brief CMSIS Cortex-M0+ Device Peripheral Access Layer Source File for
* Device BAT32A239
* Device BAT32G139
* @version V1.00
* @date 2019/04/24
******************************************************************************/
......@@ -24,19 +24,20 @@
*/
#include <stdint.h>
#include "BAT32A239.h"
#include "BAT32G139.h"
#include "userdefine.h"
/*----------------------------------------------------------------------------
Define clocks
*----------------------------------------------------------------------------*/
/* ToDo: add here your necessary defines for device initialization
following is an example for different system frequencies */
#define __HSI (64000000UL)
#define __HSI (32000000UL)
#define __XTAL (8000000UL) /* Oscillator frequency */
#define __SYS_OSC_CLK (___HSI) /* Main oscillator frequency */
#define __SYS_OSC_CLK ( ___HSI) /* Main oscillator frequency */
#define __SYSTEM_CLOCK (64000000UL)
#define __SYSTEM_CLOCK (32000000UL)
/** @addtogroup Configuration_of_User_Option_Byte
* @{
......@@ -94,7 +95,7 @@ const uint8_t user_opt_data[4] __attribute__((used)) __attribute__((section(".AR
// </e>
// </e>
// </h>
0x7C, //0xEF WDT-OFF 0x7F WDT-ON
0xEF,
/**
* @brief LVD Control BYTE (C1H)
......@@ -106,6 +107,7 @@ const uint8_t user_opt_data[4] __attribute__((used)) __attribute__((section(".AR
*/
// <h> LVD Control Option Byte (C1H)
// <o.0..7> Voltage detection setting (VLVD) <0xFF=> ( LVD OFF )
// <0x3D=> VLVD = 1.88V/1.84V ( interrupt mode )
// <0x39=> VLVD = 1.98V/1.94V ( interrupt mode )
// <0x35=> VLVD = 2.09V/2.04V ( interrupt mode )
// <0x5D=> VLVD = 2.50V/2.45V ( interrupt mode )
......@@ -114,6 +116,7 @@ const uint8_t user_opt_data[4] __attribute__((used)) __attribute__((section(".AR
// <0x7D=> VLVD = 2.81V/2.75V ( interrupt mode )
// <0x79=> VLVD = 2.92V/2.86V ( interrupt mode )
// <0x75=> VLVD = 3.02V/2.96V ( interrupt mode )
// <0x3F=> VLVD = 1.88V/1.84V ( reset mode )
// <0x3B=> VLVD = 1.98V/1.94V ( reset mode )
// <0x37=> VLVD = 2.09V/2.04V ( reset mode )
// <0x5F=> VLVD = 2.50V/2.45V ( reset mode )
......@@ -122,6 +125,7 @@ const uint8_t user_opt_data[4] __attribute__((used)) __attribute__((section(".AR
// <0x7F=> VLVD = 2.81V/2.75V ( reset mode )
// <0x7B=> VLVD = 2.92V/2.86V ( reset mode )
// <0x77=> VLVD = 3.02V/2.96V ( reset mode )
// <0x3A=> VLVDH = 1.98V/1.94V, VLVDL = 1.84V ( interrupt & reset mode )
// <0x36=> VLVDH = 2.09V/2.04V, VLVDL = 1.84V ( interrupt & reset mode )
// <0x32=> VLVDH = 3.13V/3.06V, VLVDL = 1.84V ( interrupt & reset mode )
// <0x5A=> VLVDH = 2.61V/2.55V, VLVDL = 2.45V ( interrupt & reset mode )
......@@ -132,7 +136,7 @@ const uint8_t user_opt_data[4] __attribute__((used)) __attribute__((section(".AR
// <0x72=> VLVDH = 4.06V/3.98V, VLVDL = 2.75V ( interrupt & reset mode )
// <i> Please setting the item for interrupt & reset mode
// </h>
0x3B,
0x3F,
/**
* @brief HOCO Control BYTE (FRQSEL)
......@@ -156,7 +160,7 @@ const uint8_t user_opt_data[4] __attribute__((used)) __attribute__((section(".AR
// <0xEC=> fHOCO = 32MHz, fIH = 2MHz
// <0xED=> fHOCO = 32MHz, fIH = 1MHz
// </h>
0xF8,
0xE8,
/**
* @brief Flash Protect Control BYTE
......@@ -187,6 +191,34 @@ uint32_t SystemCoreClock; /* System Clock Frequency (Core Clock)*/
/*----------------------------------------------------------------------------
Clock functions
*----------------------------------------------------------------------------*/
__WEAK uint32_t CLK_GetHocoFreq(void)
{
uint32_t freq;
uint8_t frqsel = (*(uint8_t *)0x000000C2U);
frqsel &= 0x18; /* Mask the higher and lower 3 bits */
frqsel >>= 3; /* right shift 3 bit */
switch(frqsel)
{
case 0x03:
freq = 64000000U; /* fHOCO = 64MHz */
break;
case 0x02:
freq = 48000000U; /* fHOCO = 48MHz */
break;
case 0x01:
freq = 32000000U; /* fHOCO = 32MHz */
break;
case 0x00:
freq = 24000000U; /* fHOCO = 24MHz */
break;
}
return(freq);
}
__WEAK uint32_t CLK_GetfIHFreq(void)
{
uint32_t freq;
......
......@@ -97,14 +97,14 @@ Each channel of SCI has three functions: UART, SPI, and IIC. You can only choose
#define USE_SCI_IIC21 /*! Using CH1 of SCI1 as IIC Transmitter or Receiver */
/* ToDo: You can only define ONE of the following THREE MACROs according to your application */
#define USE_SCI_UART3_TX /*! Using CH0 of SCI2 as UART Transmitter */
//#define USE_SCI_SPI30 /*! Using CH0 of SCI2 as SPI Transmitter or Receiver */
//#define USE_SCI_IIC30 /*! Using CH0 of SCI2 as IIC Transmitter or Receiver */
#define USE_SCI_UART3_TX /*! Using CH0 of SCI3 as UART Transmitter */
//#define USE_SCI_SPI30 /*! Using CH0 of SCI3 as SPI Transmitter or Receiver */
//#define USE_SCI_IIC30 /*! Using CH0 of SCI3 as IIC Transmitter or Receiver */
/* ToDo: You can only define ONE of the following THREE MACROs according to your application */
#define USE_SCI_UART3_RX /*! Using CH1 of SCI2 as UART Receiver */
//#define USE_SCI_SPI31 /*! Using CH1 of SCI2 as SPI Transmitter or Receiver */
//#define USE_SCI_IIC31 /*! Using CH1 of SCI2 as IIC Transmitter or Receiver */
#define USE_SCI_UART3_RX /*! Using CH1 of SCI3 as UART Receiver */
//#define USE_SCI_SPI31 /*! Using CH1 of SCI3 as SPI Transmitter or Receiver */
//#define USE_SCI_IIC31 /*! Using CH1 of SCI3 as IIC Transmitter or Receiver */
/***********************************************************************************************************************
DMA Control Data Set definitions
......
......@@ -3,8 +3,8 @@
* Auto generated Run-Time-Environment Configuration File
* *** Do not modify ! ***
*
* Project: 'HaoJin'
* Target: 'HaoJin232'
* Project: 'TianYing'
* Target: 'TianYing200'
*/
#ifndef RTE_COMPONENTS_H
......@@ -14,7 +14,7 @@
/*
* Define the Device Header File:
*/
#define CMSIS_device_header "BAT32A239.h"
#define CMSIS_device_header "BAT32G139.h"
......
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 CPU_TYPE=BAT32G139GK64FB
SET CPU_VENDOR=Cmsemicon
SET UV2_TARGET=TianYing200
SET CPU_CLOCK=0x00B71B00
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_fuel.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\backlight.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_espeed.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_vspeed.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\gpiouser.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\can_ch0_can_communication_matrix.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\commoninterface.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\seg_display.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\gui_display.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\can_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\can_app.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_coolant.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_tpms.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\faultcode.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\data_voltage.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\bu98r10.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\services_mileage_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\eemanager_interface.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\key_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\line_in_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\led_driver_interface.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\simulated_iic_2_master.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\analog_circuits.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\analog_signals.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\light_sensor_interface.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\powermanag_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\system_monitor_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\telltales_user.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\maintenance.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\rte_tick_timer_bat32a239.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\rte_wdt_bat32a239.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\rte_gpio_bat32a239.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\deepsleep.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\rte_rtc.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\trmerm.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\rte_adc_interim_version.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\rte_can.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\rte_clock_select_bat32a239.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\uart_demo.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\main.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\sys_scheduler.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\sys_scheduler_lib.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\sys_task_list.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\adc.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\can.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\cgc.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\cmp.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\dac.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\delay.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\dma.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\elc.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\epwm.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\flash.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\gpio.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\i2c.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\i2ca.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\interval.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\intp.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\key.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\pcbz.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\pga.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\rtc.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\sci_common.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\sspi.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\tim.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\tima.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\timb.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\timm.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\uart_1.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\wdt.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\isr.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\docan_iso15765.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\uds_iso14229_server.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\uds_iso14229_services.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\isr_bat32g139.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmAsm" --Via ".\objects\startup_bat32g139._ia"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\system_bat32g139.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmLink" --Via ".\Objects\TianYing.lnp"
"C:\Keil_v5\ARM\ARMCC\Bin\fromelf.exe" ".\Objects\TianYing.axf" --i32combined --output ".\Objects\TianYing.hex"
......@@ -14,9 +14,10 @@
#include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h"
#include "Can_User/Can_User.h"
#include "Can_User/Can_App.h"
#include "Data_Coolant/Data_Coolant.h"
#include "Data_TPMS/Data_TPMS.h"
#include "Data_Voltage/Data_Voltage.h"
#include "FaultCode/FaultCode.h"
#endif
......@@ -6,7 +6,7 @@
#define BACK_LIGHT_DAY 600
#define BACK_LIGHT_NIGHT 200
#define BACK_LIGHT_NIGHT 420
_Light g_Light;
void BackLight_Init(void)
......@@ -19,30 +19,15 @@ void BackLight_Process(void)
{
if (SYS_OPR_STAT_IGN_ON)
{
if(ALS_Get_Data1() > 200)//data1 500以内,data0 3000以内
if ( HighBeam_Timer.LED_Turnon == 5 )
{
if (g_Light.Light_Day < 15)//1.5s 1500ms
{
g_Light.Light_Day++;//100ms
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
}
else
{
g_Light.Light_Night = 0;
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_DAY);
}
}
else
{
if (g_Light.Light_Night < 15)
{
g_Light.Light_Night++;
}
else
{
g_Light.Light_Day = 0;
TimerM_PWM_set_duty(TIMERM_COUNTER1, TIMERM_CHB, BACK_LIGHT_NIGHT);
}
}
}
else
{
......
......@@ -3,14 +3,16 @@
#include "Components.h"
#define CAN_CH0 &CAN_CH0_CanMsgOp
extern st_CanMsgOp CAN_CH0_CanMsgOp;
extern st_CanMsgTxOp CAN_CH0_CanMsgTxOp;
typedef enum
{
CAN_CH0_ID_CAN_0x402_Msg_Count,
CAN_CH0_ID_CAN_0x341_Msg_Count,
CAN_CH0_ID_CAN_0x111_Msg_Count,
CAN_CH0_ID_CAN_0x401_Msg_Count,
CAN_CH0_ID_CAN_0x120_Msg_Count,
CAN_CH0_ID_CAN_0x101_Msg_Count,
CAN_CH0_ID_TOTAL_MAX,
......@@ -18,28 +20,79 @@ typedef enum
typedef enum
{
CAN_CH0_ID_CAN_0x500_Msg_Count,
CAN_CH0_ID_CAN_0x220_Msg_Count,
CAN_CH0_ID_CAN_0x6EE_Msg_Count,
CAN_CH0_ID_CAN_0x6EF_Msg_Count,
CAN_CH0_ID_CAN_0x450_Msg_Count,
CAN_CH0_ID_SEND_TOTAL,
} CAN_CH0_CAN_MSG_SEND_ID_t;
extern const st_CANMsgAttribute CAN_CH0_CAN_MSG_CONST_ARRAY[CAN_CH0_ID_TOTAL_MAX] ;
extern const st_CAN_SendAttribute CAN_CH0_CANSendAttr[CAN_CH0_ID_SEND_TOTAL] ;
#define CAN_CH0_ID_CAN_0x500_Msg 0x500ul
#define CAN_CH0_ID_CAN_0x402_Msg 0x402ul
#define CAN_CH0_ID_CAN_0x341_Msg 0x341ul
#define CAN_CH0_ID_CAN_0x111_Msg 0x111ul
#define CAN_CH0_ID_CAN_0x401_Msg 0x401ul
#define CAN_CH0_ID_CAN_0x220_Msg 0x220ul
#define CAN_CH0_ID_CAN_0x120_Msg 0x120ul
#define CAN_CH0_ID_CAN_0x101_Msg 0x101ul
//extern uint8_t Get_CAN_CH0_ID_500_Sig_Key_ISTOP(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_Warning_Lamp(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCL2(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCM2(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCH2(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCAmnt(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCL1(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCM1(void);
extern uint8_t Get_CAN_CH0_ID_402_Sig_ECU_DTCH1(void);
extern uint8_t Get_CAN_CH0_ID_341_Sig_software_version(void);
extern uint8_t Get_CAN_CH0_ID_341_Sig_Rear_LearningStatus(void);
extern uint8_t Get_CAN_CH0_ID_341_Sig_Front_LearningStatus(void);
extern uint8_t Get_CAN_CH0_ID_341_Sig_Rear_Pressure_Warning(void);
extern uint8_t Get_CAN_CH0_ID_341_Sig_Front_Pressure_Warning(void);
extern uint8_t Get_CAN_CH0_ID_341_Sig_Rear_TireTemperature(void);
extern uint8_t Get_CAN_CH0_ID_341_Sig_Front_TireTemperature(void);
extern uint8_t Get_CAN_CH0_ID_341_Sig_Rear_Pressure(void);
extern uint8_t Get_CAN_CH0_ID_341_Sig_Front_Pressure(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_SideStand_State(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_SideStand(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Engine_InjIgn_Cutoff_State(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Engine_InjIgn_Cutoff(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Engine_Autostop_State(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_Engine_Autostop(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_111_Livecounter(void);
extern uint8_t Get_CAN_CH0_ID_111_Sig_ISG_111_Checksum(void);
extern uint8_t Get_CAN_CH0_ID_401_Sig_ECU_401_Checksum(void);
extern uint8_t Get_CAN_CH0_ID_401_Sig_ECU_401_Livecounter(void);
extern uint8_t Get_CAN_CH0_ID_401_Sig_ECU_Gear_State(void);
extern uint16_t Get_CAN_CH0_ID_401_Sig_ECU_Fuel_Consumption(void);
extern uint8_t Get_CAN_CH0_ID_401_Sig_ECU_Battery_Voltage(void);
extern uint16_t Get_CAN_CH0_ID_401_Sig_ECU_Environment_Presure(void);
extern uint8_t Get_CAN_CH0_ID_220_Sig_CheckSum(void);
extern uint8_t Get_CAN_CH0_ID_220_Sig_AliveCounter(void);
extern uint8_t Get_CAN_CH0_ID_220_Sig_TCS_Switch(void);
extern uint8_t Get_CAN_CH0_ID_120_Sig_TCSStatus(void);
extern uint8_t Get_CAN_CH0_ID_120_Sig_RearWheelSpeedValidity(void);
extern uint16_t Get_CAN_CH0_ID_120_Sig_RearWheelSpeed(void);
extern uint8_t Get_CAN_CH0_ID_120_Sig_Rear_ABS_control_status(void);
extern uint8_t Get_CAN_CH0_ID_120_Sig_FrontWheelSpeedValidity(void);
extern uint16_t Get_CAN_CH0_ID_120_Sig_FrontWheelSpeed(void);
extern uint8_t Get_CAN_CH0_ID_120_Sig_Front_ABS_control_status(void);
extern uint8_t Get_CAN_CH0_ID_120_Sig_CheckSum(void);
extern uint8_t Get_CAN_CH0_ID_120_Sig_AliveCounter(void);
extern uint8_t Get_CAN_CH0_ID_120_Sig_ABS_Warning_lamp(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Vehicle_Speed_State(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Vehicle_Speed(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Throttle_Position_State(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Throttle_Position(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature_State(void);
extern uint16_t Get_CAN_CH0_ID_101_Sig_ECU_Engine_Temperature(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_Engine_Speed_State(void);
extern uint16_t Get_CAN_CH0_ID_101_Sig_ECU_Engine_Speed(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_101_Livecounter(void);
extern uint8_t Get_CAN_CH0_ID_101_Sig_ECU_101_Checksum(void);
extern uint8_t Co_Can_ConvertSubID_CAN_CH0(uint32_t MsgID);
void Can_Set_Buff_500(canlib_uint8_t CopyData[]);
#endif
#include "Can_App.h"
#include "Components.h"
#include "Application.h"
void Can_Set_Buff_500(canlib_uint8_t CopyData[])
void Can_Set_Buff_220(canlib_uint8_t CopyData[])
{
CANMsg500Union *p500;
CANMsg220Union *p220;
uint8_t i = 0;
for (i = 0; i < 8; i++)
p220 = (CANMsg220Union *)CopyData;
if ( p220 != ( void * )0 )
{
for ( i = 0u; i < 8u; i++ )
{
p220->Msg [ i ] = 0xFFu;
}
}
p220 -> Sig.TCS_TX = Get_Dis_Tcs_Val();
}
void Can_Set_Buff_6EE(canlib_uint8_t CopyData[])
{
CANMsg6EEUnion *p6EE;
uint8_t i = 0;
uint16_t Vspeed_tx = 0;
uint32_t ODO_tx = Data_ODO_Read() / 10;
Vspeed_tx = Get_DispVechileSpeed_TX()/10;
p6EE = (CANMsg6EEUnion *)CopyData;
if ( p6EE != ( void * )0 )
{
for ( i = 0u; i < 8u; i++ )
{
p6EE->Msg [ i ] = 0xFFu;
}
}
p6EE -> Sig.Vsppe_H3_TX = (Vspeed_tx >> 8) & 0x7u ;
p6EE -> Sig.Vsppe_L8_TX = Vspeed_tx & 0xFF ;
p6EE -> Sig.ODO_TX_H = (ODO_tx >> 16) & 0xFF ;
p6EE -> Sig.ODO_TX_M = (ODO_tx >> 8) & 0xFF ;
p6EE -> Sig.ODO_TX_L = ODO_tx & 0xFF ;
p6EE -> Sig.Uint_TX = Get_Dis_KM_Unit() ;
p6EE -> Sig.Coolant_Seg_TX = GET_DataCoolantTempSegDisp() ;
if (GET_DataCollantTempWarnflg() == 2)
{
p6EE -> Sig.Coolant_Warn_TX = 1;
}
else
{
p6EE -> Sig.Coolant_Warn_TX = 0;
}
p6EE -> Sig.Fuel_Seg_TX = Get_CurFuelSetp() ;
if(Get_Fuel_RES() > 255)
{
p6EE -> Sig.Fuel_Res_TX = 0xFF ;
}
else
{
p6EE -> Sig.Fuel_Res_TX = Get_Fuel_RES() ;
}
}
void Can_Set_Buff_6EF(canlib_uint8_t CopyData[])
{
CANMsg6EFUnion *p6EF;
uint8_t i = 0;
uint16_t Espeed_tx = 0;
uint16_t TripA_tx = 0;
Espeed_tx = Get_DispEngineSpeed()/100;
TripA_tx = Data_Read_Trip(EM_TRIP_A);
p6EF = (CANMsg6EFUnion *)CopyData;
if ( p6EF != ( void * )0 )
{
for ( i = 0u; i < 8u; i++ )
{
CopyData[i] = 0xFFU;
p6EF->Msg [ i ] = 0xFFu;
}
p500 = (CANMsg500Union *)CopyData;
if (p500 != (void *)0)
}
p6EF -> Sig.Espeed_TX = Espeed_tx;
p6EF -> Sig.TripA_H = (TripA_tx >> 8) & 0xFF;
p6EF -> Sig.TripA_L = TripA_tx & 0xFF;
p6EF -> Sig.Coolant_TX = GET_DataCoolantTempValueDisp() + 40;
}
void Can_Set_Buff_450(canlib_uint8_t CopyData[])
{
CANMsg450Union *p450;
uint8_t i = 0;
p450 = (CANMsg450Union *)CopyData;
if ( p450 != ( void * )0 )
{
p500->Sig.Key_ISTOP = Auto_Start_Stop;
p500->Msg[1] = 0x00;
p500->Msg[2] = 0x00;
p500->Msg[3] = 0x00;
p500->Msg[4] = 0x00;
p500->Msg[5] = 0x00;
p500->Msg[6] = 0x00;
p500->Msg[7] = 0x00;
for ( i = 0u; i < 8u; i++ )
{
p450->Msg [ i ] = 0xFFu;
}
}
p450 -> Sig.Front_Pressure_TX_H = (Get_Front_TPMS_TX() >> 8) & 0xFF;
p450 -> Sig.Front_Pressure_TX_L = Get_Front_TPMS_TX() & 0xFF;
p450 -> Sig.Rear_Pressure_TX_H = (Get_Rear_TPMS_TX() >> 8) & 0xFF;
p450 -> Sig.Rear_Pressure_TX_L = Get_Rear_TPMS_TX() & 0xFF;
}
......@@ -168,8 +168,6 @@ uint32_t Common_GetSocTime(void)
*/
uint32_t Data_Km_To_Mile(uint32_t Km)
{
//Km *= 621;
//Km /= 1000;
Km *= 100;
Km /= 161;
return Km;
......
This diff is collapsed.
#ifndef _DATA_Coolant_H_
#define _DATA_Coolant_H_
#include "common.h"
#define CoolantFlashtimer 250
#define CoolantSelfCheckFlashtimer 15
/*** 控制结构 ***/
typedef struct
{
uint8_t Dis_Valid;
uint8_t u8_DestSeg;
uint8_t u8_CurSeg;
uint8_t u8_UpFlashtimer ;
uint8_t u8_DownFlashtimer ;
uint8_t u8_Uptimer ;
uint8_t u8_Downtimer ;
uint8_t u8_Flashflg;
uint8_t u8_Warnflg;
uint8_t u8_Flg;
}DataCoolantTempDisStruct;
extern DataCoolantTempDisStruct DataCoolantTemp_Dis;
typedef struct
{
uint16_t Value;
uint8_t Valid;
}DataCoolantTempStruct; //水温数据结构
void Data_Coolant_Temp_KL30_Init(void);
void Data_Coolant_Temp_KL15_Init(void);
void Data_Coolant_Temp_Processing_Service(void);
void Get_Coolant_Temp_Seg(uint16_t Temp_Value);
void Data_Coolant_Temp_Display ( void );
uint8_t GET_DataCollantTempSegValid(void);
uint8_t GET_DataCoolantTempSegDisp(void);
uint16_t GET_DataCoolantTempValueDisp(void);
uint8_t GET_DataCollantTempWarnflg(void);
extern DataCoolantTempStruct DataCoolantTemp ;
#endif
This diff is collapsed.
This diff is collapsed.
......@@ -11,7 +11,7 @@
#define DATA_VSPEED_INC_STEP 2 //速度增加时慢加速速度变化步长
#define DATA_VSPEED_DEC_STEP 6 //方向改变时急减速速度变化步长
#define DATA_VSPEED_APPR_SPEED_MIN 2 //最小逼近速度
#define DATA_VSPEED_HYSTERESIS 10 //回差
#define DATA_VSPEED_HYSTERESIS 15 //回差
/*** 控制结构 ***/
typedef struct
......@@ -69,5 +69,6 @@ uint16_t Get_ActualVechileSpeed(void);
/*显示车速,精度10倍,取整,舍去小数点*/
uint16_t Get_DispVechileSpeed(void);
uint16_t Get_DispVechileSpeed_Mile(void);
uint16_t Get_DispVechileSpeed_TX(void);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -16,5 +16,6 @@ extern void Fuel_Cal_Sevice(uint8_t deltaTime);
extern uint8_t Get_Fuel_Disp_Byte(void);
extern uint8_t Get_CurFuelSetp(void);
extern FuelSensorSts_t Get_Fuel_Sensor_State(void);
uint16_t Get_Fuel_RES(void);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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