Wrong number of FADC250 samples, when sample count is odd
In some mode 10 FADC250 data I am looking at, each set of samples starts with 0xAF, indicating 175 samples. This is followed by 88 sample pairs. The last pair is "0x2142000". Bit 13 is on, indicating that the second sample of the last sample pair is invalid, as it should be because there are supposed to be 175, not 176 samples. However, Fadc250Module seems not to catch this so it records 176 samples, with the last sample being zero.
It looks like the code tries to detect this condition, but the code doesn't look right.
"if((sample_1 + 2) fadc_data.win_width && invalid_2) break; // Skip last sample if flagged as invalid"
appears twice. It looks like sample_1 is supposed to be some kind of sample count. But sample_1 is a data value. It should look something like:
if((numberofsamplessofarfadc_data.win_width) && invalid_2) break;