m2k: signal generator infinite loop bug fix#1948
Conversation
|
|
||
| // for size 0 return 0 going further with this value will get stuck in an infinite loop | ||
| if(size == 0) { | ||
| return 0; |
There was a problem hiding this comment.
I think we should disable the Run button in this case.
What happens here is the the SigGen does not output anything, but the Run button is checked, suggesting that data is in fact generated on the DAC, which is not the case..
There was a problem hiding this comment.
I've added some changes so the run button would be disabled for situations where the values used for Math signals sample rate and record length would not combine to provide a correct value
3e80660 to
cb57263
Compare
|
There are still some corner cases that are not handled in this PR. If we set the sample rate to 1sps and increase the record length until you manage to press Run (you need a record len of 1s). Press Run and then decrease the record length. The Run button is only greyed out but didn't change from "Stop" to "Run". |
Signed-off-by: IonutMuthi <ionut.muthi@analog.com>
461deea to
bb112ac
Compare
For small sps values on math channel the function "get_samples_count" will get stuck in an infinite loop due to size value reaching 0 before attempting "size <<=1 "