Return when a write fails

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos 2022-02-03 11:25:40 +01:00
parent 756d9a3d5b
commit 08e6e2d2dd
No known key found for this signature in database
GPG key ID: C0095B7870A4CCD3

View file

@ -281,9 +281,12 @@ flash_data_pool_allocate (size_t size)
size = (size + 1) & ~1; /* allocation unit is 1-halfword (2-byte) */
if (is_data_pool_full (size))
if (flash_copying_gc () < 0 || /*still*/ is_data_pool_full (size))
if (is_data_pool_full (size)) {
if (flash_copying_gc () < 0 || /*still*/ is_data_pool_full (size)) {
TU_LOG1 ("!!!! FATAL: %d\r\n",FATAL_FLASH);
return NULL;
}
}
p = last_p;
last_p += size;
@ -519,6 +522,7 @@ flash_put_data (uint16_t hw)
if (p == NULL)
{
DEBUG_INFO ("data allocation failure.\r\n");
return;
}
flash_program_halfword ((uintptr_t)p, hw);