mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-24 23:09:26 -05:00
Insist on writing stream data in buffer-sized blocks.
Maintaining alignment improves SD card write performance significantly.
This commit is contained in:
parent
0d8971cd7d
commit
ba3c9dd8d1
@ -121,8 +121,8 @@ private:
|
||||
|
||||
const auto bytes_to_write = stream.read(write_buffer->data(), write_buffer->size());
|
||||
|
||||
if( bytes_to_write ) {
|
||||
if( !file.write(write_buffer->data(), bytes_to_write) ) {
|
||||
if( bytes_to_write == write_buffer->size() ) {
|
||||
if( !file.write(write_buffer->data(), write_buffer->size()) ) {
|
||||
led_tx.on();
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user