You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do not have a daisy board to test anything, but I noticed this reading the code:
firstDataPacket, initialized to true, is cleared to false at the end of updateBoardData(). It is then checked if false which it always will be because it was just set, data that hasn't been read yet is backed up, and the flag is re-cleared to false if true which will never happen because it has just been set to false, in updateDaisyData(). It looks like this would result in the first sample being corrupt.
It looks like the clearing of firstDataPacket should be moved out of the individual channel update functions here and here and into the end of updateChannelData which calls them both, right here.
After this change, though, it still looks like the first sample sent would still be corrupt, because meanDaisyChannelDataRaw is not specified in the first sample. One solution would be to add an else { } block here containing code that would fill meanDaisyChannelDataRaw with the contents of daisyChannelDataRaw without any averaging.
If one were to address this area of code more thoroughly, there is an additional possible 'issue' which is that the daisy and board running averages are sampled when output, alternatingly, so there is no way to reconstruct from the output a complete 'snapshot' at any point of time -- the daisy information represents time = (x+1/2), and the board information represents time = (x-1/2). A different approach would be to change the logical flow to output briefly buffered averages from the past that are both taken from the same points in time.
The text was updated successfully, but these errors were encountered:
I do not have a daisy board to test anything, but I noticed this reading the code:
firstDataPacket
, initialized totrue
, is cleared to false at the end ofupdateBoardData()
. It is then checked if false which it always will be because it was just set, data that hasn't been read yet is backed up, and the flag is re-cleared to false if true which will never happen because it has just been set to false, inupdateDaisyData()
. It looks like this would result in the first sample being corrupt.It looks like the clearing of
firstDataPacket
should be moved out of the individual channel update functions here and here and into the end of updateChannelData which calls them both, right here.After this change, though, it still looks like the first sample sent would still be corrupt, because
meanDaisyChannelDataRaw
is not specified in the first sample. One solution would be to add anelse { }
block here containing code that would fillmeanDaisyChannelDataRaw
with the contents ofdaisyChannelDataRaw
without any averaging.If one were to address this area of code more thoroughly, there is an additional possible 'issue' which is that the daisy and board running averages are sampled when output, alternatingly, so there is no way to reconstruct from the output a complete 'snapshot' at any point of time -- the daisy information represents time = (x+1/2), and the board information represents time = (x-1/2). A different approach would be to change the logical flow to output briefly buffered averages from the past that are both taken from the same points in time.
The text was updated successfully, but these errors were encountered: