Allow the first page to be empty.
When the Sensus Ultra reaches the end of a memory page while recording data, the next page is erased to all 0xFF, and the current page cursor is advanced. With this memory usage scheme, the last page will be empty if the previous one was just filled.
This commit is contained in:
parent
fe511a774c
commit
39b78aa2eb
@ -749,7 +749,7 @@ reefnet_sensusultra_device_foreach (device_t *abstract, dive_callback_t callback
|
||||
device_event_emit (abstract, DEVICE_EVENT_PROGRESS, &progress);
|
||||
|
||||
// Abort the transfer if the page contains no useful data.
|
||||
if (array_isequal (packet + 2, REEFNET_SENSUSULTRA_PACKET_SIZE, 0xFF))
|
||||
if (array_isequal (packet + 2, REEFNET_SENSUSULTRA_PACKET_SIZE, 0xFF) && nbytes != 0)
|
||||
break;
|
||||
|
||||
// Prepend the packet to the buffer.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user