Update ee.c

This commit is contained in:
Nima Askari (نیما عسکری) 2023-12-13 09:07:09 +01:00 committed by GitHub
parent d9f9c7d7ac
commit e0279d4cf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

9
ee.c
View File

@ -329,8 +329,7 @@ bool ee_write(uint32_t startVirtualAddress, uint32_t len, uint8_t *data)
return false;
}
}
#endif
#ifdef FLASH_TYPEPROGRAM_HALFWORD
#elif FLASH_TYPEPROGRAM_HALFWORD
for (uint32_t i = 0; i < len ; i+=2)
{
if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_HALFWORD, ((i + startVirtualAddress)) + _EE_ADDR_INUSE, (uint64_t)(data[i] | (data[i+1] << 8))) != HAL_OK)
@ -342,8 +341,7 @@ bool ee_write(uint32_t startVirtualAddress, uint32_t len, uint8_t *data)
return false;
}
}
#endif
#ifdef FLASH_TYPEPROGRAM_DOUBLEWORD
#elif FLASH_TYPEPROGRAM_DOUBLEWORD
for (uint32_t i = 0; i < len; i += 8)
{
uint8_t DoubleWord[8] =
@ -360,8 +358,7 @@ bool ee_write(uint32_t startVirtualAddress, uint32_t len, uint8_t *data)
return false;
}
}
#endif
#ifdef FLASH_TYPEPROGRAM_QUADWORD
#elif FLASH_TYPEPROGRAM_QUADWORD
for (uint32_t i = 0; i < len; i += 16)
{
uint8_t QuadWord[16] =