Lines Matching refs:buf_bytes
134 if (ctx->buf_bytes == 0) { in flash_sync()
141 write_addr + ctx->buf_bytes - 1); in flash_sync()
150 if (ctx->buf_bytes % fill_length) { in flash_sync()
151 fill_length -= ctx->buf_bytes % fill_length; in flash_sync()
154 memset(ctx->buf + ctx->buf_bytes, filler, fill_length); in flash_sync()
159 buf_bytes_aligned = ctx->buf_bytes + fill_length; in flash_sync()
174 for (int i = 0; i < ctx->buf_bytes; i++) { in flash_sync()
179 ctx->buf_bytes); in flash_sync()
185 rc = ctx->callback(ctx->buf, ctx->buf_bytes, write_addr); in flash_sync()
194 ctx->bytes_written += ctx->buf_bytes; in flash_sync()
195 ctx->buf_bytes = 0U; in flash_sync()
211 if (ctx->bytes_written + ctx->buf_bytes + len > ctx->available) { in stream_flash_buffered_write()
216 (buf_empty_bytes = ctx->buf_len - ctx->buf_bytes)) { in stream_flash_buffered_write()
217 memcpy(ctx->buf + ctx->buf_bytes, data + processed, in stream_flash_buffered_write()
220 ctx->buf_bytes = ctx->buf_len; in stream_flash_buffered_write()
232 memcpy(ctx->buf + ctx->buf_bytes, in stream_flash_buffered_write()
234 ctx->buf_bytes += len - processed; in stream_flash_buffered_write()
237 if (flush && ctx->buf_bytes > 0) { in stream_flash_buffered_write()
320 ctx->buf_bytes = 0U; in stream_flash_init()