Commit f8093b4b authored by 张明扬's avatar 张明扬 🇨🇳
parents 7df3a8d9 7248b557
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 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_TYPE=BAT32G139GK64FB
SET CPU_VENDOR=Cmsemicon SET CPU_VENDOR=Cmsemicon
SET UV2_TARGET=TianYing200 SET UV2_TARGET=TianYing200
...@@ -55,36 +58,4 @@ SET CPU_CLOCK=0x00B71B00 ...@@ -55,36 +58,4 @@ SET CPU_CLOCK=0x00B71B00
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\adc.__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\can.__i"
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\cgc.__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
"C:\Keil_v5\ARM\ARMCC\Bin\ArmCC" --Via ".\objects\dac.__i" \ No newline at end of file
"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.__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"
...@@ -151,9 +151,9 @@ void FaultCode_Init(void) ...@@ -151,9 +151,9 @@ void FaultCode_Init(void)
stFaultCodetemp[i].u16FaultCodeCount = 0; stFaultCodetemp[i].u16FaultCodeCount = 0;
} }
FaultCodeInit.callbacks[DTC1] = Get_FaultCodeDtc1; FaultCodeInit.callbacks[DTC_1] = Get_FaultCodeDtc1;
FaultCodeInit.callbacks[DTC2] = Get_FaultCodeDtc2; FaultCodeInit.callbacks[DTC_2] = Get_FaultCodeDtc2;
FaultCodeInit.callbacks[DTC3] = NULL; FaultCodeInit.callbacks[DTC_3] = NULL;
FaultCodeInit.FaultCodeVaildCbk = Get_FaultCodeValid; FaultCodeInit.FaultCodeVaildCbk = Get_FaultCodeValid;
FaultCodeInit.FaultCodeNumCbk = Get_FaultCodeNum; FaultCodeInit.FaultCodeNumCbk = Get_FaultCodeNum;
...@@ -227,19 +227,19 @@ void FaultCode_Service(uint16_t Cycle) ...@@ -227,19 +227,19 @@ void FaultCode_Service(uint16_t Cycle)
uint32_t tempFaultCode = 0; uint32_t tempFaultCode = 0;
uint16_t Vaild = 0; uint16_t Vaild = 0;
if (FaultCodeInit.callbacks[DTC1] != NULL) if (FaultCodeInit.callbacks[DTC_1] != NULL)
{ {
Dtc1 = FaultCodeInit.callbacks[DTC1](); Dtc1 = FaultCodeInit.callbacks[DTC_1]();
} }
if (FaultCodeInit.callbacks[DTC2] != NULL) if (FaultCodeInit.callbacks[DTC_2] != NULL)
{ {
Dtc2 = FaultCodeInit.callbacks[DTC2](); Dtc2 = FaultCodeInit.callbacks[DTC_2]();
} }
if (FaultCodeInit.callbacks[DTC3] != NULL) if (FaultCodeInit.callbacks[DTC_3] != NULL)
{ {
Dtc3 = FaultCodeInit.callbacks[DTC3](); Dtc3 = FaultCodeInit.callbacks[DTC_3]();
} }
if (FaultCodeInit.FaultCodeVaildCbk != NULL) if (FaultCodeInit.FaultCodeVaildCbk != NULL)
......
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
typedef enum typedef enum
{ {
DTC1, DTC_1,
DTC2, DTC_2,
DTC3, DTC_3,
NUM_FAULT_TYPES, NUM_FAULT_TYPES,
} FaultCodeType_Num; } FaultCodeType_Num;
......
...@@ -275,6 +275,7 @@ BU98R10DDRAMUnion BU98R10Chip1DDRAMBackup; ...@@ -275,6 +275,7 @@ BU98R10DDRAMUnion BU98R10Chip1DDRAMBackup;
#endif #endif
BU98R10UpdateCtrlStruct BU98R10Update; BU98R10UpdateCtrlStruct BU98R10Update;
uint32_t u32BU98R10ForcedUpdate = 0UL;
void BU98R10_Init(void) void BU98R10_Init(void)
{ {
...@@ -283,6 +284,8 @@ void BU98R10_Init(void) ...@@ -283,6 +284,8 @@ void BU98R10_Init(void)
#if BU98R10_WRITE_AT_SAME_TIME #if BU98R10_WRITE_AT_SAME_TIME
#if BU98R10_COLORFUL_LCD_MODE #if BU98R10_COLORFUL_LCD_MODE
Gen_TimeDelay(120 * 1000u, 50u);
BU98R10_All_Command_Write(BU98R10_CMD_SWRST); BU98R10_All_Command_Write(BU98R10_CMD_SWRST);
Gen_TimeDelay(20*1000, 50U); Gen_TimeDelay(20*1000, 50U);
...@@ -545,7 +548,7 @@ void BU98R10_Init(void) ...@@ -545,7 +548,7 @@ void BU98R10_Init(void)
#endif #endif
#endif #endif
#endif #endif
u32BU98R10ForcedUpdate = 0UL;
BU98R10Update.En = 0; BU98R10Update.En = 0;
BU98R10Update.Step = 0; BU98R10Update.Step = 0;
BU98R10Update.Cont = 0; BU98R10Update.Cont = 0;
...@@ -575,25 +578,23 @@ void BU98R10_Shutdown(void) ...@@ -575,25 +578,23 @@ void BU98R10_Shutdown(void)
#endif #endif
} }
uint8_t u8BU98R10CheckCount = 0; #define BU98R10_FORCED_SEG_NUM 2U
void BU98R10_Update_Request(void) void BU98R10_Update_Request(void)
{ {
// if (g_sysFlag.Bits.AccSaveState) if (BU98R10Update.En == 0)
//{
// //if (u8BU98R10CheckCount < 20)
// //{
// // BU98R10Update.En = 1;
// // u8BU98R10CheckCount++;
// //}
// BU98R10Update.En = 1;
// }
// else
{ {
if (u32BU98R10ForcedUpdate <= (BU98R10_DDRAM_SIZE - BU98R10_FORCED_SEG_NUM))
u8BU98R10CheckCount = 0; {
BU98R10Update.En = 1; u32BU98R10ForcedUpdate += BU98R10_FORCED_SEG_NUM;
}
else
{
u32BU98R10ForcedUpdate = 0UL;
}
} }
BU98R10Update.En = 1;
#if USE_BU98R10_CHIP_0 #if USE_BU98R10_CHIP_0
BU98R10Update.Chip = 0; BU98R10Update.Chip = 0;
#elif USE_BU98R10_CHIP_1 #elif USE_BU98R10_CHIP_1
...@@ -613,7 +614,9 @@ void BU98R10_Update_Service(void) ...@@ -613,7 +614,9 @@ void BU98R10_Update_Service(void)
{ {
case 0: case 0:
if ((BU98R10Chip0DDRAM.Byte[BU98R10Update.Addr] != BU98R10Chip0DDRAMBackup.Byte[BU98R10Update.Addr]) || if ((BU98R10Chip0DDRAM.Byte[BU98R10Update.Addr] != BU98R10Chip0DDRAMBackup.Byte[BU98R10Update.Addr]) ||
(BU98R10Chip1DDRAM.Byte[BU98R10Update.Addr] != BU98R10Chip1DDRAMBackup.Byte[BU98R10Update.Addr])) (BU98R10Chip1DDRAM.Byte[BU98R10Update.Addr] != BU98R10Chip1DDRAMBackup.Byte[BU98R10Update.Addr]) ||
((u32BU98R10ForcedUpdate <= BU98R10Update.Addr) &&
((u32BU98R10ForcedUpdate + BU98R10_FORCED_SEG_NUM) >= BU98R10Update.Addr)))
{ {
BU98R10Chip0DDRAMBackup.Byte[BU98R10Update.Addr] = BU98R10Chip0DDRAM.Byte[BU98R10Update.Addr]; BU98R10Chip0DDRAMBackup.Byte[BU98R10Update.Addr] = BU98R10Chip0DDRAM.Byte[BU98R10Update.Addr];
BU98R10Chip1DDRAMBackup.Byte[BU98R10Update.Addr] = BU98R10Chip1DDRAM.Byte[BU98R10Update.Addr]; BU98R10Chip1DDRAMBackup.Byte[BU98R10Update.Addr] = BU98R10Chip1DDRAM.Byte[BU98R10Update.Addr];
......
#include "Service_Interval.h" #include "Service_Interval.h"
#include <stdio.h>
#include <string.h>
#include "Components.h"
/** /**
* @file Service_Interval.c * @file Service_Interval.c
* @brief 保养里程 * @brief 保养里程
......
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