This adds a new `handle_user_key_event` function, that will get called before anything else, and can override what happens. If it returns true, the event will not be processed further by the firmware. By default, this function returns false, and is a no-op. It is defined with a `weak` attribute, to let the linker know that any other function with the same name should override his one. This makes it possible to have another version of this function in a firmware Sketch, and override the behaviour, to extend the event handling. This is the foundation that allows it to use external libraries, and tap into the firmware's event handler, to add new stuff. (We can already hook into the main loop by changing the top `loop` function in the Sketch) This addresses #21 for the most part. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>pull/21/head
parent
771c0de247
commit
f3c9d328ba
Loading…
Reference in new issue