Skip to content

Commit 7574d67

Browse files
storage_cli: increase write_chunk buffer size again
1 parent 6044e42 commit 7574d67

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

applications/services/storage/storage_cli.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,12 @@ static void storage_cli_write_chunk(PipeSide* pipe, FuriString* path, FuriString
317317
} else {
318318
if(storage_file_open(file, furi_string_get_cstr(path), FSAM_WRITE, FSOM_OPEN_APPEND)) {
319319
printf("Ready\r\n");
320-
char buffer[256];
320+
const size_t buffer_size = 1024;
321+
uint8_t* buffer = malloc(buffer_size);
321322

322323
while(need_to_read) {
323324
size_t read_this_time =
324-
pipe_receive(pipe, buffer, MIN(sizeof(buffer), need_to_read), FuriWaitForever);
325+
pipe_receive(pipe, buffer, MIN(buffer_size, need_to_read), FuriWaitForever);
325326
size_t wrote_this_time = storage_file_write(file, buffer, read_this_time);
326327

327328
if(wrote_this_time != read_this_time) {
@@ -330,6 +331,8 @@ static void storage_cli_write_chunk(PipeSide* pipe, FuriString* path, FuriString
330331
}
331332
need_to_read -= read_this_time;
332333
}
334+
335+
free(buffer);
333336
} else {
334337
storage_cli_print_error(storage_file_get_error(file));
335338
}

0 commit comments

Comments
 (0)