Open dmcomm opened 2 years ago
I was originally thinking that this was something to blanket change. However, after looking at examples, I see that the behavior as-is is useful if you are trying to sample a PWM signal that varies pulse length. You can set maxlen=2 and read pulse 0 continuously to see how it is varying.
So, you are right that this should be a new kwarg (maybe called pause_on_overflow
) that adds in the auto-pause.
Currently it overwrites the oldest pulse lengths when full. In many cases, this means the result is invalid and needs to be discarded. For some uses, we could instead get something useful by decoding the beginning of the transmission. So I'm suggesting an option to make it pause when full instead of overwriting.