-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor!: Remove deprecated label property #2028
Commits on Dec 5, 2023
-
refactor(behaviors): Make label property optional
Changed all code (except for layer names) which used the label property to use DEVICE_DT_NAME() instead, which uses the label if set or falls back to the full node name. This matches how Zephyr determines the node names used with device_get_binding() and allows us to start removing the deprecated label property from things.
Configuration menu - View commit details
-
Copy full SHA for 16fa8e9 - Browse repository at this point
Copy the full SHA 16fa8e9View commit details -
refactor(ext_power): Remove label property
Changed the label property on zmk,ext-power-generic to be optional and removed it from existing uses. Renamed the nodes for all non-development boards to "EXT_POWER" to preserve user settings. rgb_underglow.c now finds the correct device by finding the first instance of zmk,ext-power-generic instead of looking for a node named "EXT_POWER".
Configuration menu - View commit details
-
Copy full SHA for 55b2554 - Browse repository at this point
Copy the full SHA 55b2554View commit details -
Configuration menu - View commit details
-
Copy full SHA for 47f71b9 - Browse repository at this point
Copy the full SHA 47f71b9View commit details -
refactor: Remove unimportant labels
Removed "label" properties which no longer have any function. Labels are still used as layer names and as identifiers for sending behaviors between sides of a split keyboard, so those have been left alone for now.
Configuration menu - View commit details
-
Copy full SHA for fe0def3 - Browse repository at this point
Copy the full SHA fe0def3View commit details -
refactor(keymaps): Rename layer label to "display-name"
Changed the property used to define a layer name for displays from "label" (which affects other things in Zephyr and is deprecated) to "display-name". (It cannot be named simply "name", because that has special meaning in newer versions of the devicetree compiler.) "label" is still supported as a fallback, so no changes need to be made to existing keymaps.
Configuration menu - View commit details
-
Copy full SHA for 0dd7e03 - Browse repository at this point
Copy the full SHA 0dd7e03View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4089546 - Browse repository at this point
Copy the full SHA 4089546View commit details -
refactor(behaviors): Create a list to lookup behaviors
Added BEHAVIOR_DT_DEFINE() and BEHAVIOR_DT_INST_DEFINE(), which work exactly like the DEVICE_*_DEFINE() macros, except they also register the device as a behavior by adding a pointer to it to a memory section. Added zmk_behavior_get_binding(), which works like device_get_binding() except that it only searches the devices that have been registered as behaviors. This ensures that behaviors cannot have name collisions with other devices defined by the SoC, which will be important when we remove the label property from behaviors so they are given their node names. As an added benefit, this is faster since it searches a smaller list. Some basic benchmark code I wrote indicates it takes 30-70% as long, depending on where the behavior is in the list and whether the name string is an exact pointer match. From now on, behaviors should use BEHAVIOR_*_DEFINe() instead of DEVICE_*_DEFINE(), and any code that looks up a behavior by name should use zmk_behavior_get_binding() instead of device_get_binding().
Configuration menu - View commit details
-
Copy full SHA for e7a7b61 - Browse repository at this point
Copy the full SHA e7a7b61View commit details -
refactor(behaviors)!: Remove labels from behaviors
Removed the label property from built-in behaviors, custom behaviors defined in a few keymaps, and macros generated with ZMK_MACRO(). Now that node names are used to identify behaviors, and names only need to be unique within the set of behaviors, the names of all behaviors have been shortened to be similar to their original labels. This means that any keymaps which reference behavior nodes by name instead of by label will need to be updated. Keymaps typically use the labels though, so most keymaps should be unaffected by this change.
Configuration menu - View commit details
-
Copy full SHA for ff206ac - Browse repository at this point
Copy the full SHA ff206acView commit details -
docs: Document behavior name length limit
Added a section to the new behavior guide to document that the names of behaviors invoked on the peripheral side of a split must be at most 8 characters long.
Configuration menu - View commit details
-
Copy full SHA for bec41db - Browse repository at this point
Copy the full SHA bec41dbView commit details -
refactor: Remove new uses of label property
Removed new uses of the "label" property which were introduced after the previous commits on this branch were written.
Configuration menu - View commit details
-
Copy full SHA for 076fa0a - Browse repository at this point
Copy the full SHA 076fa0aView commit details