You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code example with BEHAVIOR_DT_INST_DEFINE(0, ... shows how to create a behavior that only supports one instance. It includes a comment that implies that simply switching 0 to n will add support for multiple instances, but this is incorrect. The correct structure for such a behavior is
We could either make this the only example, then describe how to simplify it if your behavior only supports one instance, or we could have examples of both formats (though having two examples could be more confusing and harder to maintain).
The text was updated successfully, but these errors were encountered:
Some of the example code at https://zmk.dev/docs/development/new-behavior#creating-the-driver-c is either outdated or incomplete. The following issues should be fixed:
#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT)
in the C file should be replaced withBEHAVIOR_DT_INST_DEFINE(0, ...
shows how to create a behavior that only supports one instance. It includes a comment that implies that simply switching0
ton
will add support for multiple instances, but this is incorrect. The correct structure for such a behavior isThe text was updated successfully, but these errors were encountered: