From 6645e13e3af08dd631dbd361001e9006970acee5 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sat, 2 Jan 2021 04:58:58 +0000 Subject: [PATCH] Cleanup tg4x keymap ; set lily underglow led strip length ; tweak notes/readme --- keyboards/zmk-config/README.md | 6 ++- keyboards/zmk-config/config/lily58.keymap | 4 ++ keyboards/zmk-config/config/tg4x.conf | 43 +++++++++++++++++ keyboards/zmk-config/config/tg4x.keymap | 58 +++++++++++++++++++++++ keyboards/zmk-config/notes.md | 18 ------- 5 files changed, 110 insertions(+), 19 deletions(-) create mode 100644 keyboards/zmk-config/config/tg4x.conf create mode 100644 keyboards/zmk-config/config/tg4x.keymap diff --git a/keyboards/zmk-config/README.md b/keyboards/zmk-config/README.md index 550abb7d..eb073403 100644 --- a/keyboards/zmk-config/README.md +++ b/keyboards/zmk-config/README.md @@ -12,7 +12,11 @@ west build --board nrf52840_mdk_dongle -d build/mdk_dongle -- -DSHIELD=mdk_dongl west build --board nice_nano -d build/tidbit -- -DSHIELD=tidbit -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config -west build --board nice_nano -d build/pockettype -- -DSHIELD=pockettype -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config +west build --board nice_nano -d build/pockettype/default -- -DSHIELD=pockettype -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config + +west build --board nrf52840_mdk_dongle -d build/pockettype/central -- -DSHIELD=pockettype_central -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config + +west build --board nice_nano -d build/pockettype/peripheral -- -DSHIELD=pockettype_peripheral -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config west build --board nice_nano -d build/tg4x -- -DSHIELD=tg4x -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config diff --git a/keyboards/zmk-config/config/lily58.keymap b/keyboards/zmk-config/config/lily58.keymap index 8164d9ad..988f8ff1 100644 --- a/keyboards/zmk-config/config/lily58.keymap +++ b/keyboards/zmk-config/config/lily58.keymap @@ -9,6 +9,10 @@ #include #include +&led_strip { + chain-length = <1>; +}; + / { keymap { compatible = "zmk,keymap"; diff --git a/keyboards/zmk-config/config/tg4x.conf b/keyboards/zmk-config/config/tg4x.conf new file mode 100644 index 00000000..eb075fcc --- /dev/null +++ b/keyboards/zmk-config/config/tg4x.conf @@ -0,0 +1,43 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +# Number of BT Profiles +CONFIG_BT_MAX_CONN=6 + +# Set screen blanking to 15s instead of 30s +CONFIG_ZMK_IDLE_TIMEOUT=15000 + +# Save settings after 10s instaed of 60s +#CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE=10000 + +################################################################################ +# Debugging +################################################################################ + +# 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" + +# Sensor logging +CONFIG_SENSOR_LOG_LEVEL_DBG=y +#CONFIG_SENSOR_LOG_LEVEL=4 +CONFIG_SENSOR_INIT_PRIORITY=90 \ No newline at end of file diff --git a/keyboards/zmk-config/config/tg4x.keymap b/keyboards/zmk-config/config/tg4x.keymap new file mode 100644 index 00000000..b06f6c18 --- /dev/null +++ b/keyboards/zmk-config/config/tg4x.keymap @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + +&led_strip { + chain-length = <1>; +}; + +/ { + behaviors { + ht: hold_tap { + compatible = "zmk,behavior-hold-tap"; + label = "Hold Tap"; + #binding-cells = <2>; + tapping_term_ms = <200>; + flavor = "tap-preferred"; + bindings = <&kp>, <&kp>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < +&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &none &kp BSPC +&ht CAPS TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp RET +&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp RSHFT +&kp LCTRL &kp LGUI &kp LALT &mo 2 &kp SPACE &mo 1 &kp RALT &kp RGUI &kp RCTRL + >; + }; + + function_layer { + bindings = < +&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &none &kp DEL +&none &kp HOME &kp PG_UP &kp LBKT &kp RBKT &trans &trans &kp MINUS &kp EQUAL &kp BSLH &kp FSLH &kp APOS +&trans &kp END &kp PG_DN &trans &trans &trans &trans &trans &trans &kp UP &trans +&trans &trans &trans &trans &trans &trans &kp LEFT &kp DOWN &kp RIGHT + >; + }; + + other_layer { + bindings = < +&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &none &kp F12 +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp INSERT +&trans &bt BT_CLR &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &bootloader &reset &kp PRINTSCREEN +&trans &trans &trans &trans &trans &kp C_VOL_UP &kp C_VOL_DN &kp C_PP + >; + }; + + }; +}; diff --git a/keyboards/zmk-config/notes.md b/keyboards/zmk-config/notes.md index bc8c2ed3..fa86c803 100644 --- a/keyboards/zmk-config/notes.md +++ b/keyboards/zmk-config/notes.md @@ -1,7 +1,3 @@ -# User Behaviors - -Needs documentation, see pockettype and mdk dongle for ideas -- specifically the LED code and CMakeLists.txt - # LEDs Generic behavior for led on/off via gpio (see pocket type / mdk personal sources for ideas) @@ -37,20 +33,6 @@ Per Pete Johnson : Mostly build tweaks Submit to upstream zephyr -## Dongles - -- Remove need to have kscan defined for the dongle portion of a build -- Setup user buttons via user code to trip boot loader / other things - - Can do `zmk-config/config/boards/shields/CMakeLists.txt` -- Setup dedicated mdk dongle shield -- Remove local tg4x / pockettype dongle configs -- Part of readme shows the necessary conf tweaks/items that need to be added to zmk-config for a board - -## 40% - -- Reconcile against main zmk repo and submit appropriate PRs -- Figure out underglow - ## Tidbit - Setup to use oled same way as original