From fd3ce4ba1cbd521b60020395696611cfa5810ab0 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Thu, 6 Aug 2020 23:22:02 -0400 Subject: Encoder Kconfig fixes. --- app/drivers/zephyr/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/drivers/zephyr/Kconfig b/app/drivers/zephyr/Kconfig index b22c4b1..0237846 100644 --- a/app/drivers/zephyr/Kconfig +++ b/app/drivers/zephyr/Kconfig @@ -25,7 +25,7 @@ menuconfig EC11 if EC11 -choice EC11_TRIGGER +choice prompt "Trigger mode" default EC11_TRIGGER_NONE help @@ -46,6 +46,9 @@ config EC11_TRIGGER_OWN_THREAD endchoice +config EC11_TRIGGER + bool + config EC11_THREAD_PRIORITY int "Thread priority" depends on EC11_TRIGGER_OWN_THREAD -- cgit v1.2.3 From 04606317292bcfb62e6884291495cb76fa656f47 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Thu, 6 Aug 2020 23:28:34 -0400 Subject: Refactor to simpler keymaps. --- app/boards/arm/planck/planck_rev6.keymap | 16 +--- .../clueboard_california.keymap | 16 +--- app/boards/shields/kyria/kyria.keymap | 57 ++++++++----- app/boards/shields/lily58/lily58.keymap | 22 +---- app/dts/bindings/zmk,keymap.yaml | 22 +++-- app/dts/bindings/zmk,layers.yaml | 18 ----- app/src/keymap.c | 94 +++++----------------- 7 files changed, 77 insertions(+), 168 deletions(-) delete mode 100644 app/dts/bindings/zmk,layers.yaml (limited to 'app') diff --git a/app/boards/arm/planck/planck_rev6.keymap b/app/boards/arm/planck/planck_rev6.keymap index f474ec9..af1dc7c 100644 --- a/app/boards/arm/planck/planck_rev6.keymap +++ b/app/boards/arm/planck/planck_rev6.keymap @@ -1,23 +1,11 @@ #include #include -#include / { - chosen { - zmk,keymap = &keymap0; - }; - - keymap0: keymap { + keymap { compatible = "zmk,keymap"; - label ="Default Planck Keymap"; - layers = <&default>; - }; - - layers { - compatible = "zmk,layers"; - default: layer_0 { - label = "DEFAULT"; + default_layer { // ----------------------------------------------------------------------------------------- // | TAB | Q | W | E | R | T | Y | U | I | O | P | BSPC | // | ESC | A | S | D | F | G | H | J | K | L | ; | ' | diff --git a/app/boards/shields/clueboard_california/clueboard_california.keymap b/app/boards/shields/clueboard_california/clueboard_california.keymap index c2fa7f8..7a84b11 100644 --- a/app/boards/shields/clueboard_california/clueboard_california.keymap +++ b/app/boards/shields/clueboard_california/clueboard_california.keymap @@ -1,23 +1,11 @@ -#include -#include #include +#include / { - chosen { - zmk,keymap = &keymap0; - }; - keymap0: keymap { compatible = "zmk,keymap"; - label ="Default Kyria Keymap"; - layers = <&default>; - }; - - layers { - compatible = "zmk,layers"; - default: layer_0 { - label = "DEFAULT"; + default_layer { bindings = < &kp NUM_9 &kp NUM_8 &kp NUM_7 &kp NUM_6 diff --git a/app/boards/shields/kyria/kyria.keymap b/app/boards/shields/kyria/kyria.keymap index 7f12f59..614e13b 100644 --- a/app/boards/shields/kyria/kyria.keymap +++ b/app/boards/shields/kyria/kyria.keymap @@ -2,34 +2,55 @@ #include / { - chosen { - zmk,keymap = &keymap0; - }; - - keymap0: keymap { + keymap { compatible = "zmk,keymap"; - label ="Default Kyria Keymap"; - layers = <&default>; - }; - - layers { - compatible = "zmk,layers"; - default: layer_0 { - label = "DEFAULT"; + default_layer { // --------------------------------------------------------------------------------------------------------------------------------- // | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | // | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | // | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL | // | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT | bindings = < - &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH - &kp TAB &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 LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL - &kp LGUI &kp DEL &kp RET &kp SPC &kp ESC &kp RET &kp SPC &kp TAB &kp BKSP &kp RALT + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp TAB &kp A &kp S &mt MOD_LCTL D &mt MOD_LSFT F &kp G &kp H &mt MOD_LSFT J &mt MOD_LCTL K &kp L &kp SCLN &kp QUOT + &kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL + &kp LGUI &kp DEL &kp RET &kp SPC &mo 1 &mo 2 &kp SPC &kp RET &kp BKSP &kp RALT >; sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD &inc_dec_kp PGUP PGDN>; }; + + lower_layer { +// --------------------------------------------------------------------------------------------------------------------------------- +// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | +// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL | +// | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT | + bindings = < + &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 BSLH + &kp TAB &kp A &kp S &mt MOD_LCTL D &mt MOD_LSFT F &kp G &kp H &mt MOD_LSFT J &mt MOD_LCTL K &kp L &kp SCLN &kp QUOT + &kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL + &kp LGUI &kp DEL &kp RET &kp SPC &trans &kp RET &kp SPC &kp SPC &kp BKSP &kp RALT + >; + + // sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD &inc_dec_kp PGUP PGDN>; + }; + + raise_layer { +// --------------------------------------------------------------------------------------------------------------------------------- +// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | +// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL | +// | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT | + bindings = < + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp TAB &kp A &kp S &mt MOD_LCTL D &mt MOD_LSFT F &kp G &kp H &mt MOD_LSFT J &mt MOD_LCTL K &kp L &kp SCLN &kp QUOT + &kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL + &kp LGUI &kp DEL &kp RET &kp SPC &kp RET &trans &kp SPC &kp SPC &kp BKSP &kp RALT + >; + + // sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD &inc_dec_kp PGUP PGDN>; + }; }; -}; +}; \ No newline at end of file diff --git a/app/boards/shields/lily58/lily58.keymap b/app/boards/shields/lily58/lily58.keymap index a198770..71bf4ad 100644 --- a/app/boards/shields/lily58/lily58.keymap +++ b/app/boards/shields/lily58/lily58.keymap @@ -1,23 +1,11 @@ #include #include -#include / { - chosen { - zmk,keymap = &keymap0; - }; - - keymap0: keymap { + keymap { compatible = "zmk,keymap"; - label ="Default Lily58 Keymap"; - layers = <&default &lower &raise>; - }; - - layers { - compatible = "zmk,layers"; - default: layer_0 { - label = "DEFAULT"; + default_layer { // ------------------------------------------------------------------------------------------------------------ // | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | // | TAB | Q | W | E | R | T | | Y | U | I | O | P | - | @@ -33,8 +21,7 @@ >; }; - lower: layer_1 { - label = "LOWER"; + lower_layer { // ------------------------------------------------------------------------------------------------------------ // | | | | | | | | | | | | | | // | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | @@ -50,8 +37,7 @@ >; }; - raise: layer_3 { - label = "RAISE"; + raise_layer { // ------------------------------------------------------------------------------------------------------------ // | | | | | | | | | | | | | | // | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | diff --git a/app/dts/bindings/zmk,keymap.yaml b/app/dts/bindings/zmk,keymap.yaml index b9517a3..fb6d914 100644 --- a/app/dts/bindings/zmk,keymap.yaml +++ b/app/dts/bindings/zmk,keymap.yaml @@ -3,15 +3,13 @@ description: | compatible: "zmk,keymap" -properties: - transform: - type: phandle - required: false - - label: - type: string - required: true - - layers: - type: phandles - required: true +child-binding: + description: "A layer to be used in a keymap" + + properties: + bindings: + type: phandle-array + required: true + sensor-bindings: + type: phandle-array + required: false diff --git a/app/dts/bindings/zmk,layers.yaml b/app/dts/bindings/zmk,layers.yaml deleted file mode 100644 index 1a3592e..0000000 --- a/app/dts/bindings/zmk,layers.yaml +++ /dev/null @@ -1,18 +0,0 @@ -description: | - Allows defining the various keymap layers for use. - -compatible: "zmk,layers" - -child-binding: - description: "A layer to be used in a keymap" - - properties: - label: - type: string - required: true - bindings: - type: phandle-array - required: true - sensor-bindings: - type: phandle-array - required: false diff --git a/app/src/keymap.c b/app/src/keymap.c index 24e249d..ec51240 100644 --- a/app/src/keymap.c +++ b/app/src/keymap.c @@ -17,96 +17,41 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); static u32_t zmk_keymap_layer_state = 0; static u8_t zmk_keymap_layer_default = 0; -#define ZMK_KEYMAP_NODE DT_CHOSEN(zmk_keymap) -#define ZMK_KEYMAP_LAYERS_LEN DT_PROP_LEN(ZMK_KEYMAP_NODE, layers) +#define DT_DRV_COMPAT zmk_keymap + +#define LAYER_CHILD_LEN(node) 1+ +#define ZMK_KEYMAP_NODE DT_DRV_INST(0) +#define ZMK_KEYMAP_LAYERS_LEN (DT_INST_FOREACH_CHILD(0, LAYER_CHILD_LEN) 0) #define LAYER_NODE(l) DT_PHANDLE_BY_IDX(ZMK_KEYMAP_NODE, layers, l) #define _TRANSFORM_ENTRY(idx, layer) \ - { .behavior_dev = DT_LABEL(DT_PHANDLE_BY_IDX(DT_PHANDLE_BY_IDX(ZMK_KEYMAP_NODE, layers, layer), bindings, idx)), \ - .param1 = COND_CODE_0(DT_PHA_HAS_CELL_AT_IDX(LAYER_NODE(layer), bindings, idx, param1), (0), (DT_PHA_BY_IDX(LAYER_NODE(layer), bindings, idx, param1))), \ - .param2 = COND_CODE_0(DT_PHA_HAS_CELL_AT_IDX(LAYER_NODE(layer), bindings, idx, param2), (0), (DT_PHA_BY_IDX(LAYER_NODE(layer), bindings, idx, param2))), \ + { .behavior_dev = DT_LABEL(DT_PHANDLE_BY_IDX(layer, bindings, idx)), \ + .param1 = COND_CODE_0(DT_PHA_HAS_CELL_AT_IDX(layer, bindings, idx, param1), (0), (DT_PHA_BY_IDX(layer, bindings, idx, param1))), \ + .param2 = COND_CODE_0(DT_PHA_HAS_CELL_AT_IDX(layer, bindings, idx, param2), (0), (DT_PHA_BY_IDX(layer, bindings, idx, param2))), \ }, -#define TRANSFORMED_LAYER(idx) \ - { UTIL_LISTIFY(DT_PROP_LEN(DT_PHANDLE_BY_IDX(ZMK_KEYMAP_NODE, layers, idx), bindings), _TRANSFORM_ENTRY, idx) } +#define TRANSFORMED_LAYER(node) \ + { UTIL_LISTIFY(DT_PROP_LEN(node, bindings), _TRANSFORM_ENTRY, node) }, static struct zmk_behavior_binding zmk_keymap[ZMK_KEYMAP_LAYERS_LEN][ZMK_KEYMAP_LEN] = { -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 0) - TRANSFORMED_LAYER(0), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 1) - TRANSFORMED_LAYER(1), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 2) - TRANSFORMED_LAYER(2), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 3) - TRANSFORMED_LAYER(3), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 4) - TRANSFORMED_LAYER(4), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 5) - TRANSFORMED_LAYER(5), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 6) - TRANSFORMED_LAYER(6), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 7) - TRANSFORMED_LAYER(7), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 8) - TRANSFORMED_LAYER(8), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 9) - TRANSFORMED_LAYER(9), -#endif + DT_INST_FOREACH_CHILD(0, TRANSFORMED_LAYER) }; #if ZMK_KEYMAP_HAS_SENSORS #define _TRANSFORM_SENSOR_ENTRY(idx, layer) \ - { .behavior_dev = DT_LABEL(DT_PHANDLE_BY_IDX(DT_PHANDLE_BY_IDX(ZMK_KEYMAP_NODE, layers, layer), sensor_bindings, idx)), \ - .param1 = COND_CODE_0(DT_PHA_HAS_CELL_AT_IDX(LAYER_NODE(layer), sensor_bindings, idx, param1), (0), (DT_PHA_BY_IDX(LAYER_NODE(layer), sensor_bindings, idx, param1))), \ - .param2 = COND_CODE_0(DT_PHA_HAS_CELL_AT_IDX(LAYER_NODE(layer), sensor_bindings, idx, param2), (0), (DT_PHA_BY_IDX(LAYER_NODE(layer), sensor_bindings, idx, param2))), \ + { .behavior_dev = DT_LABEL(DT_PHANDLE_BY_IDX(layer, sensor_bindings, idx)), \ + .param1 = COND_CODE_0(DT_PHA_HAS_CELL_AT_IDX(layer, sensor_bindings, idx, param1), (0), (DT_PHA_BY_IDX(layer, sensor_bindings, idx, param1))), \ + .param2 = COND_CODE_0(DT_PHA_HAS_CELL_AT_IDX(layer, sensor_bindings, idx, param2), (0), (DT_PHA_BY_IDX(layer, sensor_bindings, idx, param2))), \ }, -#define SENSOR_LAYER(idx) \ - COND_CODE_1(DT_NODE_HAS_PROP(DT_PHANDLE_BY_IDX(ZMK_KEYMAP_NODE, layers, idx), sensor_bindings), \ - ({ UTIL_LISTIFY(DT_PROP_LEN(DT_PHANDLE_BY_IDX(ZMK_KEYMAP_NODE, layers, idx), sensor_bindings), _TRANSFORM_SENSOR_ENTRY, idx) }), \ - (NULL)) +#define SENSOR_LAYER(node) \ + COND_CODE_1(DT_NODE_HAS_PROP(node, sensor_bindings), \ + ({ UTIL_LISTIFY(DT_PROP_LEN(node, sensor_bindings), _TRANSFORM_SENSOR_ENTRY, node) }), \ + ({})), static struct zmk_behavior_binding zmk_sensor_keymap[ZMK_KEYMAP_LAYERS_LEN][ZMK_KEYMAP_SENSORS_LEN] = { -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 0) - SENSOR_LAYER(0), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 1) - SENSOR_LAYER(1), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 2) - SENSOR_LAYER(2), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 3) - SENSOR_LAYER(3), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 4) - SENSOR_LAYER(4), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 5) - SENSOR_LAYER(5), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 6) - SENSOR_LAYER(6), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 7) - SENSOR_LAYER(7), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 8) - SENSOR_LAYER(8), -#endif -#if DT_PROP_HAS_IDX(ZMK_KEYMAP_NODE, layers, 9) - SENSOR_LAYER(9), -#endif + DT_INST_FOREACH_CHILD(0, SENSOR_LAYER) }; #endif /* ZMK_KEYMAP_HAS_SENSORS */ @@ -131,6 +76,7 @@ int zmk_keymap_layer_deactivate(u8_t layer) int zmk_keymap_position_state_changed(u32_t position, bool pressed) { + LOG_DBG("Searching %d layers for a binding", ZMK_KEYMAP_LAYERS_LEN); for (int layer = ZMK_KEYMAP_LAYERS_LEN - 1; layer >= zmk_keymap_layer_default; layer--) { if ((zmk_keymap_layer_state & BIT(layer)) == BIT(layer) || layer == zmk_keymap_layer_default) -- cgit v1.2.3 From 01b8b724c12b2dc21340fbaa37ed0946f4b7c39c Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Thu, 6 Aug 2020 23:54:18 -0400 Subject: Remove debugging line that snuck in. --- app/src/keymap.c | 1 - 1 file changed, 1 deletion(-) (limited to 'app') diff --git a/app/src/keymap.c b/app/src/keymap.c index ec51240..aee0577 100644 --- a/app/src/keymap.c +++ b/app/src/keymap.c @@ -76,7 +76,6 @@ int zmk_keymap_layer_deactivate(u8_t layer) int zmk_keymap_position_state_changed(u32_t position, bool pressed) { - LOG_DBG("Searching %d layers for a binding", ZMK_KEYMAP_LAYERS_LEN); for (int layer = ZMK_KEYMAP_LAYERS_LEN - 1; layer >= zmk_keymap_layer_default; layer--) { if ((zmk_keymap_layer_state & BIT(layer)) == BIT(layer) || layer == zmk_keymap_layer_default) -- cgit v1.2.3 From b4ae91a649832e16fbd0c940dc96f9eb3a8b7e39 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Thu, 6 Aug 2020 23:57:11 -0400 Subject: Revert some personal Kyria keymap changes. --- app/boards/shields/kyria/kyria.keymap | 40 ++++------------------------------- 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'app') diff --git a/app/boards/shields/kyria/kyria.keymap b/app/boards/shields/kyria/kyria.keymap index 614e13b..1d6b9bf 100644 --- a/app/boards/shields/kyria/kyria.keymap +++ b/app/boards/shields/kyria/kyria.keymap @@ -12,45 +12,13 @@ // | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL | // | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT | bindings = < - &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH - &kp TAB &kp A &kp S &mt MOD_LCTL D &mt MOD_LSFT F &kp G &kp H &mt MOD_LSFT J &mt MOD_LCTL K &kp L &kp SCLN &kp QUOT - &kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL - &kp LGUI &kp DEL &kp RET &kp SPC &mo 1 &mo 2 &kp SPC &kp RET &kp BKSP &kp RALT + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp TAB &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 LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL + &kp LGUI &kp DEL &kp RET &kp SPC &kp ESC &kp RET &kp SPC &kp TAB &kp BKSP &kp RALT >; sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD &inc_dec_kp PGUP PGDN>; }; - - lower_layer { -// --------------------------------------------------------------------------------------------------------------------------------- -// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | -// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | -// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL | -// | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT | - bindings = < - &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 BSLH - &kp TAB &kp A &kp S &mt MOD_LCTL D &mt MOD_LSFT F &kp G &kp H &mt MOD_LSFT J &mt MOD_LCTL K &kp L &kp SCLN &kp QUOT - &kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL - &kp LGUI &kp DEL &kp RET &kp SPC &trans &kp RET &kp SPC &kp SPC &kp BKSP &kp RALT - >; - - // sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD &inc_dec_kp PGUP PGDN>; - }; - - raise_layer { -// --------------------------------------------------------------------------------------------------------------------------------- -// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | -// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | -// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL | -// | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT | - bindings = < - &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH - &kp TAB &kp A &kp S &mt MOD_LCTL D &mt MOD_LSFT F &kp G &kp H &mt MOD_LSFT J &mt MOD_LCTL K &kp L &kp SCLN &kp QUOT - &kp LSFT &kp Z &kp X &kp C &kp V &kp B &kp LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL - &kp LGUI &kp DEL &kp RET &kp SPC &kp RET &trans &kp SPC &kp SPC &kp BKSP &kp RALT - >; - - // sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD &inc_dec_kp PGUP PGDN>; - }; }; }; \ No newline at end of file -- cgit v1.2.3 From 2c734c913390dd4b2ff49295b3e1107fa397aed8 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Thu, 6 Aug 2020 23:59:20 -0400 Subject: Whitespace tweaks. --- app/boards/shields/kyria/kyria.keymap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/boards/shields/kyria/kyria.keymap b/app/boards/shields/kyria/kyria.keymap index 1d6b9bf..6caf073 100644 --- a/app/boards/shields/kyria/kyria.keymap +++ b/app/boards/shields/kyria/kyria.keymap @@ -12,9 +12,9 @@ // | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL | // | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT | bindings = < - &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH - &kp TAB &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 LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp TAB &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 LSFT &kp LSFT &kp LSFT &kp LSFT &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL &kp LGUI &kp DEL &kp RET &kp SPC &kp ESC &kp RET &kp SPC &kp TAB &kp BKSP &kp RALT >; -- cgit v1.2.3 From d57c271804328460470d13218a309e92a9397d22 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Fri, 7 Aug 2020 00:00:35 -0400 Subject: Whitespace at EOF fix. --- app/boards/shields/kyria/kyria.keymap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/boards/shields/kyria/kyria.keymap b/app/boards/shields/kyria/kyria.keymap index 6caf073..f689ef6 100644 --- a/app/boards/shields/kyria/kyria.keymap +++ b/app/boards/shields/kyria/kyria.keymap @@ -21,4 +21,4 @@ sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD &inc_dec_kp PGUP PGDN>; }; }; -}; \ No newline at end of file +}; -- cgit v1.2.3 From 726fb4b76fdcf814787f6b9474bdc40b42c80699 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Fri, 7 Aug 2020 15:04:20 -0400 Subject: Better default configs. --- app/boards/shields/kyria/kyria.conf | 6 ++++++ app/boards/shields/lily58/lily58.conf | 2 ++ 2 files changed, 8 insertions(+) (limited to 'app') diff --git a/app/boards/shields/kyria/kyria.conf b/app/boards/shields/kyria/kyria.conf index e69de29..f4ab45a 100644 --- a/app/boards/shields/kyria/kyria.conf +++ b/app/boards/shields/kyria/kyria.conf @@ -0,0 +1,6 @@ +# Uncomment these two line to add support for encoders to your firmware +# CONFIG_EC11=y +# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y + +# Uncomment the following line to enable the Kyria OLED Display +# CONFIG_ZMK_DISPLAY=y diff --git a/app/boards/shields/lily58/lily58.conf b/app/boards/shields/lily58/lily58.conf index e69de29..73f0d9d 100644 --- a/app/boards/shields/lily58/lily58.conf +++ b/app/boards/shields/lily58/lily58.conf @@ -0,0 +1,2 @@ +# Uncomment the following line to enable the Lily58 OLED Display +# CONFIG_ZMK_DISPLAY=y -- cgit v1.2.3 From d901a0061dec7abe5d5cd29c616abcda110df9b1 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 8 Aug 2020 19:02:00 -0500 Subject: Add underglow feature docs + DT fixes --- app/boards/shields/kyria/boards/nice_nano.overlay | 1 - app/boards/shields/kyria/kyria.conf | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/boards/shields/kyria/boards/nice_nano.overlay b/app/boards/shields/kyria/boards/nice_nano.overlay index fe07d17..f51ecfe 100644 --- a/app/boards/shields/kyria/boards/nice_nano.overlay +++ b/app/boards/shields/kyria/boards/nice_nano.overlay @@ -1,6 +1,5 @@ &spi1 { compatible = "nordic,nrf-spi"; - /* Cannot be used together with i2c0. */ status = "okay"; mosi-pin = <6>; // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. diff --git a/app/boards/shields/kyria/kyria.conf b/app/boards/shields/kyria/kyria.conf index f4ab45a..eb27213 100644 --- a/app/boards/shields/kyria/kyria.conf +++ b/app/boards/shields/kyria/kyria.conf @@ -4,3 +4,6 @@ # Uncomment the following line to enable the Kyria OLED Display # CONFIG_ZMK_DISPLAY=y + +# Uncomment the following lineto enable RGB underglow +# CONFIG_ZMK_RGB_UNDERGLOW=y -- cgit v1.2.3 From 8d3ac00f31e30c0ed410035067079468afa56126 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 8 Aug 2020 19:02:54 -0500 Subject: Add missing space to comment --- app/boards/shields/kyria/kyria.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/boards/shields/kyria/kyria.conf b/app/boards/shields/kyria/kyria.conf index eb27213..fa98d1c 100644 --- a/app/boards/shields/kyria/kyria.conf +++ b/app/boards/shields/kyria/kyria.conf @@ -5,5 +5,5 @@ # Uncomment the following line to enable the Kyria OLED Display # CONFIG_ZMK_DISPLAY=y -# Uncomment the following lineto enable RGB underglow +# Uncomment the following line to enable RGB underglow # CONFIG_ZMK_RGB_UNDERGLOW=y -- cgit v1.2.3 From 3127192720c9da848e14625c34ce3f6329eb0a0f Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Sun, 9 Aug 2020 12:13:39 -0400 Subject: Invoke called behavior after layer change. * If you press a key with a layer active, then deactivate the layer (e.g. releasing a `&mo`, then release the key, we currently may send the wrong key release event. * Fixes #67. --- app/src/keymap.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/src/keymap.c b/app/src/keymap.c index aee0577..ff494f7 100644 --- a/app/src/keymap.c +++ b/app/src/keymap.c @@ -34,9 +34,6 @@ static u8_t zmk_keymap_layer_default = 0; #define TRANSFORMED_LAYER(node) \ { UTIL_LISTIFY(DT_PROP_LEN(node, bindings), _TRANSFORM_ENTRY, node) }, -static struct zmk_behavior_binding zmk_keymap[ZMK_KEYMAP_LAYERS_LEN][ZMK_KEYMAP_LEN] = { - DT_INST_FOREACH_CHILD(0, TRANSFORMED_LAYER) -}; #if ZMK_KEYMAP_HAS_SENSORS #define _TRANSFORM_SENSOR_ENTRY(idx, layer) \ @@ -50,6 +47,21 @@ static struct zmk_behavior_binding zmk_keymap[ZMK_KEYMAP_LAYERS_LEN][ZMK_KEYMAP_ ({ UTIL_LISTIFY(DT_PROP_LEN(node, sensor_bindings), _TRANSFORM_SENSOR_ENTRY, node) }), \ ({})), +#endif /* ZMK_KEYMAP_HAS_SENSORS */ + +// State + +// When a behavior handles a key position "down" event, we record that layer +// 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 struct zmk_behavior_binding zmk_keymap[ZMK_KEYMAP_LAYERS_LEN][ZMK_KEYMAP_LEN] = { + DT_INST_FOREACH_CHILD(0, TRANSFORMED_LAYER) +}; + +#if ZMK_KEYMAP_HAS_SENSORS + static struct zmk_behavior_binding zmk_sensor_keymap[ZMK_KEYMAP_LAYERS_LEN][ZMK_KEYMAP_SENSORS_LEN] = { DT_INST_FOREACH_CHILD(0, SENSOR_LAYER) }; @@ -74,11 +86,18 @@ int zmk_keymap_layer_deactivate(u8_t layer) SET_LAYER_STATE(layer, false); }; +bool is_active_position(u32_t position, u8_t layer) +{ + return (zmk_keymap_layer_state & BIT(layer)) == BIT(layer) + || layer == zmk_keymap_layer_default + || zmk_keymap_active_behavior_layer[position] == layer; +} + 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 ((zmk_keymap_layer_state & BIT(layer)) == BIT(layer) || layer == zmk_keymap_layer_default) + if (is_active_position(position, layer)) { struct zmk_behavior_binding *binding = &zmk_keymap[layer][position]; struct device *behavior; @@ -104,8 +123,10 @@ int zmk_keymap_position_state_changed(u32_t position, bool pressed) 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 be57b10c56885315ad56b78cc2f65a955029bccf Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Mon, 10 Aug 2020 11:29:16 -0400 Subject: Initial Corne shield definition. * Also include a build for Clueboard California macropad. --- app/boards/shields/corne/Kconfig.defconfig | 58 +++++++++++++++++ app/boards/shields/corne/Kconfig.shield | 8 +++ app/boards/shields/corne/boards/nice_nano.overlay | 29 +++++++++ app/boards/shields/corne/corne.conf | 4 ++ app/boards/shields/corne/corne.dtsi | 79 +++++++++++++++++++++++ app/boards/shields/corne/corne.keymap | 22 +++++++ app/boards/shields/corne/corne_left.conf | 2 + app/boards/shields/corne/corne_left.overlay | 18 ++++++ app/boards/shields/corne/corne_right.conf | 2 + app/boards/shields/corne/corne_right.overlay | 23 +++++++ 10 files changed, 245 insertions(+) create mode 100644 app/boards/shields/corne/Kconfig.defconfig create mode 100644 app/boards/shields/corne/Kconfig.shield create mode 100644 app/boards/shields/corne/boards/nice_nano.overlay create mode 100644 app/boards/shields/corne/corne.conf create mode 100644 app/boards/shields/corne/corne.dtsi create mode 100644 app/boards/shields/corne/corne.keymap create mode 100644 app/boards/shields/corne/corne_left.conf create mode 100644 app/boards/shields/corne/corne_left.overlay create mode 100644 app/boards/shields/corne/corne_right.conf create mode 100644 app/boards/shields/corne/corne_right.overlay (limited to 'app') diff --git a/app/boards/shields/corne/Kconfig.defconfig b/app/boards/shields/corne/Kconfig.defconfig new file mode 100644 index 0000000..8878da3 --- /dev/null +++ b/app/boards/shields/corne/Kconfig.defconfig @@ -0,0 +1,58 @@ + +if SHIELD_CORNE_LEFT + +config ZMK_KEYBOARD_NAME + default "Corne Left" + +endif + + +if SHIELD_CORNE_RIGHT + +config ZMK_KEYBOARD_NAME + default "Corne Right" + +endif + +if SHIELD_CORNE_LEFT || SHIELD_CORNE_RIGHT + +config ZMK_SPLIT + default y + +if ZMK_DISPLAY + +config I2C + default y + +config SSD1306 + default y + +config SSD1306_REVERSE_MODE + default y + +endif # ZMK_DISPLAY + +if LVGL + +config LVGL_HOR_RES + default 128 + +config LVGL_VER_RES + default 32 + +config LVGL_VDB_SIZE + default 64 + +config LVGL_DPI + default 148 + +config LVGL_BITS_PER_PIXEL + default 1 + +choice LVGL_COLOR_DEPTH + default LVGL_COLOR_DEPTH_1 +endchoice + +endif # LVGL + +endif diff --git a/app/boards/shields/corne/Kconfig.shield b/app/boards/shields/corne/Kconfig.shield new file mode 100644 index 0000000..3cac86f --- /dev/null +++ b/app/boards/shields/corne/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2020 Pete Johanson +# SPDX-License-Identifier: MIT + +config SHIELD_CORNE_LEFT + def_bool $(shields_list_contains,corne_left) + +config SHIELD_CORNE_RIGHT + def_bool $(shields_list_contains,corne_right) diff --git a/app/boards/shields/corne/boards/nice_nano.overlay b/app/boards/shields/corne/boards/nice_nano.overlay new file mode 100644 index 0000000..c7c3eb8 --- /dev/null +++ b/app/boards/shields/corne/boards/nice_nano.overlay @@ -0,0 +1,29 @@ +&spi1 { + compatible = "nordic,nrf-spi"; + /* Cannot be used together with i2c0. */ + status = "okay"; + mosi-pin = <6>; + // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. + sck-pin = <5>; + miso-pin = <7>; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "SK6812mini"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <6>; /* There are per-key RGB, but the first 6 are underglow */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/corne/corne.conf b/app/boards/shields/corne/corne.conf new file mode 100644 index 0000000..2723b03 --- /dev/null +++ b/app/boards/shields/corne/corne.conf @@ -0,0 +1,4 @@ +# TODO: Add lines about underglow! + +# Uncomment the following line to enable the Corne OLED Display +# CONFIG_ZMK_DISPLAY=y diff --git a/app/boards/shields/corne/corne.dtsi b/app/boards/shields/corne/corne.dtsi new file mode 100644 index 0000000..da48d62 --- /dev/null +++ b/app/boards/shields/corne/corne.dtsi @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <12>; + rows = <4>; +// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | +// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | +// | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | +// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | + map = < +RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,12) +RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,12) +RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,12) + RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) + >; + }; + + five_column_transform: keymap_transform_1 { + compatible = "zmk,matrix-transform"; + columns = <10>; + rows = <4>; +// | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | +// | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | +// | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | +// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 | + map = < +RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) +RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) +RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) + RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + row-gpios + = <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + }; + + // TODO: RGB node(s) +}; + +&pro_micro_i2c { + status = "okay"; + + ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + label = "DISPLAY"; + width = <128>; + height = <32>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <63>; + prechargep = <0x22>; + }; +}; diff --git a/app/boards/shields/corne/corne.keymap b/app/boards/shields/corne/corne.keymap new file mode 100644 index 0000000..2f7f38b --- /dev/null +++ b/app/boards/shields/corne/corne.keymap @@ -0,0 +1,22 @@ +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +// --------------------------------------------------------------------------------------------------------------------------------- +// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | +// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | | N | M | , | . | / | CTRL | +// | GUI | DEL | RET | | TAB | BSPC | R-ALT | + bindings = < + &kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp TAB &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 N &kp M &kp CMMA &kp DOT &kp FSLH &kp RCTL + &kp LGUI &kp DEL &kp RET &kp TAB &kp BKSP &kp RALT + >; + }; + }; +}; diff --git a/app/boards/shields/corne/corne_left.conf b/app/boards/shields/corne/corne_left.conf new file mode 100644 index 0000000..e51dee4 --- /dev/null +++ b/app/boards/shields/corne/corne_left.conf @@ -0,0 +1,2 @@ +CONFIG_ZMK_SPLIT=y +CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y \ No newline at end of file diff --git a/app/boards/shields/corne/corne_left.overlay b/app/boards/shields/corne/corne_left.overlay new file mode 100644 index 0000000..399bddd --- /dev/null +++ b/app/boards/shields/corne/corne_left.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +#include "corne.dtsi" + +&kscan0 { + col-gpios + = <&pro_micro_a 3 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> + ; +}; diff --git a/app/boards/shields/corne/corne_right.conf b/app/boards/shields/corne/corne_right.conf new file mode 100644 index 0000000..a835adc --- /dev/null +++ b/app/boards/shields/corne/corne_right.conf @@ -0,0 +1,2 @@ +CONFIG_ZMK_SPLIT=y +CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y \ No newline at end of file diff --git a/app/boards/shields/corne/corne_right.overlay b/app/boards/shields/corne/corne_right.overlay new file mode 100644 index 0000000..652d5ed --- /dev/null +++ b/app/boards/shields/corne/corne_right.overlay @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 Pete Johanson + * + * SPDX-License-Identifier: MIT + */ + +#include "corne.dtsi" + +&default_transform { + col-offset = <6>; +}; + +&kscan0 { + col-gpios + = <&pro_micro_d 14 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 3 GPIO_ACTIVE_HIGH> + ; +}; + -- cgit v1.2.3 From aebeb7a153eb11e2f53b8def7235a021effd7e1f Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Mon, 10 Aug 2020 12:36:12 -0400 Subject: Updated config note about underglow. --- app/boards/shields/corne/corne.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/boards/shields/corne/corne.conf b/app/boards/shields/corne/corne.conf index 2723b03..c8e3c00 100644 --- a/app/boards/shields/corne/corne.conf +++ b/app/boards/shields/corne/corne.conf @@ -1,4 +1,5 @@ -# TODO: Add lines about underglow! +# Uncomment the following line to enable the Corne RGB Underglow +# ZMK_RGB_UNDERGLOW=y # Uncomment the following line to enable the Corne OLED Display # CONFIG_ZMK_DISPLAY=y -- cgit v1.2.3 From 030f0dbd074164dbe085a423bdf1de68515d8f02 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Mon, 10 Aug 2020 12:51:01 -0400 Subject: Tweak note about per-key RGB. --- app/boards/shields/corne/corne.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/boards/shields/corne/corne.dtsi b/app/boards/shields/corne/corne.dtsi index da48d62..70d6495 100644 --- a/app/boards/shields/corne/corne.dtsi +++ b/app/boards/shields/corne/corne.dtsi @@ -58,7 +58,7 @@ RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10 }; - // TODO: RGB node(s) + // TODO: per-key RGB node(s)? }; &pro_micro_i2c { -- cgit v1.2.3 From 78059bbbdb2d53957718f38f37b20216baa51566 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 11 Aug 2020 14:49:43 -0400 Subject: Fix up some incorrect license headers. --- app/boards/arm/nice_nano/board.cmake | 2 +- app/boards/arm/proton_c/CMakeLists.txt | 2 +- app/boards/arm/proton_c/pinmux.c | 2 +- app/drivers/zephyr/ec11_trigger.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/boards/arm/nice_nano/board.cmake b/app/boards/arm/nice_nano/board.cmake index 12a1d93..fa847d5 100644 --- a/app/boards/arm/nice_nano/board.cmake +++ b/app/boards/arm/nice_nano/board.cmake @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) diff --git a/app/boards/arm/proton_c/CMakeLists.txt b/app/boards/arm/proton_c/CMakeLists.txt index d1b8108..940af1f 100644 --- a/app/boards/arm/proton_c/CMakeLists.txt +++ b/app/boards/arm/proton_c/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT if(CONFIG_PINMUX) zephyr_library() diff --git a/app/boards/arm/proton_c/pinmux.c b/app/boards/arm/proton_c/pinmux.c index 09f3a34..a6aaae0 100644 --- a/app/boards/arm/proton_c/pinmux.c +++ b/app/boards/arm/proton_c/pinmux.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2017 I-SENSE group of ICCS * - * SPDX-License-Identifier: Apache-2.0 + * SPDX-License-Identifier: MIT */ #include diff --git a/app/drivers/zephyr/ec11_trigger.c b/app/drivers/zephyr/ec11_trigger.c index 55acf45..709d1fb 100644 --- a/app/drivers/zephyr/ec11_trigger.c +++ b/app/drivers/zephyr/ec11_trigger.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2016 Intel Corporation * - * SPDX-License-Identifier: Apache-2.0 + * SPDX-License-Identifier: MIT */ #define DT_DRV_COMPAT alps_ec11 -- cgit v1.2.3 From 8b61beb2bbc62f754db670ad77266f84edde041d Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Fri, 14 Aug 2020 16:44:13 -0400 Subject: Bump max paired connections to 2 for central. --- app/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app') diff --git a/app/Kconfig b/app/Kconfig index 4086955..be5a1e4 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -106,6 +106,10 @@ if ZMK_SPLIT_BLE_ROLE_CENTRAL config BT_MAX_CONN default 5 +config BT_MAX_PAIRED + # Bump this everywhere once we support switching active connections! + default 2 + endif config ZMK_SPLIT_BLE_ROLE_PERIPHERAL -- cgit v1.2.3 From 7e8a07e693431adfb64d12262b3c7614920c042c Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Fri, 14 Aug 2020 16:45:05 -0400 Subject: Remove use of printk. --- app/src/ble.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'app') diff --git a/app/src/ble.c b/app/src/ble.c index 7d986d7..488491c 100644 --- a/app/src/ble.c +++ b/app/src/ble.c @@ -31,11 +31,11 @@ static void connected(struct bt_conn *conn, u8_t err) if (err) { - printk("Failed to connect to %s (%u)\n", addr, err); + LOG_WRN("Failed to connect to %s (%u)", log_strdup(addr), err); return; } - printk("Connected %s\n", addr); + LOG_DBG("Connected %s", log_strdup(addr)); bt_conn_le_param_update(conn, BT_LE_CONN_PARAM(0x0006, 0x000c, 30, 400)); @@ -45,7 +45,7 @@ static void connected(struct bt_conn *conn, u8_t err) if (bt_conn_set_security(conn, BT_SECURITY_L2)) { - printk("Failed to set security\n"); + LOG_ERR("Failed to set security"); } } @@ -55,7 +55,7 @@ static void disconnected(struct bt_conn *conn, u8_t reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Disconnected from %s (reason 0x%02x)\n", addr, reason); + LOG_DBG("Disconnected from %s (reason 0x%02x)", log_strdup(addr), reason); } static void security_changed(struct bt_conn *conn, bt_security_t level, @@ -67,11 +67,11 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, if (!err) { - printk("Security changed: %s level %u\n", addr, level); + LOG_DBG("Security changed: %s level %u", log_strdup(addr), level); } else { - printk("Security failed: %s level %u err %d\n", addr, level, + LOG_ERR("Security failed: %s level %u err %d", log_strdup(addr), level, err); } } @@ -107,7 +107,7 @@ static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Passkey for %s: %06u\n", addr, passkey); + LOG_DBG("Passkey for %s: %06u", log_strdup(addr), passkey); } #ifdef CONFIG_ZMK_BLE_PASSKEY_ENTRY @@ -118,7 +118,7 @@ static void auth_passkey_entry(struct bt_conn *conn) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); - printk("Passkey entry requested for %s\n", addr); + LOG_DBG("Passkey entry requested for %s", log_strdup(addr)); auth_passkey_entry_conn = bt_conn_ref(conn); } @@ -138,7 +138,7 @@ static void auth_cancel(struct bt_conn *conn) passkey_digit = 0; - printk("Pairing cancelled: %s\n", addr); + LOG_DBG("Pairing cancelled: %s", log_strdup(addr)); } static struct bt_conn_auth_cb zmk_ble_auth_cb_display = { @@ -169,14 +169,14 @@ static void zmk_ble_ready(int err) LOG_DBG("ready? %d", err); if (err) { - printk("Bluetooth init failed (err %d)\n", err); + LOG_ERR("Bluetooth init failed (err %d)", err); return; } err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, zmk_ble_ad, ARRAY_SIZE(zmk_ble_ad), NULL, 0); if (err) { - printk("Advertising failed to start (err %d)\n", err); + LOG_ERR("Advertising failed to start (err %d)", err); return; } } @@ -187,7 +187,7 @@ static int zmk_ble_init(struct device *_arg) if (err) { - printk("BLUETOOTH FAILED"); + LOG_ERR("BLUETOOTH FAILED (%d)", err); return err; } -- cgit v1.2.3 From aa4ae90fb7cd7d7e295f9f5d4af8ad63d9bc9715 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 14 Aug 2020 21:31:18 -0500 Subject: Add missing configuration values for RGB underglow --- app/boards/shields/corne/corne.conf | 1 + app/boards/shields/kyria/kyria.conf | 1 + 2 files changed, 2 insertions(+) (limited to 'app') diff --git a/app/boards/shields/corne/corne.conf b/app/boards/shields/corne/corne.conf index c8e3c00..e96bf5a 100644 --- a/app/boards/shields/corne/corne.conf +++ b/app/boards/shields/corne/corne.conf @@ -1,5 +1,6 @@ # Uncomment the following line to enable the Corne RGB Underglow # ZMK_RGB_UNDERGLOW=y +# CONFIG_WS2812_STRIP=y # Uncomment the following line to enable the Corne OLED Display # CONFIG_ZMK_DISPLAY=y diff --git a/app/boards/shields/kyria/kyria.conf b/app/boards/shields/kyria/kyria.conf index fa98d1c..20aa8c2 100644 --- a/app/boards/shields/kyria/kyria.conf +++ b/app/boards/shields/kyria/kyria.conf @@ -7,3 +7,4 @@ # Uncomment the following line to enable RGB underglow # CONFIG_ZMK_RGB_UNDERGLOW=y +# CONFIG_WS2812_STRIP=y -- cgit v1.2.3 From a03b3ab68c5a81dc7c98749241dbfe80e5f1b09b Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 14 Aug 2020 21:33:33 -0500 Subject: Fix grammar --- app/boards/shields/corne/corne.conf | 2 +- app/boards/shields/kyria/kyria.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/boards/shields/corne/corne.conf b/app/boards/shields/corne/corne.conf index e96bf5a..b79385b 100644 --- a/app/boards/shields/corne/corne.conf +++ b/app/boards/shields/corne/corne.conf @@ -1,4 +1,4 @@ -# Uncomment the following line to enable the Corne RGB Underglow +# Uncomment the following lines to enable the Corne RGB Underglow # ZMK_RGB_UNDERGLOW=y # CONFIG_WS2812_STRIP=y diff --git a/app/boards/shields/kyria/kyria.conf b/app/boards/shields/kyria/kyria.conf index 20aa8c2..7a0b5b6 100644 --- a/app/boards/shields/kyria/kyria.conf +++ b/app/boards/shields/kyria/kyria.conf @@ -5,6 +5,6 @@ # Uncomment the following line to enable the Kyria OLED Display # CONFIG_ZMK_DISPLAY=y -# Uncomment the following line to enable RGB underglow +# Uncomment the following lines to enable RGB underglow # CONFIG_ZMK_RGB_UNDERGLOW=y # CONFIG_WS2812_STRIP=y -- cgit v1.2.3 From 4acfa8d7ef2009ce966f6e58719d44abb193f659 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Fri, 14 Aug 2020 23:26:03 -0400 Subject: Add DCDC setting for nano. --- app/boards/arm/nice_nano/Kconfig | 6 ++++++ app/boards/arm/nice_nano/Kconfig.board | 1 + 2 files changed, 7 insertions(+) create mode 100644 app/boards/arm/nice_nano/Kconfig (limited to 'app') diff --git a/app/boards/arm/nice_nano/Kconfig b/app/boards/arm/nice_nano/Kconfig new file mode 100644 index 0000000..a190425 --- /dev/null +++ b/app/boards/arm/nice_nano/Kconfig @@ -0,0 +1,6 @@ + +config BOARD_ENABLE_DCDC + bool "Enable DCDC mode" + select SOC_DCDC_NRF52X + default y + depends on BOARD_NICE_NANO diff --git a/app/boards/arm/nice_nano/Kconfig.board b/app/boards/arm/nice_nano/Kconfig.board index 60ee58b..4fd394f 100644 --- a/app/boards/arm/nice_nano/Kconfig.board +++ b/app/boards/arm/nice_nano/Kconfig.board @@ -6,3 +6,4 @@ config BOARD_NICE_NANO bool "nice!nano" depends on SOC_NRF52840_QIAA + -- cgit v1.2.3