From 523ae83b2e7ea51ccd9513b362d224b47c905511 Mon Sep 17 00:00:00 2001 From: Kurtis Lew Date: Tue, 17 May 2022 22:32:24 -0700 Subject: [PATCH] Add documentation for DT_INST_FOREACH_STATUS_OKAY(KP_INST) --- docs/docs/development/new-behavior.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docs/development/new-behavior.md b/docs/docs/development/new-behavior.md index 13e7df70..5548d9de 100644 --- a/docs/docs/development/new-behavior.md +++ b/docs/docs/development/new-behavior.md @@ -269,9 +269,11 @@ An example of this can be seen below, taking the `#define KP_INST(n)` from the h DEVICE_DT_INST_DEFINE(n, behavior_hold_tap_init, NULL, NULL, &behavior_hold_tap_config_##n, \ APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \ &behavior_hold_tap_driver_api); + +DT_INST_FOREACH_STATUS_OKAY(KP_INST) ``` -Note that in the hold-tap example, the instance number, `0`, has been replaced by `n`, signifying the uniqueness of each instance of a behavior. +Note that in the hold-tap example, the instance number, `0`, has been replaced by `n`, signifying the uniqueness of each instance of a behavior. Furthermore, the line `DT_INST_FOREACH_STATUS_OKAY(KP_INST)` has been added as a form of error-checking for each defined instance. Behaviors also require the following parameters of `DEVICE_DT_INST_DEFINE` to be changed: