mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
riotboot/flashwrite: Add force flush to storage function
This commit is contained in:
parent
a00314bfc4
commit
f05c5f7708
@ -132,6 +132,14 @@ static inline int riotboot_flashwrite_init(riotboot_flashwrite_t *state,
|
||||
*/
|
||||
int riotboot_flashwrite_putbytes(riotboot_flashwrite_t *state,
|
||||
const uint8_t *bytes, size_t len, bool more);
|
||||
/**
|
||||
* @brief Force flush the buffer onto the flash
|
||||
*
|
||||
* @param[in,out] state ptr to previously used update state
|
||||
*
|
||||
* @returns 0 on success, <0 otherwise
|
||||
*/
|
||||
int riotboot_flashwrite_flush(riotboot_flashwrite_t *state);
|
||||
|
||||
/**
|
||||
* @brief Finish a firmware update (raw version)
|
||||
|
@ -57,6 +57,15 @@ int riotboot_flashwrite_init_raw(riotboot_flashwrite_t *state, int target_slot,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int riotboot_flashwrite_flush(riotboot_flashwrite_t *state)
|
||||
{
|
||||
if (flashpage_write_and_verify(state->flashpage, state->flashpage_buf) != FLASHPAGE_OK) {
|
||||
LOG_WARNING(LOG_PREFIX "error writing flashpage %u!\n", state->flashpage);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int riotboot_flashwrite_putbytes(riotboot_flashwrite_t *state,
|
||||
const uint8_t *bytes, size_t len, bool more)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user