dfu: make flash_img write to flash on buffer full
flash_img subsystem writes data to flash only when the amount of data to be written is larger than available buffer space. This commit modifies this behavior to write data to flash as soon as the buffer is full. Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit is contained in:
parent
feaf008c88
commit
a75fc4199f
1 changed files with 1 additions and 1 deletions
|
@ -162,7 +162,7 @@ int flash_img_buffered_write(struct flash_img_context *ctx, u8_t *data,
|
|||
int rc = 0;
|
||||
int buf_empty_bytes;
|
||||
|
||||
while ((len - processed) >
|
||||
while ((len - processed) >=
|
||||
(buf_empty_bytes = CONFIG_IMG_BLOCK_BUF_SIZE - ctx->buf_bytes)) {
|
||||
memcpy(ctx->buf + ctx->buf_bytes, data + processed,
|
||||
buf_empty_bytes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue