Skip to content

handleGnssDataTask should write all available data to SD card #796

@PaulZC

Description

@PaulZC

In handleGnssDataTask, data is written from the ring buffer to the SD card in two separate 'chunks' if the data spans the end of the ring buffer:

// Reduce bytes to record if we have more then the end of the buffer
if ((sdRingBufferTail + bytesToSend) > settings.gnssHandlerBufferSize)
bytesToSend = settings.gnssHandlerBufferSize - sdRingBufferTail;

If enableARPLogging is enabled, the ARP can be written to the ubxFile in between the two chunks of GNSS data - resulting in message corruption and checksum errors.

The errors can be avoided if all the available data is written to SD card. To keep it simple, two writes are required: from sdRingBufferTail to settings.gnssHandlerBufferSize; then from the start of the buffer to dataHead.

In RTK Everywhere, I made the same change in this commit:

sparkfun/SparkFun_RTK_Everywhere_Firmware@9008125

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions