feat(core): Support adding subs to other listeners.

* Used for ZMK Studio event remappers to be sure the one
  RPC event listener subscribes to their mapped events.
This commit is contained in:
Peter Johanson 2024-03-27 22:17:32 +00:00 committed by Pete Johanson
parent 49f7275beb
commit b576d52d58

View file

@ -64,6 +64,7 @@ struct zmk_event_subscription {
#define ZMK_LISTENER(mod, cb) const struct zmk_listener zmk_listener_##mod = {.callback = cb};
#define ZMK_SUBSCRIPTION(mod, ev_type) \
extern const struct zmk_listener zmk_listener_##mod; \
const Z_DECL_ALIGN(struct zmk_event_subscription) \
_CONCAT(_CONCAT(zmk_event_sub_, mod), ev_type) __used \
__attribute__((__section__(".event_subscription"))) = { \