From e0279d4cf77953f1c0a05761ad19707355912775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nima=20Askari=20=28=D9=86=DB=8C=D9=85=D8=A7=20=D8=B9=D8=B3?= =?UTF-8?q?=DA=A9=D8=B1=DB=8C=29?= Date: Wed, 13 Dec 2023 09:07:09 +0100 Subject: [PATCH] Update ee.c --- ee.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ee.c b/ee.c index 4357e23..4ee97bf 100644 --- a/ee.c +++ b/ee.c @@ -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] =