flash_internal: fix error return code
This commit is contained in:
parent
0aab25e870
commit
f85a3d2439
|
@ -122,7 +122,7 @@ int32_t flash_internal_write(uint32_t address, const uint8_t *buffer, size_t siz
|
||||||
if (address < FLASH_BASE) {
|
if (address < FLASH_BASE) {
|
||||||
return -3;
|
return -3;
|
||||||
} else if ((uint32_t)&__flash_end >= FLASH_BASE && (address + size) > (uint32_t)&__flash_end) {
|
} else if ((uint32_t)&__flash_end >= FLASH_BASE && (address + size) > (uint32_t)&__flash_end) {
|
||||||
return 4;
|
return -4;
|
||||||
} else if ((uint32_t)&__flash_end < FLASH_BASE && (address + size) > (FLASH_BASE + DESIG_FLASH_SIZE * 1024)) {
|
} else if ((uint32_t)&__flash_end < FLASH_BASE && (address + size) > (FLASH_BASE + DESIG_FLASH_SIZE * 1024)) {
|
||||||
return -5;
|
return -5;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue