From 39b78aa2eb4244260a7722e8064283ecba37482b Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 23 Mar 2010 14:44:02 +0000 Subject: [PATCH] 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. --- src/reefnet_sensusultra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reefnet_sensusultra.c b/src/reefnet_sensusultra.c index ba4f5f3..63bb13f 100644 --- a/src/reefnet_sensusultra.c +++ b/src/reefnet_sensusultra.c @@ -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.