refactor: Use kscan directly to wake when we can.

* When adding a dedicated GPIO pin for soft off/on, use the direct
  kscan as the waker, instead of adding an additional node.
This commit is contained in:
Peter Johanson
2024-03-25 01:47:11 -07:00
committed by Pete Johanson
parent 2df6dcd973
commit d0e0ecb4e3
2 changed files with 63 additions and 54 deletions

View File

@@ -42,24 +42,10 @@ encoder: &qdec0 {
};
};
wakeup_source: wakeup_source {
compatible = "zmk,gpio-key-wakeup-trigger";
status = "okay";
trigger = <&button0>;
wakeup-source;
};
soft_off_wakers {
compatible = "zmk,soft-off-wakeup-sources";
status = "okay";
wakeup-sources = <&wakeup_source>;
};
soft_off_direct_kscan: soft_off_direct_kscan {
compatible = "zmk,kscan-gpio-direct";
input-keys = <&button0>;
wakeup-source;
};
soft_off_sideband_behaviors {
@@ -72,4 +58,10 @@ encoder: &qdec0 {
};
};
soft_off_wakers {
compatible = "zmk,soft-off-wakeup-sources";
status = "okay";
wakeup-sources = <&soft_off_direct_kscan>;
};
};