flysight/flysight — pull request #35 by crwper (2014-04-30 15:33:57+00:00)
Title: Changed to while loop in UBX byte handling

Changed to handle bytes from u-blox module using while loop instead of one at a time. This reduces latency and prevents buffer overflows.

However, this also makes timing of writing to the log a bit tighter, so I've added a two element ring buffer for "saved" UBX data. In testing, this results in zero errors in the log over a period of 8.5 hours.

One issue remains... Occasionally we get a buffer overrun in the audio ring buffer. With the present firmware, these occur only when there is a delay of greater than 16 ms in reading from the buffer--possibly because of cluster boundaries. These delays never seem to be longer than 32 ms, so in principle we could eliminate audio problems by doubling the size of the audio ring buffer. However, with the current firmware there is not enough free RAM to do this.