Commit 8c42b5aa authored by 时昊's avatar 时昊

Merge branch 'lijianshuang' into 'dev'

Lijianshuang

See merge request !49
parents 74355652 597f4ed7
...@@ -484,8 +484,8 @@ void MenuData_TCS_Init(void) ...@@ -484,8 +484,8 @@ void MenuData_TCS_Init(void)
uint8_t ClearODO_Flag = 0; uint8_t ClearODO_Flag = 0;
void TYW_RESET_ODO(void) void TYW_RESET_ODO(void)
{ {
uint8_t Clear_EE[1] = {0xff}; uint8_t Clear_EE[4] = {0xff, 0xff, 0xff, 0xff};
uint32_t EE_Count = 0U;
if(SYS_OPR_STAT_IGN_ON) if(SYS_OPR_STAT_IGN_ON)
{ {
if(ClearODO_Flag < 1) if(ClearODO_Flag < 1)
...@@ -494,10 +494,16 @@ void TYW_RESET_ODO(void) ...@@ -494,10 +494,16 @@ void TYW_RESET_ODO(void)
{ {
ClearODO_Flag = 1; ClearODO_Flag = 1;
Data_Mileage_Clear(); Data_Mileage_Clear();
for(EE_Count = 0 ; EE_Count < 255; EE_Count++) eeprom_WriteRecord(EEPROM_BLOCK_00, ( uint8_t * )&Clear_EE, 4);
{ eeprom_WriteRecord(EEPROM_BLOCK_01, ( uint8_t * )&Clear_EE, 4);
eeprom_WriteRecord(EE_Count, ( uint8_t * )&Clear_EE, 1); eeprom_WriteRecord(EEPROM_BLOCK_02, ( uint8_t * )&Clear_EE, 4);
} eeprom_WriteRecord(EEPROM_BLOCK_03, ( uint8_t * )&Clear_EE, 4);
eeprom_WriteRecord(EEPROM_BLOCK_04, ( uint8_t * )&Clear_EE, 4);
eeprom_WriteRecord(EEPROM_BLOCK_05, ( uint8_t * )&Clear_EE, 4);
eeprom_WriteRecord(EEPROM_BLOCK_06, ( uint8_t * )&Clear_EE, 4);
eeprom_WriteRecord(EEPROM_BLOCK_07, ( uint8_t * )&Clear_EE, 4);
eeprom_WriteRecord(EEPROM_BLOCK_08, ( uint8_t * )&Clear_EE, 4);
eeprom_WriteRecord(EEPROM_BLOCK_09, ( uint8_t * )&Clear_EE, 4);
} }
} }
} }
......
...@@ -10,16 +10,7 @@ uint8_t odo_writeState; ...@@ -10,16 +10,7 @@ uint8_t odo_writeState;
uint8_t odo_readState; uint8_t odo_readState;
extern uint32_t NVM_User_Settings_Service; extern uint32_t NVM_User_Settings_Service;
#define EEPROM_BLOCK_00 0x00
#define EEPROM_BLOCK_01 0x16
#define EEPROM_BLOCK_02 0x32
#define EEPROM_BLOCK_03 0x48
#define EEPROM_BLOCK_04 0x64
#define EEPROM_BLOCK_05 0x80
#define EEPROM_BLOCK_06 0x90
#define EEPROM_BLOCK_07 0xA0
#define EEPROM_BLOCK_08 0xB0
#define EEPROM_BLOCK_09 0xC0
uint32_t Milleage_InitFlag = 0U; uint32_t Milleage_InitFlag = 0U;
......
#ifndef __SERVICE_ODO_USER_H__ #ifndef __SERVICE_ODO_USER_H__
#define __SERVICE_ODO_USER_H__ #define __SERVICE_ODO_USER_H__
//#define ONLY_CLEAR_ODO_MIL 0x01u /*仅根据距离信息进行ODO清除*/ //#define ONLY_CLEAR_ODO_MIL 0x01u /*仅根据距离信息进行ODO清除*/
//#define ONLY_CLEAR_ODO_NUM 0x01u /*仅根据次数信息进行ODO清除*/ //#define ONLY_CLEAR_ODO_NUM 0x01u /*仅根据次数信息进行ODO清除*/
#define CLEAR_ODO_NUM_MIL 0x01u /*以距离信息以及次数信息进行ODO清除*/ #define CLEAR_ODO_NUM_MIL 0x01u /*以距离信息以及次数信息进行ODO清除*/
...@@ -8,6 +10,17 @@ ...@@ -8,6 +10,17 @@
#define ODO_CLEAR_NUM 5u /*清除次数上限值 */ #define ODO_CLEAR_NUM 5u /*清除次数上限值 */
#define ODO_CLEAR_MIL 50000u /*清除距离上限值 单位0.1KM*/ #define ODO_CLEAR_MIL 50000u /*清除距离上限值 单位0.1KM*/
#define EEPROM_BLOCK_00 0x00
#define EEPROM_BLOCK_01 0x16
#define EEPROM_BLOCK_02 0x32
#define EEPROM_BLOCK_03 0x48
#define EEPROM_BLOCK_04 0x64
#define EEPROM_BLOCK_05 0x80
#define EEPROM_BLOCK_06 0x90
#define EEPROM_BLOCK_07 0xA0
#define EEPROM_BLOCK_08 0xB0
#define EEPROM_BLOCK_09 0xC0
extern uint8_t ODO_Clear_Num_Value; extern uint8_t ODO_Clear_Num_Value;
void Data_User_Mileage_KL30Init(void); void Data_User_Mileage_KL30Init(void);
......
...@@ -79,7 +79,7 @@ void Sys_50ms_Tasks(void) ...@@ -79,7 +79,7 @@ void Sys_50ms_Tasks(void)
} }
uint8_t u8LEDDriverCheckCount = 0U; uint8_t u8LEDDriverCheckCount = 0U;
uint16_t ljs_voltage = 0; //uint16_t ljs_voltage = 0;
void Sys_100ms_Tasks(void) void Sys_100ms_Tasks(void)
{ {
if((PageType != Page_Time_Hour)&&(PageType != Page_Time_Minute)) if((PageType != Page_Time_Hour)&&(PageType != Page_Time_Minute))
...@@ -95,7 +95,7 @@ void Sys_100ms_Tasks(void) ...@@ -95,7 +95,7 @@ void Sys_100ms_Tasks(void)
S3_ServerCNTT(); S3_ServerCNTT();
//ECU_FaultCode_Processing_Service(); //ECU_FaultCode_Processing_Service();
Send_UUID_To_Esp32(); Send_UUID_To_Esp32();
ljs_voltage = ADC_Conv_Single_Channel(ADC_CH_KL15_VOLTAGE); //ljs_voltage = ADC_Conv_Single_Channel(ADC_CH_KL15_VOLTAGE);
if (u8LEDDriverCheckCount >= 10U) if (u8LEDDriverCheckCount >= 10U)
{ {
u8LEDDriverCheckCount = 0U; u8LEDDriverCheckCount = 0U;
......
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