Skip to content

Commit

Permalink
fix(bt): Fix BT tests after soft off work.
Browse files Browse the repository at this point in the history
* Move to explicit enable of `ZMK_PM_SOFT_OFF` to turn
  on the feature and use the behaviors, which matches
  how other features work, and helps with split and
  testing schemes.
  • Loading branch information
petejohanson committed Dec 9, 2023
1 parent d2d0fec commit cf270be
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 1 addition & 2 deletions app/Kconfig.behaviors
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ config ZMK_BEHAVIOR_MOUSE_KEY_PRESS
config ZMK_BEHAVIOR_SOFT_OFF
bool
default y
select ZMK_PM_SOFT_OFF
depends on DT_HAS_ZMK_BEHAVIOR_SOFT_OFF_ENABLED
depends on DT_HAS_ZMK_BEHAVIOR_SOFT_OFF_ENABLED && ZMK_PM_SOFT_OFF

config ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON
bool
Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/zmk_uno/boards/nrf52840dk_nrf52840.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_ZMK_PM_SOFT_OFF=y
3 changes: 2 additions & 1 deletion app/dts/behaviors/soft_off.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

/ {
behaviors {
soft_off: soft_off {
/omit-if-no-ref/ soft_off: soft_off {
compatible = "zmk,behavior-soft-off";
label = "SOFTOFF";
#binding-cells = <0>;
};
};
Expand Down
12 changes: 12 additions & 0 deletions docs/docs/config/power.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/
| `CONFIG_ZMK_SLEEP` | bool | Enable deep sleep support | n |
| `CONFIG_ZMK_IDLE_SLEEP_TIMEOUT` | int | Milliseconds of inactivity before entering deep sleep | 900000 |

## Soft Off

The [soft off feature](../features/soft-off.md) allows turning the keyboard on/off from either dedicated hardware of using the [`&soft_off` behavior](../behaviors/soft-off.md) to turn off and a reset button to turn back on again.

### Kconfig

Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)

| Config | Type | Description | Default |
| ------------------------ | ---- | ------------------------------------------------------------------- | ------- |
| `CONFIG_ZMK_PM_SOFT_OFF` | bool | Enable soft off functionality from the keymap of dedicated hardware | n |

## External Power Control

Driver for enabling or disabling power to peripherals such as displays and lighting. This driver must be configured to use [power management behaviors](../behaviors/power.md).
Expand Down

0 comments on commit cf270be

Please sign in to comment.