diff options
author | Pete Johanson <peter@peterjohanson.com> | 2021-01-18 00:35:56 -0500 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2021-01-20 07:06:11 -0500 |
commit | 3fe2acc2d191006fa6309191ee99b2e4e249ed08 (patch) | |
tree | 4994508fdc58daee4629c671e07e689b6332bd32 /app/src/display/main.c | |
parent | 003db892adadb7b760f43411d7154fe60bf3556d (diff) |
refactor(core): Extra event payloads to own types, refactor API.
* Make it easier to use *just* event payloads by defining the data,
and then having event manager macros generate "wrapper structs"
* Improve is_*/cast_* APIs to hide details of full event struct.
* Create `zmk_event_t` typedef to pass to event handlers.
* Bring event names inline w/ consistent `zmk_` prefix.
Diffstat (limited to 'app/src/display/main.c')
-rw-r--r-- | app/src/display/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/display/main.c b/app/src/display/main.c index 0bef656..90789f9 100644 --- a/app/src/display/main.c +++ b/app/src/display/main.c @@ -75,8 +75,8 @@ int zmk_display_init() { return 0; } -int display_event_handler(const struct zmk_event_header *eh) { - struct activity_state_changed *ev = cast_activity_state_changed(eh); +int display_event_handler(const zmk_event_t *eh) { + struct zmk_activity_state_changed *ev = cast_zmk_activity_state_changed(eh); switch (ev->state) { case ZMK_ACTIVITY_ACTIVE: start_display_updates(); @@ -93,4 +93,4 @@ int display_event_handler(const struct zmk_event_header *eh) { } ZMK_LISTENER(display, display_event_handler); -ZMK_SUBSCRIPTION(display, activity_state_changed);
\ No newline at end of file +ZMK_SUBSCRIPTION(display, zmk_activity_state_changed);
\ No newline at end of file |