rdmenezes / qmast

Automatically exported from code.google.com/p/qmast
0 stars 0 forks source link

Serial data roll-over is broken #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem? 
1. Run alpha5 with compass plugged in properly.
2. When the serial buffer is emptied to the number of characters that were 
there at the beginning, data is rolled around to the next time, and more bytes 
are appended at it's end

What is the expected output? What do you see instead?
1. We see 0's in extraWindDataArray instead of the data that is supposed to be 
copied in from extraWindDataArray[i] = array[i]
2. array[0] is $, while extraWindDataArray[0] is '\0'

Suggestions on how this should be fixed?
1. Memory problem (ie arduino out of memory)? problem with j counter variable? 
Problem with declaration of array?
2. Have temporarily hooked up motor and added delay; this wont be a suitable 
patch when we're trying to sail though
3. perhaps remove the serial buffer roll-over functionality, and instead empty 
ALL data from the buffer (ie while (available) {process data}, buffer will 
probably finish on end of code lines if we do it this way)

There's a comment in the code: this is the part where the data is being messed 
up; extraWindDataArray isn't saving useful data, just 0's. Memory issue??? 

Patch/fix: add in delay, so that partial data never wraps around and data is 
disgarded instead!

Original issue reported on code.google.com by cdmblair@gmail.com on 29 Jan 2011 at 3:19

GoogleCodeExporter commented 9 years ago
We've avoided this issue for now by switching to sample mode for serial data 
(only send data when we request it). Also, I fixed the for loop that stored the 
data, so this SHOULD be working now (has not yet been tested). Testing will be 
required if we switch back to run mode.

Original comment by cdmblair@gmail.com on 8 Mar 2011 at 2:13

GoogleCodeExporter commented 9 years ago
Seems to be fixed now.

Original comment by laszloka...@gmail.com on 24 Jun 2011 at 1:21