Skip to content

Commit

Permalink
Add soft off behavior & define wakeup source
Browse files Browse the repository at this point in the history
  • Loading branch information
qysp committed Jul 20, 2024
1 parent 65a5bf9 commit a492d93
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
5 changes: 3 additions & 2 deletions config/boards/shields/corne/corne.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y
# CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y

# Enable deep sleep (90 min)
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=4500000
# CONFIG_ZMK_SLEEP=y
# CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=5400000
CONFIG_ZMK_PM_SOFT_OFF=y

# Enable eager debouncing
CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=1
Expand Down
12 changes: 8 additions & 4 deletions config/boards/shields/corne/corne.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
continue-list = <UNDERSCORE MINUS BSPC DEL N1 N2 N3 N4 N5 N6 N7 N8 N9 N0>;
};

&soft_off {
hold-time-ms = <3000>;
};

/ {
combos {
compatible = "zmk,combos";
Expand Down Expand Up @@ -83,10 +87,10 @@

layer_adjustment {
bindings = <
&none &none &kp C_VOL_DN &kp C_MUTE &kp C_VOL_UP &none &none &none &none &none &none &tog COLEMAK
&none &none &kp C_PREV &kp C_PP &kp C_NEXT &none &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4
&none &none &none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none
&soft_off &none &kp C_VOL_DN &kp C_MUTE &kp C_VOL_UP &none &none &none &none &none &none &tog COLEMAK
&none &none &kp C_PREV &kp C_PP &kp C_NEXT &none &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4
&none &none &none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none
>;
};
};
Expand Down
1 change: 1 addition & 0 deletions config/boards/shields/corne/corne_peripheral_left.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

&kscan0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

col-gpios
= <&pro_micro 21 GPIO_ACTIVE_HIGH>
Expand Down
1 change: 1 addition & 0 deletions config/boards/shields/corne/corne_peripheral_right.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

&kscan0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

col-gpios
= <&pro_micro 14 GPIO_ACTIVE_HIGH>
Expand Down

0 comments on commit a492d93

Please sign in to comment.