From 6475009da9baad358302fbff3db7d88d63f9ce50 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 28 Aug 2020 20:36:28 -0700 Subject: Added encoder and changed BT unpair keys in overlays --- app/boards/shields/lily58/lily58_left.overlay | 6 +++++- app/boards/shields/lily58/lily58_right.overlay | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/boards/shields/lily58/lily58_left.overlay b/app/boards/shields/lily58/lily58_left.overlay index c6f630f..1752b6e 100644 --- a/app/boards/shields/lily58/lily58_left.overlay +++ b/app/boards/shields/lily58/lily58_left.overlay @@ -17,6 +17,10 @@ ; }; +&left_encoder { + status = "okay"; +}; + &bt_unpair_combo { - key-positions = <0 42>; + key-positions = <0 53>; }; diff --git a/app/boards/shields/lily58/lily58_right.overlay b/app/boards/shields/lily58/lily58_right.overlay index 84f0b06..6c8e493 100644 --- a/app/boards/shields/lily58/lily58_right.overlay +++ b/app/boards/shields/lily58/lily58_right.overlay @@ -22,5 +22,5 @@ }; &bt_unpair_combo { - key-positions = <11 43>; + key-positions = <11 54>; }; -- cgit v1.2.3 From e616fc2c8124a98e2abe2279d952783ea98b5cd5 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 28 Aug 2020 20:36:43 -0700 Subject: Added left encoder support --- app/.gitignore | 3 +++ app/boards/shields/lily58/lily58.conf | 4 ++++ app/boards/shields/lily58/lily58.dtsi | 14 +++++++++++ app/boards/shields/lily58/lily58.keymap | 42 +++++++++++++++++++-------------- 4 files changed, 45 insertions(+), 18 deletions(-) (limited to 'app') diff --git a/app/.gitignore b/app/.gitignore index 567609b..73a4457 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1 +1,4 @@ build/ +build_left.bat +flash.bat +prj.conf \ No newline at end of file diff --git a/app/boards/shields/lily58/lily58.conf b/app/boards/shields/lily58/lily58.conf index 73f0d9d..14c1841 100644 --- a/app/boards/shields/lily58/lily58.conf +++ b/app/boards/shields/lily58/lily58.conf @@ -1,2 +1,6 @@ +# Enable encoder +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y + # Uncomment the following line to enable the Lily58 OLED Display # CONFIG_ZMK_DISPLAY=y diff --git a/app/boards/shields/lily58/lily58.dtsi b/app/boards/shields/lily58/lily58.dtsi index 23f5644..aea36c8 100644 --- a/app/boards/shields/lily58/lily58.dtsi +++ b/app/boards/shields/lily58/lily58.dtsi @@ -45,6 +45,20 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7) }; + left_encoder: encoder_left { + compatible = "alps,ec11"; + label = "LEFT_ENCODER"; + a-gpios = <&pro_micro_a 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro_a 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <4>; + status = "disabled"; + }; + + sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder>; + }; + bt_unpair_combo: bt_unpair_combo { compatible = "zmk,bt-unpair-combo"; }; diff --git a/app/boards/shields/lily58/lily58.keymap b/app/boards/shields/lily58/lily58.keymap index 71bf4ad..590d7b6 100644 --- a/app/boards/shields/lily58/lily58.keymap +++ b/app/boards/shields/lily58/lily58.keymap @@ -16,41 +16,47 @@ &kp ESC &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &kp GRAV &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp MINUS &kp LCTL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT -&kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp LBKT &kp RBKT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RSFT - &kp LALT &kp LGUI &mo 1 &kp SPC &kp RET &mo 2 &kp BKSP &kp RGUI +&kp LSFT &kp Z &kp X &kp C &kp V &kp B &cp M_PLAY &kp DEL &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RSFT + &kp LGUI &kp LALT &kp BKSP &mo 1 &mo 2 &kp SPC &kp RET &kp RGUI >; + + sensor-bindings = <&inc_dec_cp LBKT RBKT>; }; lower_layer { // ------------------------------------------------------------------------------------------------------------ // | | | | | | | | | | | | | | -// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | -// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ | -// | | | | | | | | | | | _ | + | { | } | "|" | +// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | +// | F1 | F2 | F3 | F4 | F5 | F6 | | | <- | ^ | v | -> | | +// | F7 | F8 | F9 | F10 | F11 | F12 | | | | + | - | = | [ | ] | \ | // | | | | | | | | | | bindings = < -&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans -&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 -&kp GRAV &kp BANG &kp ATSN &kp HASH &kp CURU &kp PRCT &kp CRRT &kp AMPS &kp KMLT &kp LPRN &kp RPRN &kp TILD -&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp MINUS &kp KPLS &kp LCUR &kp RCUR &kp PIPE - &trans &trans &trans &trans &trans &trans &trans &trans +&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 +&trans &kp LCUR &kp AMPS &kp KMLT &kp LPRN &kp RCUR &trans &trans &trans &trans &trans &kp F12 +&trans &kp COLN &kp CURU &kp PRCT &kp CRRT &kp KPLS &kp CLCK &kp LARW &kp DARW &kp UARW &kp RARW &trans +&trans &kp GRAV &kp BANG &kp ATSN &kp HASH &kp PIPE &trans &trans &kp INS &kp HOME &kp PGDN &kp PGUP &kp END &trans + &kp LPRN &kp RPRN &trans &trans &trans &trans &trans &trans >; + + sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD>; }; raise_layer { // ------------------------------------------------------------------------------------------------------------ // | | | | | | | | | | | | | | -// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | -// | F1 | F2 | F3 | F4 | F5 | F6 | | | <- | ^ | v | -> | | -// | F7 | F8 | F9 | F10 | F11 | F12 | | | | + | - | = | [ | ] | \ | +// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | +// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ | +// | | | | | | | | | | | _ | + | { | } | "|" | // | | | | | | | | | | bindings = < -&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans -&kp GRAV &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &trans -&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &trans &kp LARW &kp DARW &kp UARW &kp RARW &trans -&kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &trans &kp KPLS &kp MINUS &kp EQL &kp LBKT &kp RBKT &kp BSLH - &trans &trans &trans &trans &trans &trans &trans &trans +&trans &tog 2 &kp KPLS &kp KDIV &kp KMLT &kp KMIN &trans &trans &trans &trans &trans &trans +&trans &kp LBKT &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp RBKT &trans &trans &trans &trans &trans &trans +&trans &kp SCLN &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp EQL &trans &cp M_PREV &cp M_VOLD &cp M_VOLU &cp M_NEXT &trans +&trans &kp TILD &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp BSLH &trans &trans &cp M_STOP &cp M_PLAY &cp M_MUTE &trans &trans &trans + &kp NUM_0 &kp DOT &kp RET &trans &trans &trans &trans &trans >; + + sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD>; }; }; }; -- cgit v1.2.3 From 8b38193ec206505e6e493a7d7bb88010b57af7b3 Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 28 Aug 2020 23:33:29 -0700 Subject: Removed status line --- app/boards/shields/lily58/lily58.dtsi | 1 - 1 file changed, 1 deletion(-) (limited to 'app') diff --git a/app/boards/shields/lily58/lily58.dtsi b/app/boards/shields/lily58/lily58.dtsi index aea36c8..556909f 100644 --- a/app/boards/shields/lily58/lily58.dtsi +++ b/app/boards/shields/lily58/lily58.dtsi @@ -51,7 +51,6 @@ RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,5) RC(4,6) RC(3,6) RC(3,7) a-gpios = <&pro_micro_a 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; b-gpios = <&pro_micro_a 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; resolution = <4>; - status = "disabled"; }; sensors { -- cgit v1.2.3 From d69c94a183f3f91bddde2f1cc9dcf28db418ebac Mon Sep 17 00:00:00 2001 From: Kevin Date: Fri, 28 Aug 2020 23:43:41 -0700 Subject: Added helper scrpits and config file --- app/.gitignore | 5 +---- app/build_left.bat | 1 + app/flash.bat | 2 ++ app/prj.conf | 23 +++++++++++++++++++++++ 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 app/build_left.bat create mode 100644 app/flash.bat create mode 100644 app/prj.conf (limited to 'app') diff --git a/app/.gitignore b/app/.gitignore index 73a4457..d163863 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1,4 +1 @@ -build/ -build_left.bat -flash.bat -prj.conf \ No newline at end of file +build/ \ No newline at end of file diff --git a/app/build_left.bat b/app/build_left.bat new file mode 100644 index 0000000..f9d9150 --- /dev/null +++ b/app/build_left.bat @@ -0,0 +1 @@ +west build -p -- -DSHIELD=lily58_left \ No newline at end of file diff --git a/app/flash.bat b/app/flash.bat new file mode 100644 index 0000000..241b5b6 --- /dev/null +++ b/app/flash.bat @@ -0,0 +1,2 @@ +timeout 10 +copy "C:\Users\Kevin\zmk\app\build\zephyr\zmk.uf2" D: \ No newline at end of file diff --git a/app/prj.conf b/app/prj.conf new file mode 100644 index 0000000..c82fc5d --- /dev/null +++ b/app/prj.conf @@ -0,0 +1,23 @@ +# Turn on logging, and set ZMK logging to debug output +CONFIG_LOG=y +CONFIG_ZMK_LOG_LEVEL_DBG=y + +# Turn on USB CDC ACM device +CONFIG_USB=y +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_CDC_ACM=y +CONFIG_USB_CDC_ACM_RINGBUF_SIZE=1024 +CONFIG_USB_CDC_ACM_DEVICE_NAME="CDC_ACM" +CONFIG_USB_CDC_ACM_DEVICE_COUNT=1 + +# Enable serial console +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_INTERRUPT_DRIVEN=y +CONFIG_UART_LINE_CTRL=y + +# Enable USB UART, and set the console device +CONFIG_UART_CONSOLE=y +CONFIG_USB_UART_CONSOLE=y +CONFIG_UART_CONSOLE_ON_DEV_NAME="CDC_ACM_0" +CONFIG_USB_UART_DTR_WAIT=n \ No newline at end of file -- cgit v1.2.3 From 72232b4ec7ead37bf765acd16e1ea4490651260a Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 29 Aug 2020 11:36:48 -0700 Subject: Fixed encoder config and added build_right script --- app/boards/shields/lily58/lily58.keymap | 2 +- app/boards/shields/lily58/lily58_left.conf | 4 ++++ app/build_right.bat | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 app/build_right.bat (limited to 'app') diff --git a/app/boards/shields/lily58/lily58.keymap b/app/boards/shields/lily58/lily58.keymap index 590d7b6..b8d4a21 100644 --- a/app/boards/shields/lily58/lily58.keymap +++ b/app/boards/shields/lily58/lily58.keymap @@ -20,7 +20,7 @@ &kp LGUI &kp LALT &kp BKSP &mo 1 &mo 2 &kp SPC &kp RET &kp RGUI >; - sensor-bindings = <&inc_dec_cp LBKT RBKT>; + sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD>; }; lower_layer { diff --git a/app/boards/shields/lily58/lily58_left.conf b/app/boards/shields/lily58/lily58_left.conf index 1e028a7..2bd5872 100644 --- a/app/boards/shields/lily58/lily58_left.conf +++ b/app/boards/shields/lily58/lily58_left.conf @@ -1,2 +1,6 @@ +# Enable encoder +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y + CONFIG_ZMK_SPLIT=y CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y diff --git a/app/build_right.bat b/app/build_right.bat new file mode 100644 index 0000000..4fa87e0 --- /dev/null +++ b/app/build_right.bat @@ -0,0 +1 @@ +west build -p -- -DSHIELD=lily58_right \ No newline at end of file -- cgit v1.2.3 From 8b6e912d36b1e9d1a0efb09cd429714572a23e27 Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 29 Aug 2020 11:48:33 -0700 Subject: Reverted back to default keymap --- app/boards/shields/lily58/lily58.keymap | 36 +++++++++++++++--------------- app/boards/shields/lily58/lily58_left.conf | 8 +++---- 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'app') diff --git a/app/boards/shields/lily58/lily58.keymap b/app/boards/shields/lily58/lily58.keymap index b8d4a21..afd2694 100644 --- a/app/boards/shields/lily58/lily58.keymap +++ b/app/boards/shields/lily58/lily58.keymap @@ -16,8 +16,8 @@ &kp ESC &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &kp GRAV &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp MINUS &kp LCTL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SCLN &kp QUOT -&kp LSFT &kp Z &kp X &kp C &kp V &kp B &cp M_PLAY &kp DEL &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RSFT - &kp LGUI &kp LALT &kp BKSP &mo 1 &mo 2 &kp SPC &kp RET &kp RGUI +&kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp LBKT &kp RBKT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RSFT + &kp LALT &kp LGUI &mo 1 &kp SPC &kp RET &mo 2 &kp BKSP &kp RGUI >; sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD>; @@ -26,16 +26,16 @@ lower_layer { // ------------------------------------------------------------------------------------------------------------ // | | | | | | | | | | | | | | -// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | -// | F1 | F2 | F3 | F4 | F5 | F6 | | | <- | ^ | v | -> | | -// | F7 | F8 | F9 | F10 | F11 | F12 | | | | + | - | = | [ | ] | \ | +// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | +// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ | +// | | | | | | | | | | | _ | + | { | } | "|" | // | | | | | | | | | | bindings = < -&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 -&trans &kp LCUR &kp AMPS &kp KMLT &kp LPRN &kp RCUR &trans &trans &trans &trans &trans &kp F12 -&trans &kp COLN &kp CURU &kp PRCT &kp CRRT &kp KPLS &kp CLCK &kp LARW &kp DARW &kp UARW &kp RARW &trans -&trans &kp GRAV &kp BANG &kp ATSN &kp HASH &kp PIPE &trans &trans &kp INS &kp HOME &kp PGDN &kp PGUP &kp END &trans - &kp LPRN &kp RPRN &trans &trans &trans &trans &trans &trans +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 +&kp GRAV &kp BANG &kp ATSN &kp HASH &kp CURU &kp PRCT &kp CRRT &kp AMPS &kp KMLT &kp LPRN &kp RPRN &kp TILD +&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp MINUS &kp KPLS &kp LCUR &kp RCUR &kp PIPE + &trans &trans &trans &trans &trans &trans &trans &trans >; sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD>; @@ -44,16 +44,16 @@ raise_layer { // ------------------------------------------------------------------------------------------------------------ // | | | | | | | | | | | | | | -// | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | -// | ` | ! | @ | # | $ | % | | ^ | & | * | ( | ) | ~ | -// | | | | | | | | | | | _ | + | { | } | "|" | +// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | +// | F1 | F2 | F3 | F4 | F5 | F6 | | | <- | ^ | v | -> | | +// | F7 | F8 | F9 | F10 | F11 | F12 | | | | + | - | = | [ | ] | \ | // | | | | | | | | | | bindings = < -&trans &tog 2 &kp KPLS &kp KDIV &kp KMLT &kp KMIN &trans &trans &trans &trans &trans &trans -&trans &kp LBKT &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp RBKT &trans &trans &trans &trans &trans &trans -&trans &kp SCLN &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp EQL &trans &cp M_PREV &cp M_VOLD &cp M_VOLU &cp M_NEXT &trans -&trans &kp TILD &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp BSLH &trans &trans &cp M_STOP &cp M_PLAY &cp M_MUTE &trans &trans &trans - &kp NUM_0 &kp DOT &kp RET &trans &trans &trans &trans &trans +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans +&kp GRAV &kp NUM_1 &kp NUM_2 &kp NUM_3 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_0 &trans +&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &trans &kp LARW &kp DARW &kp UARW &kp RARW &trans +&kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &trans &kp KPLS &kp MINUS &kp EQL &kp LBKT &kp RBKT &kp BSLH + &trans &trans &trans &trans &trans &trans &trans &trans >; sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD>; diff --git a/app/boards/shields/lily58/lily58_left.conf b/app/boards/shields/lily58/lily58_left.conf index 2bd5872..6ff95d5 100644 --- a/app/boards/shields/lily58/lily58_left.conf +++ b/app/boards/shields/lily58/lily58_left.conf @@ -1,6 +1,6 @@ -# Enable encoder -CONFIG_EC11=y -CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y +# Uncomment to enable encoder +# CONFIG_EC11=y +# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y +CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y \ No newline at end of file -- cgit v1.2.3 From 14c05c92e973d92398d0970ad4a5dd2b9d32becd Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 29 Aug 2020 11:53:53 -0700 Subject: Removed development files --- app/.gitignore | 2 +- app/build_left.bat | 1 - app/build_right.bat | 1 - app/flash.bat | 2 -- app/prj.conf | 23 ----------------------- 5 files changed, 1 insertion(+), 28 deletions(-) delete mode 100644 app/build_left.bat delete mode 100644 app/build_right.bat delete mode 100644 app/flash.bat delete mode 100644 app/prj.conf (limited to 'app') diff --git a/app/.gitignore b/app/.gitignore index d163863..567609b 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1 +1 @@ -build/ \ No newline at end of file +build/ diff --git a/app/build_left.bat b/app/build_left.bat deleted file mode 100644 index f9d9150..0000000 --- a/app/build_left.bat +++ /dev/null @@ -1 +0,0 @@ -west build -p -- -DSHIELD=lily58_left \ No newline at end of file diff --git a/app/build_right.bat b/app/build_right.bat deleted file mode 100644 index 4fa87e0..0000000 --- a/app/build_right.bat +++ /dev/null @@ -1 +0,0 @@ -west build -p -- -DSHIELD=lily58_right \ No newline at end of file diff --git a/app/flash.bat b/app/flash.bat deleted file mode 100644 index 241b5b6..0000000 --- a/app/flash.bat +++ /dev/null @@ -1,2 +0,0 @@ -timeout 10 -copy "C:\Users\Kevin\zmk\app\build\zephyr\zmk.uf2" D: \ No newline at end of file diff --git a/app/prj.conf b/app/prj.conf deleted file mode 100644 index c82fc5d..0000000 --- a/app/prj.conf +++ /dev/null @@ -1,23 +0,0 @@ -# Turn on logging, and set ZMK logging to debug output -CONFIG_LOG=y -CONFIG_ZMK_LOG_LEVEL_DBG=y - -# Turn on USB CDC ACM device -CONFIG_USB=y -CONFIG_USB_DEVICE_STACK=y -CONFIG_USB_CDC_ACM=y -CONFIG_USB_CDC_ACM_RINGBUF_SIZE=1024 -CONFIG_USB_CDC_ACM_DEVICE_NAME="CDC_ACM" -CONFIG_USB_CDC_ACM_DEVICE_COUNT=1 - -# Enable serial console -CONFIG_SERIAL=y -CONFIG_CONSOLE=y -CONFIG_UART_INTERRUPT_DRIVEN=y -CONFIG_UART_LINE_CTRL=y - -# Enable USB UART, and set the console device -CONFIG_UART_CONSOLE=y -CONFIG_USB_UART_CONSOLE=y -CONFIG_UART_CONSOLE_ON_DEV_NAME="CDC_ACM_0" -CONFIG_USB_UART_DTR_WAIT=n \ No newline at end of file -- cgit v1.2.3 From 03319438553e68a29a8c66abc47686e0934afc71 Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 29 Aug 2020 13:48:40 -0700 Subject: Removed extra encoder config lines --- app/boards/shields/lily58/lily58.conf | 4 ---- 1 file changed, 4 deletions(-) (limited to 'app') diff --git a/app/boards/shields/lily58/lily58.conf b/app/boards/shields/lily58/lily58.conf index 14c1841..73f0d9d 100644 --- a/app/boards/shields/lily58/lily58.conf +++ b/app/boards/shields/lily58/lily58.conf @@ -1,6 +1,2 @@ -# Enable encoder -CONFIG_EC11=y -CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y - # Uncomment the following line to enable the Lily58 OLED Display # CONFIG_ZMK_DISPLAY=y -- cgit v1.2.3 From 1ffcbefd728f2b47fcbb5e4e8b117adf893f059a Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 29 Aug 2020 18:12:12 -0700 Subject: Added encoder to unified conf file --- app/boards/shields/lily58/lily58.conf | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app') diff --git a/app/boards/shields/lily58/lily58.conf b/app/boards/shields/lily58/lily58.conf index 73f0d9d..31eb7c6 100644 --- a/app/boards/shields/lily58/lily58.conf +++ b/app/boards/shields/lily58/lily58.conf @@ -1,2 +1,6 @@ +# Uncomment to enable encoder +# CONFIG_EC11=y +# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y + # Uncomment the following line to enable the Lily58 OLED Display # CONFIG_ZMK_DISPLAY=y -- cgit v1.2.3 From 21fcab208e50bf8ccbe9e238662ca86c35dab077 Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Mon, 31 Aug 2020 22:24:36 +0200 Subject: stop on fatal errors --- app/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 9fce3b6..db56c53 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -56,3 +56,5 @@ target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow.c) target_sources(app PRIVATE src/endpoints.c) target_sources(app PRIVATE src/hid_listener.c) target_sources(app PRIVATE src/main.c) + +zephyr_cc_option(-Wfatal-errors) \ No newline at end of file -- cgit v1.2.3 From 639a338c2dd6801ae8fa4d82c9d7101405b2dc7b Mon Sep 17 00:00:00 2001 From: Cody McGinnis Date: Tue, 1 Sep 2020 09:34:06 -0400 Subject: fix(core): track layer state with keypress --- app/src/keymap.c | 56 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 26 deletions(-) (limited to 'app') diff --git a/app/src/keymap.c b/app/src/keymap.c index ee6e370..57cdad6 100644 --- a/app/src/keymap.c +++ b/app/src/keymap.c @@ -51,10 +51,10 @@ static u8_t zmk_keymap_layer_default = 0; // State -// When a behavior handles a key position "down" event, we record that layer +// When a behavior handles a key position "down" event, we record the layer state // here so that even if that layer is deactivated before the "up", event, we // still send the release event to the behavior in that layer also. -static u8_t zmk_keymap_active_behavior_layer[ZMK_KEYMAP_LEN]; +static u32_t zmk_keymap_active_behavior_layer[ZMK_KEYMAP_LEN]; static struct zmk_behavior_binding zmk_keymap[ZMK_KEYMAP_LAYERS_LEN][ZMK_KEYMAP_LEN] = { DT_INST_FOREACH_CHILD(0, TRANSFORMED_LAYER) @@ -101,47 +101,51 @@ int zmk_keymap_layer_toggle(u8_t layer) return zmk_keymap_layer_activate(layer); }; -bool is_active_position(u32_t position, u8_t layer) +bool is_active_layer(u8_t layer, u32_t layer_state) { - return (zmk_keymap_layer_state & BIT(layer)) == BIT(layer) - || layer == zmk_keymap_layer_default - || zmk_keymap_active_behavior_layer[position] == layer; + return (layer_state & BIT(layer)) == BIT(layer) + || layer == zmk_keymap_layer_default; } +int zmk_keymap_apply_position_state(int layer, u32_t position, bool pressed) +{ + struct zmk_behavior_binding *binding = &zmk_keymap[layer][position]; + struct device *behavior; + + LOG_DBG("layer: %d position: %d, binding name: %s", layer, position, log_strdup(binding->behavior_dev)); + + behavior = device_get_binding(binding->behavior_dev); + + if (!behavior) { + LOG_DBG("No behavior assigned to %d on layer %d", position, layer); + return 1; + } + + if (pressed) { + return behavior_keymap_binding_pressed(behavior, position, binding->param1, binding->param2); + } else { + return behavior_keymap_binding_released(behavior, position, binding->param1, binding->param2); + } +} + int zmk_keymap_position_state_changed(u32_t position, bool pressed) { for (int layer = ZMK_KEYMAP_LAYERS_LEN - 1; layer >= zmk_keymap_layer_default; layer--) { - if (is_active_position(position, layer)) + u32_t layer_state = pressed ? zmk_keymap_layer_state : zmk_keymap_active_behavior_layer[position]; + if (is_active_layer(layer, layer_state)) { - struct zmk_behavior_binding *binding = &zmk_keymap[layer][position]; - struct device *behavior; - int ret; - - LOG_DBG("layer: %d position: %d, binding name: %s", layer, position, log_strdup(binding->behavior_dev)); + int ret = zmk_keymap_apply_position_state(layer, position, pressed); - behavior = device_get_binding(binding->behavior_dev); - - if (!behavior) { - LOG_DBG("No behavior assigned to %d on layer %d", position, layer); - continue; - } - if (pressed) { - ret = behavior_keymap_binding_pressed(behavior, position, binding->param1, binding->param2); - } else { - ret = behavior_keymap_binding_released(behavior, position, binding->param1, binding->param2); - } - + zmk_keymap_active_behavior_layer[position] = zmk_keymap_layer_state; if (ret > 0) { LOG_DBG("behavior processing to continue to next layer"); continue; } else if (ret < 0) { LOG_DBG("Behavior returned error: %d", ret); - zmk_keymap_active_behavior_layer[position] = 0; return ret; } else { - zmk_keymap_active_behavior_layer[position] = pressed ? layer : 0; return ret; } } -- cgit v1.2.3 From 01db53b46a6eaf3126e0b44e2f3fc18fd4ae0114 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 1 Sep 2020 09:55:25 -0400 Subject: fix(kscan): Avoid sending duplicate kscan events. --- app/drivers/zephyr/kscan_gpio_direct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/drivers/zephyr/kscan_gpio_direct.c b/app/drivers/zephyr/kscan_gpio_direct.c index 6e0beb0..a3aa8c4 100644 --- a/app/drivers/zephyr/kscan_gpio_direct.c +++ b/app/drivers/zephyr/kscan_gpio_direct.c @@ -156,7 +156,6 @@ static int kscan_gpio_read(struct device *dev) struct kscan_gpio_data *data = dev->driver_data; const struct kscan_gpio_config *cfg = dev->config_info; u32_t read_state = data->pin_state; - LOG_DBG("Scanning the pins for updated state"); for (int i = 0; i < cfg->num_of_inputs; i++) { struct device *in_dev = kscan_gpio_input_devices(dev)[i]; @@ -165,8 +164,9 @@ static int kscan_gpio_read(struct device *dev) } for (int i = 0; i < cfg->num_of_inputs; i++) { + bool prev_pressed = BIT(i) & data->pin_state; bool pressed = BIT(i) & read_state; - if (pressed != (BIT(i) & data->pin_state)) + if (pressed != prev_pressed) { LOG_DBG("Sending event at %d,%d state %s", 0, i, (pressed ? "on" : "off")); -- cgit v1.2.3