Closed andrewda closed 5 years ago
Thanks for making these PRs! I've been meaning to do this but I haven't been able to find the time.
I think it would be better to process events on the main thread, because if Events.process()
is called immediately after each DS packet, it helps to minimize the latency of button-triggered events. We could probably have events processing by putting a timeout on ds.waitForData()
, checking for DS connection, or some combination of the two.
That makes sense. Timeout of 0.02s sound good?
I merged this into #23 because they need to go hand-in-hand.
This ensures events are always processed, even when the driver station is disconnected. I'll give this a test in a couple hours and make sure it works as expected.
@tylerscheuble -- I forgot exactly what you had suggested when we chatted at Clackamas, but I believe this should work. If you have any suggestions on how this could be done better, let me know.