Am 09/25/13, schrieb Niklas Hauser <niklas.hauser@rwth-aachen.de>:
This is how xpcc::ui::ButtonGroup works, where you only call the update() method every ~10ms or so. This is also how all the I2C drivers work, where the internal state machine is truly asynchronous, since it polls the hardware for its (buffered) status.
I would suggest changing behavior of ButtonGroup enabling calling at arbitary frequency or changing the method name to something else, but run or update. Thats our cooperative multi threading concept which introduces methods update as well as run which mean they should be called as often you can. Maybe we can eliminate one of the notations. (Keep run, kill update?) By the way in our robots there are differences in run and update as i introduced recently (see description somewhere in drive code or in one of a commit message of mine). Here we have multiple threads which are called from main loop and from interrupts. run is mostly used as the interrupt thread and update as main loop thread. I've tried to separate notations to indicate potential race conditions. But this should not be considered in xpcc. Georgi