From fee865f6f3d08c81a5b0b8278916447dbb4a9e5f Mon Sep 17 00:00:00 2001 From: KemoNine Date: Mon, 29 Mar 2021 00:07:13 +0000 Subject: [PATCH] Cleanup / fixup the paintbrush artsey setup --- .github/workflows/build.yml | 4 +- .../shields/the_paintbrush/Kconfig.defconfig | 2 +- .../shields/the_paintbrush/Kconfig.shield | 7 ++- ...intbrush.conf => the_paintbrush_left.conf} | 0 .../the_paintbrush/the_paintbrush_left.keymap | 31 ++++++++++++ .../the_paintbrush_left.overlay | 50 +++++++++++++++++++ .../the_paintbrush/the_paintbrush_right.conf | 17 +++++++ ...ush.keymap => the_paintbrush_right.keymap} | 2 +- ...h.overlay => the_paintbrush_right.overlay} | 0 9 files changed, 108 insertions(+), 5 deletions(-) rename config/boards/shields/the_paintbrush/{the_paintbrush.conf => the_paintbrush_left.conf} (100%) create mode 100644 config/boards/shields/the_paintbrush/the_paintbrush_left.keymap create mode 100644 config/boards/shields/the_paintbrush/the_paintbrush_left.overlay create mode 100755 config/boards/shields/the_paintbrush/the_paintbrush_right.conf rename config/boards/shields/the_paintbrush/{the_paintbrush.keymap => the_paintbrush_right.keymap} (90%) rename config/boards/shields/the_paintbrush/{the_paintbrush.overlay => the_paintbrush_right.overlay} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27e3468..fca00ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,9 @@ jobs: - board: nice_nano shield: corne_artsey_right - board: nice_nano - shield: the_paintbrush + shield: the_paintbrush_left + - board: nice_nano + shield: the_paintbrush_right - board: nice_nano shield: corne_5_col_artsey_left - board: nice_nano diff --git a/config/boards/shields/the_paintbrush/Kconfig.defconfig b/config/boards/shields/the_paintbrush/Kconfig.defconfig index 2147204..07c7e4f 100644 --- a/config/boards/shields/the_paintbrush/Kconfig.defconfig +++ b/config/boards/shields/the_paintbrush/Kconfig.defconfig @@ -1,4 +1,4 @@ -if SHIELD_THE_PAINTBRUSH +if SHIELD_THE_PAINTBRUSH_LEFT || SHIELD_THE_PAINTBRUSH_RIGHT config ZMK_KEYBOARD_NAME default "The Paintbrush" diff --git a/config/boards/shields/the_paintbrush/Kconfig.shield b/config/boards/shields/the_paintbrush/Kconfig.shield index 4104e98..25ea641 100755 --- a/config/boards/shields/the_paintbrush/Kconfig.shield +++ b/config/boards/shields/the_paintbrush/Kconfig.shield @@ -1,5 +1,8 @@ # Copyright (c) 2021 Mike "KemoNine" Crosson # SPDX-License-Identifier: MIT -config SHIELD_THE_PAINTBRUSH - def_bool $(shields_list_contains,the_paintbrush) +config SHIELD_THE_PAINTBRUSH_LEFT + def_bool $(shields_list_contains,the_paintbrush_left) + +config SHIELD_THE_PAINTBRUSH_RIGHT + def_bool $(shields_list_contains,the_paintbrush_right) diff --git a/config/boards/shields/the_paintbrush/the_paintbrush.conf b/config/boards/shields/the_paintbrush/the_paintbrush_left.conf similarity index 100% rename from config/boards/shields/the_paintbrush/the_paintbrush.conf rename to config/boards/shields/the_paintbrush/the_paintbrush_left.conf diff --git a/config/boards/shields/the_paintbrush/the_paintbrush_left.keymap b/config/boards/shields/the_paintbrush/the_paintbrush_left.keymap new file mode 100644 index 0000000..a1aa7de --- /dev/null +++ b/config/boards/shields/the_paintbrush/the_paintbrush_left.keymap @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021 Mike "KemoNine" Crosson + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + +// Left/Right +#define ARTSEY_LEFT 1 + +// ARTS Row +#define KEY_A 3 +#define KEY_R 2 +#define KEY_T 1 +#define KEY_S 0 +// EYIO Row +#define KEY_E 7 +#define KEY_Y 6 +#define KEY_I 5 +#define KEY_O 4 + +// Define Offsets +#define LEADING_NONES NONE(0,0,0) +#define MIDDLE_NONES NONE(0, 0, 0) +#define TRAILING_NONES NONE(0, 0, 0) + +// Include main artsey.io keymap +#include "../../../artsey.dtsi" diff --git a/config/boards/shields/the_paintbrush/the_paintbrush_left.overlay b/config/boards/shields/the_paintbrush/the_paintbrush_left.overlay new file mode 100644 index 0000000..53dce07 --- /dev/null +++ b/config/boards/shields/the_paintbrush/the_paintbrush_left.overlay @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Mike "KemoNine" Crosson + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-direct"; + + label = "KSCAN"; + + input-gpios + = <&pro_micro_a 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_a 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_a 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_a 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_d 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_d 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_d 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pro_micro_d 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + }; +}; + +&pro_micro_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + label = "DISPLAY"; + width = <128>; + height = <32>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <31>; + segment-remap; + com-invdir; + com-sequential; + prechargep = <0x22>; + }; +}; diff --git a/config/boards/shields/the_paintbrush/the_paintbrush_right.conf b/config/boards/shields/the_paintbrush/the_paintbrush_right.conf new file mode 100755 index 0000000..e7bb92f --- /dev/null +++ b/config/boards/shields/the_paintbrush/the_paintbrush_right.conf @@ -0,0 +1,17 @@ +# Copyright (c) 2021 Mike "KemoNine" Crosson +# SPDX-License-Identifier: MIT + +# Tune combos to allow proper ARTSEY support +CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=16 +CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO=8 +CONFIG_ZMK_COMBO_MAX_PRESSED_COMBOS=8 + +# Enable display (layer in use is helpful) +CONFIG_ZMK_DISPLAY=y + +# Turn on deep sleep +CONFIG_ZMK_SLEEP=y +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 + +# Set screen blanking to 15s instead of 30s +#CONFIG_ZMK_IDLE_TIMEOUT=15000 diff --git a/config/boards/shields/the_paintbrush/the_paintbrush.keymap b/config/boards/shields/the_paintbrush/the_paintbrush_right.keymap similarity index 90% rename from config/boards/shields/the_paintbrush/the_paintbrush.keymap rename to config/boards/shields/the_paintbrush/the_paintbrush_right.keymap index 6af0eba..260bb37 100644 --- a/config/boards/shields/the_paintbrush/the_paintbrush.keymap +++ b/config/boards/shields/the_paintbrush/the_paintbrush_right.keymap @@ -8,7 +8,7 @@ #include #include -// THE BOARD IS FLIPPED FOR LEFT BUT STILL WIRED RIGHT! +// Left/Right #define ARTSEY_RIGHT 1 // ARTS Row diff --git a/config/boards/shields/the_paintbrush/the_paintbrush.overlay b/config/boards/shields/the_paintbrush/the_paintbrush_right.overlay similarity index 100% rename from config/boards/shields/the_paintbrush/the_paintbrush.overlay rename to config/boards/shields/the_paintbrush/the_paintbrush_right.overlay