|
@@ -13,7 +13,7 @@ flash_result_t Flash_Write(uint64_t * data) {
|
|
val.u64 = *data;
|
|
val.u64 = *data;
|
|
|
|
|
|
// search first free cell
|
|
// search first free cell
|
|
- while ((address < FLASH_PAGE_END) || ((*(__IO uint32_t*)address) != 0xffffffff)) {
|
|
|
|
|
|
+ while ((address < FLASH_PAGE_END) && ((*(__IO uint32_t*)address) != 0xffffffff)) {
|
|
address += 8;
|
|
address += 8;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -74,7 +74,7 @@ flash_result_t Flash_Read(uint64_t * data) {
|
|
flash_result_t res = Flash_Ok;
|
|
flash_result_t res = Flash_Ok;
|
|
uint32_t address = FLASH_PAGE_START;
|
|
uint32_t address = FLASH_PAGE_START;
|
|
|
|
|
|
- while ((address < FLASH_PAGE_END) || ((*(__IO uint32_t*)address) != 0xffffffff)) {
|
|
|
|
|
|
+ while ((address < FLASH_PAGE_END) && ((*(__IO uint32_t*)address) != 0xffffffff)) {
|
|
val.u32[0] = (*(__IO uint32_t*)address);
|
|
val.u32[0] = (*(__IO uint32_t*)address);
|
|
address += 4;
|
|
address += 4;
|
|
val.u32[1] = (*(__IO uint32_t*)address);
|
|
val.u32[1] = (*(__IO uint32_t*)address);
|