From 440b6063f1379bd2394ac358c50aef56408ce0ed Mon Sep 17 00:00:00 2001 From: KemoNine Date: Thu, 31 Dec 2020 04:26:13 +0000 Subject: [PATCH] Update pockettype setup / cleanup older dongle code that will be put together differently --- keyboards/zmk-config/README.md | 8 ++---- .../boards/shields/pockettype/CMakeLists.txt | 1 - .../boards/shields/pockettype/README.md | 21 --------------- .../shields/pockettype/pockettype.overlay | 24 ++++++++++++++--- .../pockettype/pockettype_peripheral.conf | 2 -- .../pockettype/pockettype_peripheral.overlay | 8 ------ .../shields/pockettype/pockettype_pwr_led.c | 20 +++++--------- .../pockettype/pockettype_transform.dtsi | 27 ------------------- .../boards/shields/tg4x/tg4x_peripheral.conf | 2 -- .../shields/tg4x/tg4x_peripheral.overlay | 12 --------- 10 files changed, 28 insertions(+), 97 deletions(-) delete mode 100644 keyboards/zmk-config/config/boards/shields/pockettype/pockettype_peripheral.conf delete mode 100644 keyboards/zmk-config/config/boards/shields/pockettype/pockettype_peripheral.overlay delete mode 100644 keyboards/zmk-config/config/boards/shields/pockettype/pockettype_transform.dtsi delete mode 100644 keyboards/zmk-config/config/boards/shields/tg4x/tg4x_peripheral.conf delete mode 100644 keyboards/zmk-config/config/boards/shields/tg4x/tg4x_peripheral.overlay diff --git a/keyboards/zmk-config/README.md b/keyboards/zmk-config/README.md index 3cd84dbe..550abb7d 100644 --- a/keyboards/zmk-config/README.md +++ b/keyboards/zmk-config/README.md @@ -12,13 +12,9 @@ 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/default -- -DSHIELD=pockettype -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/peripheral -- -DSHIELD=pockettype_peripheral -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config - -west build --board nice_nano -d build/tg4x/default -- -DSHIELD=tg4x -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config - -west build --board nice_nano -d build/tg4x/peripheral -- -DSHIELD=tg4x_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 west build --board nice_nano -d build/lily58/left -- -DSHIELD=lily58_left -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config diff --git a/keyboards/zmk-config/config/boards/shields/pockettype/CMakeLists.txt b/keyboards/zmk-config/config/boards/shields/pockettype/CMakeLists.txt index bd63ef03..28d6a1a4 100644 --- a/keyboards/zmk-config/config/boards/shields/pockettype/CMakeLists.txt +++ b/keyboards/zmk-config/config/boards/shields/pockettype/CMakeLists.txt @@ -4,4 +4,3 @@ # target_sources(app PRIVATE pockettype_pwr_led.c) -target_sources(app PRIVATE mdk_pwr_led.c) diff --git a/keyboards/zmk-config/config/boards/shields/pockettype/README.md b/keyboards/zmk-config/config/boards/shields/pockettype/README.md index e9ba4c91..21eff455 100644 --- a/keyboards/zmk-config/config/boards/shields/pockettype/README.md +++ b/keyboards/zmk-config/config/boards/shields/pockettype/README.md @@ -3,24 +3,3 @@ Standard setup for the [PocketType!](https://mechboards.co.uk/shop/kits/pockettype/) mini keyboard. The `keymap` directory contains the keyboard layout and were created by [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/). Please note: the zmk keymap is slightly adjusted from the default shown on the main PocketType! pages and QMK. - -## Alternate Builds - -The `pockettype_mdk` shield is setup to use the MakerDiary MDK board as a dongle for the Pockettype!. This will setup the PocketType! as a split ZMK keyboard. The "peripheral half" will be the Pockettype! and the "controller half" will be the MDK. - -## Build Commands - -Below are the three commands that can be used to build ZMK for the Pockettype! as a stand alone board or with a MakerDiary MDK as a dongle. - -``` sh - -# Stand alone build -west build --board nice_nano -d build/pockettype/default -- -DSHIELD=pockettype -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config - -# MDK Dongle build -west build --board nrf52840_mdk -d build/pockettype/mdk -- -DSHIELD=pockettype_mdk -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config - -# Pockettype as a peripheral to the MDK -west build --board nice_nano -d build/pockettype/peripheral -- -DSHIELD=pockettype_peripheral -DZMK_CONFIG=/workspaces/zmk-config/keyboards/zmk-config/config - -``` diff --git a/keyboards/zmk-config/config/boards/shields/pockettype/pockettype.overlay b/keyboards/zmk-config/config/boards/shields/pockettype/pockettype.overlay index 7fe4dcf4..cee8da96 100644 --- a/keyboards/zmk-config/config/boards/shields/pockettype/pockettype.overlay +++ b/keyboards/zmk-config/config/boards/shields/pockettype/pockettype.overlay @@ -12,16 +12,14 @@ #include -#include "pockettype_transform.dtsi" - / { leds { compatible = "gpio-leds"; - act_led: led_a { + actled: led_a { gpios = <&pro_micro_a 3 GPIO_ACTIVE_HIGH>; label = "ACT LED"; }; - power_led: led_p { + powerled: led_p { gpios = <&pro_micro_a 2 GPIO_ACTIVE_HIGH>; label = "PWR LED"; }; @@ -55,4 +53,22 @@ , <&pro_micro_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> ; }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <12>; + rows = <4>; + + 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,11) +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,11) +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,11) +RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) + >; + }; + + chosen { + zmk,kscan = &kscan0; + zmk,matrix_transform = &default_transform; + }; }; diff --git a/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_peripheral.conf b/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_peripheral.conf deleted file mode 100644 index 474dedaa..00000000 --- a/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_peripheral.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_USB=y -CONFIG_ZMK_SPLIT=y diff --git a/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_peripheral.overlay b/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_peripheral.overlay deleted file mode 100644 index 7eac26f9..00000000 --- a/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_peripheral.overlay +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) 2020 Pete Johanson - * - * SPDX-License-Identifier: MIT - */ - -#include "pockettype.overlay" -#include "pockettype.keymap" diff --git a/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_pwr_led.c b/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_pwr_led.c index 54a043f4..c7d0c5ae 100644 --- a/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_pwr_led.c +++ b/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_pwr_led.c @@ -9,7 +9,7 @@ #include #include -#define PWR_LED_NODE DT_ALIAS(led_p) +#define PWR_LED_NODE DT_ALIAS(powerled) #if DT_NODE_HAS_STATUS(PWR_LED_NODE, okay) #define PWR_LED DT_GPIO_LABEL(PWR_LED_NODE, gpios) @@ -22,25 +22,17 @@ #define FLAGS 0 #endif -static int pwr_led_init(const struct device *_arg) { - ARG_UNUSED(_arg); - - const struct device *dev; - int ret; - +static int pwr_led_init(const struct device *dev) { dev = device_get_binding(PWR_LED); if (dev == NULL) { - return; + return -EIO; } - ret = gpio_pin_configure(dev, PWR_LED_PIN, GPIO_OUTPUT_ACTIVE); - if (ret < 0) { - return; + if (gpio_pin_configure(dev, PWR_LED_PIN, GPIO_OUTPUT) < 0) { + return -EIO; } - gpio_pin_set(dev, PIN, (int)true); - - return 0; + return gpio_pin_set(dev, PIN, (int)true); } SYS_INIT(pwr_led_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); diff --git a/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_transform.dtsi b/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_transform.dtsi deleted file mode 100644 index 837eb6e0..00000000 --- a/keyboards/zmk-config/config/boards/shields/pockettype/pockettype_transform.dtsi +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#include - -/ { - default_transform: keymap_transform_0 { - compatible = "zmk,matrix-transform"; - columns = <12>; - rows = <4>; - - 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,11) -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,11) -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,11) -RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) - >; - }; - - chosen { - zmk,kscan = &kscan0; - zmk,matrix_transform = &default_transform; - }; -}; diff --git a/keyboards/zmk-config/config/boards/shields/tg4x/tg4x_peripheral.conf b/keyboards/zmk-config/config/boards/shields/tg4x/tg4x_peripheral.conf deleted file mode 100644 index 474dedaa..00000000 --- a/keyboards/zmk-config/config/boards/shields/tg4x/tg4x_peripheral.conf +++ /dev/null @@ -1,2 +0,0 @@ -CONFIG_USB=y -CONFIG_ZMK_SPLIT=y diff --git a/keyboards/zmk-config/config/boards/shields/tg4x/tg4x_peripheral.overlay b/keyboards/zmk-config/config/boards/shields/tg4x/tg4x_peripheral.overlay deleted file mode 100644 index 10919e52..00000000 --- a/keyboards/zmk-config/config/boards/shields/tg4x/tg4x_peripheral.overlay +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright (c) 2020 Pete Johanson - * - * SPDX-License-Identifier: MIT - */ - -#include "tg4x.dtsi" -#include "tg4x.keymap" - -&default_transform { - col-offset = <0>; -};