Skip to content

Commit

Permalink
docs: touchups on the soft off information for improved clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Munnich committed Nov 14, 2024
1 parent 9320271 commit 606d577
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ Here is an example for a keyboard with a GPIO pin that reads from the matrix:
};
```

Matrix inputs are triggered by pulling the specified pin high, typically by pressing some combination of switches which connects the matrix input to a matrix output.
MCU inputs are triggered by pulling the specified pin high, typically by pressing some combination of switches which connects the MCU input to an MCU output.
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Here is an example for a keyboard with a GPIO pin reused from a matrix kscan:
```

The GPIO settings should match those in the kscan, so the above would be set to `(GPIO_ACTIVE_LOW | GPIO_PULL_UP)` for a direct kscan.
The specified pin should be the MCU input pin of the switch used for waking from soft off (for a `col2row` matrix, the MCU input pins are the row pins).
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Behind the scenes, a hardware dedicated GPIO pin utilizes the [soft off behavior
hw_soft_off: hw_soft_off {
compatible = "zmk,behavior-soft-off";
#binding-cells = <0>;
split-peripheral-off-on-press; // Turn peripheral off immediately for reliability
hold-time-ms = <2000>; // Only turn off if the key is held for 2 seconds or longer.
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ We need to add another device which will be enabled only when the keyboard is go
```

The properties for the `gpio-key-wakeup-trigger` node can be found in the [appropriate configuration section](../../../config/power.md#gpio-key-wakeup-trigger).
In particular, note the `extra-gpios` property containing the MCU output pins of any keys used to wake the keyboard (for a `col2row` matrix, these are your columns).
10 changes: 10 additions & 0 deletions docs/docs/keymaps/behaviors/soft-off.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,13 @@ By default, the keyboard will be turned off as soon as the key bound to the beha
};
};
```

The peripheral half of a [split keyboard](../../features/split-keyboards.md) will always enter the soft off state immediately when triggering the behavior, regardless of the `hold-time-ms` setting. This is to ensure reliability, as otherwise the central may enter the soft off state before notifying the peripheral that it should also do so.

If you wish to change this setting, and thus accept the potential for reliability issues, you may remove the `split-peripheral-off-on-press` flag from the behavior:

```dts
&soft_off {
/delete-property/ split-peripheral-off-on-press;
};
```

0 comments on commit 606d577

Please sign in to comment.