From a04c5995420c6d389c09a62c01e1eb1d7ec3674b Mon Sep 17 00:00:00 2001 From: Kurtis Lew Date: Tue, 17 May 2022 15:28:28 -0700 Subject: [PATCH] Address review by @petejohanson - Update hardware testing section - Add note to update app/dts/behaviors.dtsi Co-Authored-By: Pete Johanson --- docs/docs/development/new-behavior.md | 31 +++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/docs/development/new-behavior.md b/docs/docs/development/new-behavior.md index 56bf07a7..13e7df70 100644 --- a/docs/docs/development/new-behavior.md +++ b/docs/docs/development/new-behavior.md @@ -355,7 +355,7 @@ For behaviors that do not require central locality, the following options for up For the purpose of this section, we will discuss the structure of `app/dts/behaviors/gresc.dtsi` below. -``` +```dtsi title="app/dts/behaviors/gresc.dtsi" /* * Copyright (c) 2020 The ZMK Contributors * @@ -379,12 +379,39 @@ For the purpose of this section, we will discuss the structure of `app/dts/behav The format of a behavior's `.dtsi` file is identical to declaring an instance of the behavior in a user's keymap. The only major difference is that the value `/omit-if-no-ref/` should be placed adjacent to the name of the behavior, as seen in line 11 of the `gresc` example. +After creating the `.dtsi` from above, update `app/dts/behaviors.dtsi` to include your newly predefined behavior instance, making it accessible by the devicetree. + +```dtsi title="app/dts/behaviors.dtsi" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// highlight-next-line +#include +``` + ## Testing changes locally Create a new folder in `app/tests/` to develop virtual test sets for all common use cases of the behavior. Behaviors should be tested thoroughly on both virtual testing environments using `west test` and real hardware. :::note -Zephyr currently does not support logging over Bluetooth, so any use of the serial monitor for hardware testing must be done over USB. +Zephyr currently does not support logging over Bluetooth, so any use of the serial monitor for hardware testing must be done over hardware UART or USB virtual UART. ::: :::info