mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 23:39:37 -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());
|
const auto bytes_to_write = stream.read(write_buffer->data(), write_buffer->size());
|
||||||
|
|
||||||
if( bytes_to_write ) {
|
if( bytes_to_write == write_buffer->size() ) {
|
||||||
if( !file.write(write_buffer->data(), bytes_to_write) ) {
|
if( !file.write(write_buffer->data(), write_buffer->size()) ) {
|
||||||
led_tx.on();
|
led_tx.on();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user