Commit c04903d0 authored by 李俭双's avatar 李俭双

🐞 fix:增加段码强制刷新策略

parent ecadc495
...@@ -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,24 +578,22 @@ void BU98R10_Shutdown(void) ...@@ -575,24 +578,22 @@ 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))
{
u32BU98R10ForcedUpdate += BU98R10_FORCED_SEG_NUM;
}
else
{
u32BU98R10ForcedUpdate = 0UL;
}
}
u8BU98R10CheckCount = 0;
BU98R10Update.En = 1; BU98R10Update.En = 1;
}
#if USE_BU98R10_CHIP_0 #if USE_BU98R10_CHIP_0
BU98R10Update.Chip = 0; BU98R10Update.Chip = 0;
...@@ -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];
......
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