mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-26 06:20:21 +00:00
Storage: speedup write_chunk cli command (#3173)
* Storage: speedup write_chunk cli command * Storage: handle disconnect on write_chunk correctly
This commit is contained in:
parent
0fe93fcfa4
commit
176fb21f5f
1 changed files with 2 additions and 4 deletions
|
@ -333,11 +333,9 @@ static void storage_cli_write_chunk(Cli* cli, FuriString* path, FuriString* args
|
|||
if(buffer_size) {
|
||||
uint8_t* buffer = malloc(buffer_size);
|
||||
|
||||
for(uint32_t i = 0; i < buffer_size; i++) {
|
||||
buffer[i] = cli_getc(cli);
|
||||
}
|
||||
size_t read_bytes = cli_read(cli, buffer, buffer_size);
|
||||
|
||||
uint16_t written_size = storage_file_write(file, buffer, buffer_size);
|
||||
uint16_t written_size = storage_file_write(file, buffer, read_bytes);
|
||||
|
||||
if(written_size != buffer_size) {
|
||||
storage_cli_print_error(storage_file_get_error(file));
|
||||
|
|
Loading…
Reference in a new issue