Commit acb1d22f authored by 时昊's avatar 时昊

🐞 fix:修改存储地址区域32个字节为一个区域,地址0xa0不使用

parent 8e1d2405
......@@ -11,15 +11,15 @@
#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
#define EEPROM_BLOCK_01 0x20
#define EEPROM_BLOCK_02 0x40
#define EEPROM_BLOCK_03 0x60
#define EEPROM_BLOCK_04 0x80
#define EEPROM_BLOCK_05 0xC0
#define EEPROM_BLOCK_06 0xE0
#define EEPROM_BLOCK_07 0x100
#define EEPROM_BLOCK_08 0x120
#define EEPROM_BLOCK_09 0x140
extern uint8_t ODO_Clear_Num_Value;
......
......@@ -50,51 +50,34 @@ void Service_Interval_Second_Reset(void)
static void Service_Interval_Write_EEProm(uint32_t u32Data [], uint16_t u16Len)
{
// uint32_t i = 0;
// uint32_t j = 1;
// uint32_t retryCnt = 0;
// r_eel_status_t status = R_EEL_BUSY;
// while ( status != R_EEL_OK )
// {
// if ( j == 1 )
// {
// j = 0;
// retryCnt++;
// status = Internal_EEL_Write(INTERNAL_EE_BLOCK_09, ( uint8_t * )u32Data, u16Len * 4);
// }
// else
// {
// i++;
// if ( i >= 100 )
// {
// i = 0;
// j = 1;
// }
// }
// if ( retryCnt > 3 )
// {
// break;
// }
// }
eeprom_WriteRecord(EEPROM_BLOCK_05, (uint8_t *)u32Data, u16Len * 4);
ee_uint16_t tmpWritestatus = 0;
ee_uint16_t Cnt = 0;
tmpWritestatus = eeprom_WriteRecord(EEPROM_BLOCK_05, (uint8_t *)u32Data, u16Len * 4);
while(tmpWritestatus == WRITING)
{
tmpWritestatus = eeprom_WriteRecord(EEPROM_BLOCK_05, (uint8_t *)u32Data, u16Len * 4);
Cnt++;
if(Cnt >= 1000)
{
break;
}
}
}
static void Service_Interval_Read_EEProm(uint32_t u32Data [], uint16_t u16Len)
{
// uint32_t i = 0;
// r_eel_status_t status = R_EEL_BUSY;
// status = Internal_EEL_Read(INTERNAL_EE_BLOCK_09, ( uint8_t * )u32Data, u16Len * 4);
// if ( status != R_EEL_OK )
// {
// for ( i = 0; i < u16Len; i++ )
// {
// u32Data [ i ] = 0u;
// }
// }
eeprom_ReadRecord(EEPROM_BLOCK_05, (uint8_t *)u32Data, u16Len * 4);
ee_uint16_t tmpReadstatus = 0;
ee_uint16_t Cnt = 0;
tmpReadstatus = eeprom_ReadRecord(EEPROM_BLOCK_05, (uint8_t *)u32Data, u16Len * 4);
while(tmpReadstatus == READING)
{
tmpReadstatus = eeprom_ReadRecord(EEPROM_BLOCK_05, (uint8_t *)u32Data, u16Len * 4);
Cnt++;
if(Cnt >= 1000)
{
break;
}
}
}
uint32_t g_ServiceMil100m = 0;
......
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