storage: add erase command

Add an erase command to let the user have more control over the
allocated area. This will also be more familiar to embedded developers.
As a bonus it minimizes the logic needed in firmware, and in theory we
can now increase the current write limit of one sector.
This commit is contained in:
Daniel Jobson 2024-09-30 14:16:02 +02:00
parent 6ac874584d
commit 290f826e76
No known key found for this signature in database
GPG key ID: 3707A9DBF4BB8F1A
4 changed files with 49 additions and 9 deletions

View file

@ -34,6 +34,11 @@ int syscall(syscall_t *ctx)
ctx->size);
break;
case ERASE_DATA:
return storage_erase_sector(&part_table, ctx->offset,
ctx->size);
break;
case PRELOAD_STORE:
return preload_store(&part_table, ctx->offset, ctx->data,
ctx->size);