The default `onSetup` will call `.begin`, to support initializing plugins using
the V1 plugins while using `KALEIDOSCOPE_INIT_PLUGINS`. However, plugins that
implement a compatibility layer so that they can be used with both the new API,
and with `Kaleidoscope.use()` will have a `.begin` method too. Which the default
`onSetup` will call, and we'll register the compatibility layer too, in addition
to the new-style event handlers. This results in many things running twice,
which leads to all kinds of problems.
For this reason, override `onSetup`, so that it does not call `begin`. When used
with `Kaleidoscope.use()`, the plugin will still work, so compatibility is
maintained. But the bug is now gone.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Use `Kaleidoscope.use`, `Kaleidoscope.useEventHandlerHook`, and
`Kaleidoscope.useLoopHook` instead of `USE_PLUGINS`, `event_handler_hook_use`,
and `loop_hook_use`, which are getting deprecated.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Instead of calculating the time delta every time we want to check if the
timer elapsed, calculate the projected ending time at the start, and
compare against that.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
As loop counters are not a reliable substitute for timers, because they are
unreliable, use proper timers instead.
Fixes#3.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
If we find a partial match, do not abort, but continue until we either find a
full match, a mismatch, or until we time out. This make it possible to have gaps
in the sequence, where a partial sequence has no explicit handler.
Fixes#1.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>