From 595dff68710f7f58e7e257c3d060e80e413dfb87 Mon Sep 17 00:00:00 2001 From: CrossR Date: Sun, 13 Sep 2020 18:07:45 +0100 Subject: [PATCH 01/17] Add PowerShell script and tidy up bash script. --- docs/static/setup.ps1 | 176 ++++++++++++++++++++++++++++++++++++++++++ docs/static/setup.sh | 64 ++++++++------- 2 files changed, 213 insertions(+), 27 deletions(-) create mode 100644 docs/static/setup.ps1 diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 new file mode 100644 index 00000000..acda1944 --- /dev/null +++ b/docs/static/setup.ps1 @@ -0,0 +1,176 @@ +$ErrorActionPreference = "Stop" + +function Get-Choice-From-Options { + param( + [String[]] $Options, + [String] $Prompt + ) + + while ($true) { + for ($i = 0; $i -lt $Options.length; $i++) { + Write-Host "$($i + 1)) $($Options[$i])" + } + + Write-Host "$($Options.length + 1)) Quit" + $selection = Read-Host $Prompt + + if ($selection -eq $Options.length + 1) { + Write-Host "Goodbye!" + exit + } + elseif ($selection -le $Options.length) { + $choice = $($selection - 1) + break + } + else { + Write-Host "Invalid Option. Try another one." + } + } + + return $choice +} + +function Test-Git-Config { + param( + [String] $Option, + [String] $ErrMsg + ) + + git config $Option | Out-Null + + if ($lastExitCode -ne 0) { + Write-Host $ErrMsg + exit + } +} + +try { + git | Out-Null +} +catch [System.Management.Automation.CommandNotFoundException] { + Write-Host "Git is not installed, and is required for this script!" + exit +} + +Test-Git-Config -Option "user.name" -ErrMsg "Git username not set!`nRun: git config --global user.name 'My Name'" +Test-Git-Config -Option "user.email" -ErrMsg "Git email not set!`nRun: git config --global user.name 'example@myemail.com'" + +$repo_path = "https://github.com/zmkfirmware/zmk-config-split-template.git" + +$title = "ZMK Config Setup:" +$prompt = "Pick an MCU board" +$options = "nice!nano", "QMK Proton-C", "BlueMicro840 (v1)" +$boards = "nice_nano", "proton_c", "bluemicro840_v1" + +Write-Host "$title" +Write-Host "" +Write-Host "MCU Board Selection:" + +$choice = Get-Choice-From-Options -Options $options -Prompt $prompt +$board = $($boards[$choice]) + +Write-Host "" +Write-Host "Keyboard Shield Selection:" +$prompt = "Pick a keyboard" + +# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. +$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "RoMac" +$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "romac" +$splits = "y", "y", "y", "y", "y", "y", "n" + +$choice = Get-Choice-From-Options -Options $options -Prompt $prompt +$shield_title = $($options[$choice]) +$shield = $($names[$choice]) +$split = $($splits[$choice]) + +if ($split -eq "n") { + $repo_path = "https://github.com/zmkfirmware/zmk-config-template.git" +} + +$copy_keymap = Read-Host "Copy in the stock keymap for customisation? [Yn]" + +if ($copy_keymap -eq "" -or $copy_keymap -eq "Y" -or $copy_keymap -eq "y") { + $copy_keymap = "yes" +} + +$github_user = Read-Host "GitHub Username (leave empty to skip GitHub repo creation)" + +if ($github_user -ne "") { + $repo_name = Read-Host "GitHub Repo Name [zmk-config]" + + if ($repo_name -eq "") { + $repo_name = "zmk-config" + } + + $github_repo = Read-Host "GitHub Repo [https://github.com/$github_user/$repo_name.git]" + + if ($github_repo -eq "") { + $github_repo = "https://github.com/$github_user/$repo_name.git" + } +} +else { + $repo_name = "zmk-config" + $github_repo = "" +} + +Write-Host "" +Write-Host "Preparing a user config for:" +Write-Host "* MCU Board: ${board}" +Write-Host "* Shield: ${shield}" + +if ($copy_keymap -eq "yes") { + Write-Host "* Copy Keymap?: Yes" +} +else { + Write-Host "* Copy Keymap?: No" +} + +if ($github_repo -ne "") { + Write-Host "* GitHub Repo to Push (please create this in GH first!): $github_repo" +} + +Write-Host "" +$do_it = Read-Host "Continue? [Yn]" + +if ($do_it -ne "" -and $do_it -ne "Y" -and $do_it -ne "y") { + Write-Host "Aborting..." + exit +} + +git clone --single-branch "$repo_path" "$repo_name" +Set-Location "$repo_name" + +Push-Location config + +Invoke-RestMethod -Uri "https://raw.githubusercontent.com/zmkfirmware/zmk/main/app/boards/shields/${shield}/${shield}.conf" -OutFile "${shield}.conf" + +if ($copy_keymap -eq "yes") { + Invoke-RestMethod -Uri "https://raw.githubusercontent.com/zmkfirmware/zmk/main/app/boards/shields/${shield}/${shield}.keymap" -OutFile "${shield}.keymap" +} + +Pop-Location + +$build_file = (Get-Content .github/workflows/build.yml).replace("BOARD_NAME", $board) +$build_file = $build_file.replace("SHIELD_NAME", $shield) +$build_file = $build_file.replace("KEYBOARD_TITLE", $shield_title) + +if ($board -eq "proton_c") { + $build_file = $build_file.replace("uf2", "hex") +} + +Set-Content -Path .github/workflows/build.yml -Value $build_file + +Remove-Item -Recurse -Force .git +git init . +git add . +git commit -m "Initial User Config." + +if ($github_repo -ne "") { + git remote add origin "$github_repo" + git push --set-upstream origin $(git symbolic-ref --short HEAD) + + if ($github_repo -imatch "https") { + $actions = "$($github_repo.substring(0, $github_repo.length - 4))/actions" + Write-Host "Your firmware should be availalbe from the GitHub Actions shortly: $actions" + } +} diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 5d203a4c..b3c14f77 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -1,15 +1,26 @@ -#!/bin/sh +#!/bin/bash set -e +CheckExists() { + command_to_run=$1 + error_message=$2 + + if ! eval "$command_to_run" &> /dev/null; then + printf "%s\n" "$error_message" + exit + fi +} + +CheckExists "command -v git" "git is not installed, and is required for this script!" +CheckExists "command -v curl" "curl is not installed, and is required for this script!" + +CheckExists "git config user.name" "Git username not set!\nRun: git config --global user.name 'My Name'" +CheckExists "git config user.email" "Git email not set!\nRun: git config --global user.email 'example@myemail.com'" + repo_path="https://github.com/zmkfirmware/zmk-config-split-template.git" title="ZMK Config Setup:" - -# TODO: Check for git being installed -# TODO: Check for curl being installed -# TODO: Check for user.name and user.email git configs being set - prompt="Pick an MCU board:" options=("nice!nano" "QMK Proton-C" "BlueMicro840 (v1)") @@ -31,9 +42,6 @@ select opt in "${options[@]}" "Quit"; do esac done -#read -p "Is this board a complete keyboard [yN]: " complete -#echo "$complete" - echo "" echo "Keyboard Shield Selection:" @@ -67,41 +75,43 @@ if [ "$split" == "n" ]; then repo_path="https://github.com/zmkfirmware/zmk-config-template.git" fi -read -e -p "Copy in the stock keymap for customization? [Yn]: " copy_keymap +read -r -e -p "Copy in the stock keymap for customization? [Yn]: " copy_keymap if [ -z "$copy_keymap" ] || [ "$copy_keymap" == "Y" ] || [ "$copy_keymap" == "y" ]; then copy_keymap="yes"; fi -read -e -p "GitHub Username (leave empty to skip GitHub repo creation): " github_user +read -r -e -p "GitHub Username (leave empty to skip GitHub repo creation): " github_user if [ -n "$github_user" ]; then - read -p "GitHub Repo Name [zmk-config]: " repo_name - if [ -z "$repo_name" ]; then repo_name="zmk-config"; fi + read -r -p "GitHub Repo Name [zmk-config]: " repo_name + if [ -z "$repo_name" ]; then repo_name="zmk-config"; fi - read -p "GitHub Repo [https://github.com/${github_user}/${repo_name}.git]: " github_repo + read -r -p "GitHub Repo [https://github.com/${github_user}/${repo_name}.git]: " github_repo - if [ -z "$github_repo" ]; then github_repo="https://github.com/${github_user}/${repo_name}.git"; fi + if [ -z "$github_repo" ]; then github_repo="https://github.com/${github_user}/${repo_name}.git"; fi else - repo_name="zmk-config" + repo_name="zmk-config" fi echo "" echo "Preparing a user config for:" echo "* MCU Board: ${board}" echo "* Shield: ${shield}" + if [ "$copy_keymap" == "yes" ]; then echo "* Copy Keymap?: ✓" else echo "* Copy Keymap?: ❌" fi + if [ -n "$github_repo" ]; then - echo "* GitHub Repo To Push (please create this in GH first!): ${github_repo}" + echo "* GitHub Repo To Push (please create this in GH first!): ${github_repo}" fi echo "" -read -p "Continue? [Yn]: " do_it +read -r -p "Continue? [Yn]: " do_it if [ -n "$do_it" ] && [ "$do_it" != "y" ] && [ "$do_it" != "Y" ]; then - echo "Aborting..." - exit + echo "Aborting..." + exit fi git clone --single-branch $repo_path ${repo_name} @@ -118,10 +128,10 @@ fi popd sed -i'.orig' \ - -e "s/BOARD_NAME/$board/" \ - -e "s/SHIELD_NAME/$shield/" \ - -e "s/KEYBOARD_TITLE/$shield_title/" \ - .github/workflows/build.yml + -e "s/BOARD_NAME/$board/" \ + -e "s/SHIELD_NAME/$shield/" \ + -e "s/KEYBOARD_TITLE/$shield_title/" \ + .github/workflows/build.yml if [ "$board" == "proton_c" ]; then # Proton-C board still fa @@ -136,11 +146,11 @@ git add . git commit -m "Initial User Config." if [ -n "$github_repo" ]; then - git remote add origin "$github_repo" - git push --set-upstream origin $(git symbolic-ref --short HEAD) + git remote add origin "$github_repo" + git push --set-upstream origin "$(git symbolic-ref --short HEAD)" # TODO: Support determing the actions URL when non-https:// repo URL is used. if [ "${github_repo}" != "${github_repo#https://}" ]; then - echo "Your firmware should be available from the GitHub Actions shortly: ${github_url%.git}/actions" + echo "Your firmware should be available from the GitHub Actions shortly: ${github_repo%.git}/actions" fi fi From 550c35db23f15c6835a43fe1d2e4a3b5a04ac2b8 Mon Sep 17 00:00:00 2001 From: CrossR Date: Sun, 20 Sep 2020 12:52:25 +0100 Subject: [PATCH 02/17] Fix PR comments, add error checking for push. --- docs/static/setup.ps1 | 23 ++++++++++++++++++----- docs/static/setup.sh | 34 +++++++++++++++++++++++----------- 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index acda1944..a2d66eec 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -16,7 +16,7 @@ function Get-Choice-From-Options { if ($selection -eq $Options.length + 1) { Write-Host "Goodbye!" - exit + exit 1 } elseif ($selection -le $Options.length) { $choice = $($selection - 1) @@ -40,7 +40,7 @@ function Test-Git-Config { if ($lastExitCode -ne 0) { Write-Host $ErrMsg - exit + exit 1 } } @@ -49,7 +49,7 @@ try { } catch [System.Management.Automation.CommandNotFoundException] { Write-Host "Git is not installed, and is required for this script!" - exit + exit 1 } Test-Git-Config -Option "user.name" -ErrMsg "Git username not set!`nRun: git config --global user.name 'My Name'" @@ -134,7 +134,7 @@ $do_it = Read-Host "Continue? [Yn]" if ($do_it -ne "" -and $do_it -ne "Y" -and $do_it -ne "y") { Write-Host "Aborting..." - exit + exit 1 } git clone --single-branch "$repo_path" "$repo_name" @@ -167,10 +167,23 @@ git commit -m "Initial User Config." if ($github_repo -ne "") { git remote add origin "$github_repo" + git push --set-upstream origin $(git symbolic-ref --short HEAD) + # If push failed, assume that the origin was incorrect and give instructions on fixing. + if ($lastExitCode -ne 0) { + Write-Host "Remote repository $github_repo not found..." + Write-Host "Check GitHub URL, and try adding again." + Write-Host "Run the following: " + Write-Host " git remote rm origin" + Write-Host " git remote add origin FIXED_URL" + Write-Host " git push --set-upstream origin $(git symbolic-ref --short HEAD)" + Write-Host "Once pushed, your firmware should be availalbe from GitHub Actions at: $actions" + exit 1 + } + if ($github_repo -imatch "https") { $actions = "$($github_repo.substring(0, $github_repo.length - 4))/actions" - Write-Host "Your firmware should be availalbe from the GitHub Actions shortly: $actions" + Write-Host "Your firmware should be availalbe from GitHub Actions shortly: $actions" } } diff --git a/docs/static/setup.sh b/docs/static/setup.sh index b3c14f77..df985a67 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -2,21 +2,21 @@ set -e -CheckExists() { +check_exists() { command_to_run=$1 error_message=$2 if ! eval "$command_to_run" &> /dev/null; then printf "%s\n" "$error_message" - exit + exit 1 fi } -CheckExists "command -v git" "git is not installed, and is required for this script!" -CheckExists "command -v curl" "curl is not installed, and is required for this script!" +check_exists "command -v git" "git is not installed, and is required for this script!" +check_exists "command -v curl" "curl is not installed, and is required for this script!" -CheckExists "git config user.name" "Git username not set!\nRun: git config --global user.name 'My Name'" -CheckExists "git config user.email" "Git email not set!\nRun: git config --global user.email 'example@myemail.com'" +check_exists "git config user.name" "Git username not set!\nRun: git config --global user.name 'My Name'" +check_exists "git config user.email" "Git email not set!\nRun: git config --global user.email 'example@myemail.com'" repo_path="https://github.com/zmkfirmware/zmk-config-split-template.git" title="ZMK Config Setup:" @@ -36,8 +36,8 @@ select opt in "${options[@]}" "Quit"; do 2 ) board="proton_c"; break;; 3 ) board="bluemicro840_v1"; break;; - $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit;; - *) echo "Invalid option. Try another one.";continue;; + $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;; + *) echo "Invalid option. Try another one."; continue;; esac done @@ -65,7 +65,7 @@ select opt in "${options[@]}" "Quit"; do # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; - $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit;; + $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;; *) echo "Invalid option. Try another one.";continue;; esac @@ -111,7 +111,7 @@ read -r -p "Continue? [Yn]: " do_it if [ -n "$do_it" ] && [ "$do_it" != "y" ] && [ "$do_it" != "Y" ]; then echo "Aborting..." - exit + exit 1 fi git clone --single-branch $repo_path ${repo_name} @@ -149,8 +149,20 @@ if [ -n "$github_repo" ]; then git remote add origin "$github_repo" git push --set-upstream origin "$(git symbolic-ref --short HEAD)" + # If push failed, assume that the origin was incorrect and give instructions on fixing. + if [ $? -ne 0 ] { + echo "Remote repository $github_repo not found..." + echo "Check GitHub URL, and try adding again." + echo "Run the following: " + echo " git remote rm origin" + echo " git remote add origin FIXED_URL" + echo " git push --set-upstream origin $(git symbolic-ref --short HEAD)" + echo "Once pushed, your firmware should be availalbe from GitHub Actions at: ${github_repo%.git}/actions" + exit 1 + } + # TODO: Support determing the actions URL when non-https:// repo URL is used. if [ "${github_repo}" != "${github_repo#https://}" ]; then - echo "Your firmware should be available from the GitHub Actions shortly: ${github_repo%.git}/actions" + echo "Your firmware should be available from GitHub Actions shortly: ${github_repo%.git}/actions" fi fi From c044fe853275a6322834bfdeaf61b9f62becf085 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Mon, 21 Sep 2020 22:29:54 -0700 Subject: [PATCH 03/17] Add RoMac plus v4 support on nice nano v1 --- .../shields/romac_plus/Kconfig.defconfig | 9 +++ app/boards/shields/romac_plus/Kconfig.shield | 5 ++ .../romac_plus/boards/nice_nano.overlay | 28 +++++++++ app/boards/shields/romac_plus/romac_plus.conf | 3 + app/boards/shields/romac_plus/romac_plus.dtsi | 61 +++++++++++++++++++ .../shields/romac_plus/romac_plus.keymap | 48 +++++++++++++++ .../shields/romac_plus/romac_plus.overlay | 37 +++++++++++ 7 files changed, 191 insertions(+) create mode 100644 app/boards/shields/romac_plus/Kconfig.defconfig create mode 100644 app/boards/shields/romac_plus/Kconfig.shield create mode 100644 app/boards/shields/romac_plus/boards/nice_nano.overlay create mode 100644 app/boards/shields/romac_plus/romac_plus.conf create mode 100644 app/boards/shields/romac_plus/romac_plus.dtsi create mode 100644 app/boards/shields/romac_plus/romac_plus.keymap create mode 100644 app/boards/shields/romac_plus/romac_plus.overlay diff --git a/app/boards/shields/romac_plus/Kconfig.defconfig b/app/boards/shields/romac_plus/Kconfig.defconfig new file mode 100644 index 00000000..45b15b8d --- /dev/null +++ b/app/boards/shields/romac_plus/Kconfig.defconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2020 Pete Johanson, Richard Jones +# SPDX-License-Identifier: MIT + +if SHIELD_ROMAC_PLUS + +config ZMK_KEYBOARD_NAME + default "RoMac_plus-v4" + +endif \ No newline at end of file diff --git a/app/boards/shields/romac_plus/Kconfig.shield b/app/boards/shields/romac_plus/Kconfig.shield new file mode 100644 index 00000000..c89ef023 --- /dev/null +++ b/app/boards/shields/romac_plus/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2020 Pete Johanson, Richard Jones +# SPDX-License-Identifier: MIT + +config SHIELD_ROMAC_PLUS + def_bool $(shields_list_contains,romac_plus) diff --git a/app/boards/shields/romac_plus/boards/nice_nano.overlay b/app/boards/shields/romac_plus/boards/nice_nano.overlay new file mode 100644 index 00000000..a8dafa2d --- /dev/null +++ b/app/boards/shields/romac_plus/boards/nice_nano.overlay @@ -0,0 +1,28 @@ +&spi1 { + compatible = "nordic,nrf-spi"; + 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 = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.conf b/app/boards/shields/romac_plus/romac_plus.conf new file mode 100644 index 00000000..8ec9fa98 --- /dev/null +++ b/app/boards/shields/romac_plus/romac_plus.conf @@ -0,0 +1,3 @@ +# Uncomment to enable encoder +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.dtsi b/app/boards/shields/romac_plus/romac_plus.dtsi new file mode 100644 index 00000000..3895f860 --- /dev/null +++ b/app/boards/shields/romac_plus/romac_plus.dtsi @@ -0,0 +1,61 @@ +/* + * 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 = <3>; + rows = <4>; + + map = < +RC(0,0) RC(0,1) RC(0,2) +RC(1,0) RC(1,1) RC(1,2) +RC(2,0) RC(2,1) RC(2,2) +RC(3,0) RC(3,1) RC(3,2) + >; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + row-gpios + = <&pro_micro_d 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + }; + + left_encoder: encoder_left { + compatible = "alps,ec11"; + label = "LEFT_ENCODER"; + a-gpios = <&pro_micro_d 16 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro_d 14 (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"; + }; + + // TODO: per-key RGB node(s)? +}; \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.keymap b/app/boards/shields/romac_plus/romac_plus.keymap new file mode 100644 index 00000000..77485dce --- /dev/null +++ b/app/boards/shields/romac_plus/romac_plus.keymap @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 Pete Johanson, Richard Jones + * + * SPDX-License-Identifier: MIT + */ + +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { +// ------------------- +// | 7 | 8 | 9 | +// | 4 | 5 | 6 | +// | 1 | 2 | 3 | +// | MO(1) | 0 | . | +// ---------------------- + bindings = < + &kp NUM_7 &kp NUM_8 &kp NUM_9 + &kp NUM_4 &kp NUM_5 &kp NUM_6 + &kp NUM_1 &kp NUM_2 &kp NUM_3 + &cp M_PLAY &kp NUM_0 &kp DOT + >; + + sensor-bindings = <&inc_dec_cp M_NEXT M_PREV>; + }; + + // nav_layer { +// ----------------------- +// | _ | HOME | PGUP | +// | _ | END | PGDN | +// | _ | _ | _ | +// | _ | _ | RET | +// ----------------------- + // bindings = < + // &trans &kp HOME &kp PGUP + // &trans &kp END &kp PGDN + // &trans &trans &trans .0 + // &trans &trans &kp RET + // >; + + // sensor-bindings = <&inc_dec_kp A B>; + // }; + }; +}; \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.overlay b/app/boards/shields/romac_plus/romac_plus.overlay new file mode 100644 index 00000000..23ef3e68 --- /dev/null +++ b/app/boards/shields/romac_plus/romac_plus.overlay @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020 Pete Johanson, Richard Jones + * + * SPDX-License-Identifier: MIT + */ + +#include "romac_plus.dtsi" + +/ { + chosen { + zmk,kscan = &kscan0; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + + diode-direction = "col2row"; + + col-gpios + = <&pro_micro_a 1 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> + , <&pro_micro_a 3 GPIO_ACTIVE_HIGH> + ; + + }; + + bt_unpair_combo: bt_unpair_combo { + compatible = "zmk,bt-unpair-combo"; + key-positions = <0 11>; + }; + +}; + +&left_encoder { + status = "okay"; +}; \ No newline at end of file From 551756b0ec7131e6129d31c0a28083d072d160a2 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Mon, 21 Sep 2020 22:52:50 -0700 Subject: [PATCH 04/17] Add romac_plus to build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a43f5d5..9af3d22b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,7 @@ jobs: - iris_left - iris_right - romac + - romac_plus - settings_reset include: - board: proton_c From f1fd71c231ab75d2e2563d7b40cb1460dca0eed7 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 12:39:06 -0700 Subject: [PATCH 05/17] Disabled ec11 since it's an optional configuration --- app/boards/shields/romac_plus/romac_plus.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/boards/shields/romac_plus/romac_plus.conf b/app/boards/shields/romac_plus/romac_plus.conf index 8ec9fa98..cff5b30c 100644 --- a/app/boards/shields/romac_plus/romac_plus.conf +++ b/app/boards/shields/romac_plus/romac_plus.conf @@ -1,3 +1,3 @@ # Uncomment to enable encoder -CONFIG_EC11=y -CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y \ No newline at end of file +#CONFIG_EC11=y +#CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y \ No newline at end of file From 4c092044ce22f0c60c3bf0ef860ecc543328d5bf Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 16:21:42 -0700 Subject: [PATCH 06/17] Adopt single authors headers --- app/boards/shields/romac_plus/Kconfig.defconfig | 2 +- app/boards/shields/romac_plus/Kconfig.shield | 2 +- app/boards/shields/romac_plus/romac_plus.conf | 3 +++ app/boards/shields/romac_plus/romac_plus.dtsi | 2 +- app/boards/shields/romac_plus/romac_plus.keymap | 2 +- app/boards/shields/romac_plus/romac_plus.overlay | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/boards/shields/romac_plus/Kconfig.defconfig b/app/boards/shields/romac_plus/Kconfig.defconfig index 45b15b8d..1d04082c 100644 --- a/app/boards/shields/romac_plus/Kconfig.defconfig +++ b/app/boards/shields/romac_plus/Kconfig.defconfig @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Pete Johanson, Richard Jones +# Copyright (c) 2020 The ZMK Contributors # SPDX-License-Identifier: MIT if SHIELD_ROMAC_PLUS diff --git a/app/boards/shields/romac_plus/Kconfig.shield b/app/boards/shields/romac_plus/Kconfig.shield index c89ef023..a7c7c614 100644 --- a/app/boards/shields/romac_plus/Kconfig.shield +++ b/app/boards/shields/romac_plus/Kconfig.shield @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Pete Johanson, Richard Jones +# Copyright (c) 2020 The ZMK Contributors # SPDX-License-Identifier: MIT config SHIELD_ROMAC_PLUS diff --git a/app/boards/shields/romac_plus/romac_plus.conf b/app/boards/shields/romac_plus/romac_plus.conf index cff5b30c..d784dc48 100644 --- a/app/boards/shields/romac_plus/romac_plus.conf +++ b/app/boards/shields/romac_plus/romac_plus.conf @@ -1,3 +1,6 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + # Uncomment to enable encoder #CONFIG_EC11=y #CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.dtsi b/app/boards/shields/romac_plus/romac_plus.dtsi index 3895f860..be056185 100644 --- a/app/boards/shields/romac_plus/romac_plus.dtsi +++ b/app/boards/shields/romac_plus/romac_plus.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Pete Johanson + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/romac_plus/romac_plus.keymap b/app/boards/shields/romac_plus/romac_plus.keymap index 77485dce..947b20a9 100644 --- a/app/boards/shields/romac_plus/romac_plus.keymap +++ b/app/boards/shields/romac_plus/romac_plus.keymap @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Pete Johanson, Richard Jones + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/romac_plus/romac_plus.overlay b/app/boards/shields/romac_plus/romac_plus.overlay index 23ef3e68..7b570015 100644 --- a/app/boards/shields/romac_plus/romac_plus.overlay +++ b/app/boards/shields/romac_plus/romac_plus.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Pete Johanson, Richard Jones + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ From 0ce36865b2026c8739c01cebd3031180aa0f3b1f Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 16:23:54 -0700 Subject: [PATCH 07/17] Update keyboard name to be more user friendly --- app/boards/shields/romac_plus/Kconfig.defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/boards/shields/romac_plus/Kconfig.defconfig b/app/boards/shields/romac_plus/Kconfig.defconfig index 1d04082c..c4efdb97 100644 --- a/app/boards/shields/romac_plus/Kconfig.defconfig +++ b/app/boards/shields/romac_plus/Kconfig.defconfig @@ -4,6 +4,6 @@ if SHIELD_ROMAC_PLUS config ZMK_KEYBOARD_NAME - default "RoMac_plus-v4" + default "RoMac+ v4" endif \ No newline at end of file From 9fffebd5dac13d0a57f6f6aaff0654a2bd0986c1 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 16:31:02 -0700 Subject: [PATCH 08/17] Adopt new BT unpairing standards --- app/boards/shields/romac_plus/romac_plus.dtsi | 3 --- app/boards/shields/romac_plus/romac_plus.keymap | 5 +++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/boards/shields/romac_plus/romac_plus.dtsi b/app/boards/shields/romac_plus/romac_plus.dtsi index be056185..d04b2142 100644 --- a/app/boards/shields/romac_plus/romac_plus.dtsi +++ b/app/boards/shields/romac_plus/romac_plus.dtsi @@ -53,9 +53,6 @@ RC(3,0) RC(3,1) RC(3,2) sensors = <&left_encoder>; }; - bt_unpair_combo: bt_unpair_combo { - compatible = "zmk,bt-unpair-combo"; - }; // TODO: per-key RGB node(s)? }; \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.keymap b/app/boards/shields/romac_plus/romac_plus.keymap index 947b20a9..3fa9441b 100644 --- a/app/boards/shields/romac_plus/romac_plus.keymap +++ b/app/boards/shields/romac_plus/romac_plus.keymap @@ -5,6 +5,7 @@ */ #include +#include #include / { @@ -30,13 +31,13 @@ // nav_layer { // ----------------------- -// | _ | HOME | PGUP | +// | BT_CLR | HOME | PGUP | // | _ | END | PGDN | // | _ | _ | _ | // | _ | _ | RET | // ----------------------- // bindings = < - // &trans &kp HOME &kp PGUP + // &bt BT_CLR &kp HOME &kp PGUP // &trans &kp END &kp PGDN // &trans &trans &trans .0 // &trans &trans &kp RET From 641524b1b9564fd2b433b9bc430736fb3205a3c5 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 16:37:46 -0700 Subject: [PATCH 09/17] Update Keymap legends for consistency --- app/boards/shields/romac_plus/romac_plus.dtsi | 2 - .../shields/romac_plus/romac_plus.keymap | 44 +++++++++---------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/app/boards/shields/romac_plus/romac_plus.dtsi b/app/boards/shields/romac_plus/romac_plus.dtsi index d04b2142..9b148ca0 100644 --- a/app/boards/shields/romac_plus/romac_plus.dtsi +++ b/app/boards/shields/romac_plus/romac_plus.dtsi @@ -36,7 +36,6 @@ RC(3,0) RC(3,1) RC(3,2) , <&pro_micro_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&pro_micro_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> ; - }; left_encoder: encoder_left { @@ -52,7 +51,6 @@ RC(3,0) RC(3,1) RC(3,2) compatible = "zmk,keymap-sensors"; sensors = <&left_encoder>; }; - // TODO: per-key RGB node(s)? }; \ No newline at end of file diff --git a/app/boards/shields/romac_plus/romac_plus.keymap b/app/boards/shields/romac_plus/romac_plus.keymap index 3fa9441b..d8d1f787 100644 --- a/app/boards/shields/romac_plus/romac_plus.keymap +++ b/app/boards/shields/romac_plus/romac_plus.keymap @@ -13,37 +13,37 @@ compatible = "zmk,keymap"; default_layer { -// ------------------- -// | 7 | 8 | 9 | -// | 4 | 5 | 6 | -// | 1 | 2 | 3 | -// | MO(1) | 0 | . | -// ---------------------- +// -------------------------- +// | 7 | 8 | 9 | +// | 4 | 5 | 6 | +// | 1 | 2 | 3 | +// | M_PLAY | 0 | MO(1) | +// -------------------------- bindings = < &kp NUM_7 &kp NUM_8 &kp NUM_9 &kp NUM_4 &kp NUM_5 &kp NUM_6 &kp NUM_1 &kp NUM_2 &kp NUM_3 - &cp M_PLAY &kp NUM_0 &kp DOT + &cp M_PLAY &kp NUM_0 &mo 1 >; sensor-bindings = <&inc_dec_cp M_NEXT M_PREV>; }; - // nav_layer { -// ----------------------- -// | BT_CLR | HOME | PGUP | -// | _ | END | PGDN | -// | _ | _ | _ | -// | _ | _ | RET | -// ----------------------- - // bindings = < - // &bt BT_CLR &kp HOME &kp PGUP - // &trans &kp END &kp PGDN - // &trans &trans &trans .0 - // &trans &trans &kp RET - // >; + nav_layer { +// -------------------------- +// | BT_CLR | HOME | PGUP | +// | _ | END | PGDN | +// | _ | _ | _ | +// | _ | _ | _ | +// -------------------------- + bindings = < + &bt BT_CLR &kp HOME &kp PGUP + &trans &kp END &kp PGDN + &trans &trans &trans + &trans &trans &trans + >; - // sensor-bindings = <&inc_dec_kp A B>; - // }; + sensor-bindings = <&inc_dec_kp A B>; + }; }; }; \ No newline at end of file From 8e92ae30893e620ca1c615637a3bcf3f05088225 Mon Sep 17 00:00:00 2001 From: Kristoffer Onias Date: Wed, 23 Sep 2020 17:49:13 -0700 Subject: [PATCH 10/17] Remove bt_unpair_combo from romac_plus.overlay --- app/boards/shields/romac_plus/romac_plus.overlay | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/boards/shields/romac_plus/romac_plus.overlay b/app/boards/shields/romac_plus/romac_plus.overlay index 7b570015..86430349 100644 --- a/app/boards/shields/romac_plus/romac_plus.overlay +++ b/app/boards/shields/romac_plus/romac_plus.overlay @@ -22,12 +22,6 @@ , <&pro_micro_a 2 GPIO_ACTIVE_HIGH> , <&pro_micro_a 3 GPIO_ACTIVE_HIGH> ; - - }; - - bt_unpair_combo: bt_unpair_combo { - compatible = "zmk,bt-unpair-combo"; - key-positions = <0 11>; }; }; From cd194dbac4747126f017ce6e9ddf070ca6cc1fef Mon Sep 17 00:00:00 2001 From: CrossR Date: Thu, 24 Sep 2020 17:42:34 +0100 Subject: [PATCH 11/17] Add licenses. --- docs/static/setup.ps1 | 8 ++++++-- docs/static/setup.sh | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1 index a2d66eec..3946e66c 100644 --- a/docs/static/setup.ps1 +++ b/docs/static/setup.ps1 @@ -1,3 +1,7 @@ +# Copyright (c) 2020 The ZMK Contributors +# +# SPDX-License-Identifier: MIT + $ErrorActionPreference = "Stop" function Get-Choice-From-Options { @@ -10,7 +14,7 @@ function Get-Choice-From-Options { for ($i = 0; $i -lt $Options.length; $i++) { Write-Host "$($i + 1)) $($Options[$i])" } - + Write-Host "$($Options.length + 1)) Quit" $selection = Read-Host $Prompt @@ -103,7 +107,7 @@ if ($github_user -ne "") { } $github_repo = Read-Host "GitHub Repo [https://github.com/$github_user/$repo_name.git]" - + if ($github_repo -eq "") { $github_repo = "https://github.com/$github_user/$repo_name.git" } diff --git a/docs/static/setup.sh b/docs/static/setup.sh index df985a67..5bf36451 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -1,11 +1,15 @@ #!/bin/bash +# Copyright (c) 2020 The ZMK Contributors +# +# SPDX-License-Identifier: MIT + set -e check_exists() { command_to_run=$1 error_message=$2 - + if ! eval "$command_to_run" &> /dev/null; then printf "%s\n" "$error_message" exit 1 @@ -28,7 +32,7 @@ echo "$title" echo "" echo "MCU Board Selection:" PS3="$prompt " -select opt in "${options[@]}" "Quit"; do +select opt in "${options[@]}" "Quit"; do case "$REPLY" in @@ -50,8 +54,8 @@ options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "RoMac") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. -# select opt in "${options[@]}" "Other" "Quit"; do -select opt in "${options[@]}" "Quit"; do +# select opt in "${options[@]}" "Other" "Quit"; do +select opt in "${options[@]}" "Quit"; do case "$REPLY" in @@ -64,7 +68,7 @@ select opt in "${options[@]}" "Quit"; do 7 ) shield_title="RoMac" shield="romac"; split="n"; break;; # Add link to docs on adding your own custom shield in your ZMK config! - # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; + # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; $(( ${#options[@]}+1 )) ) echo "Goodbye!"; exit 1;; *) echo "Invalid option. Try another one.";continue;; @@ -148,9 +152,10 @@ git commit -m "Initial User Config." if [ -n "$github_repo" ]; then git remote add origin "$github_repo" git push --set-upstream origin "$(git symbolic-ref --short HEAD)" + push_return_code=$? # If push failed, assume that the origin was incorrect and give instructions on fixing. - if [ $? -ne 0 ] { + if [ ${push_return_code} -ne 0 ]; then echo "Remote repository $github_repo not found..." echo "Check GitHub URL, and try adding again." echo "Run the following: " @@ -159,7 +164,7 @@ if [ -n "$github_repo" ]; then echo " git push --set-upstream origin $(git symbolic-ref --short HEAD)" echo "Once pushed, your firmware should be availalbe from GitHub Actions at: ${github_repo%.git}/actions" exit 1 - } + fi # TODO: Support determing the actions URL when non-https:// repo URL is used. if [ "${github_repo}" != "${github_repo#https://}" ]; then From d5ec32612d9a1d1bf07674fe4b01a926c727ba99 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Thu, 24 Sep 2020 14:34:38 -0400 Subject: [PATCH 12/17] feat(docs): Add missing shields to hardware page. --- docs/docs/hardware.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/docs/hardware.md b/docs/docs/hardware.md index 299d1f5c..236aa972 100644 --- a/docs/docs/hardware.md +++ b/docs/docs/hardware.md @@ -26,6 +26,11 @@ That being said, there are currently only a few specific [boards](/docs/faq#what - [Kyria](https://splitkb.com/products/kyria-pcb-kit) (`kyria_left` and `kyria_right`) - [Corne](https://github.com/foostan/crkbd) (`corne_left` and `corne_right`) - [Lily58](https://github.com/kata0510/Lily58) (`lily58_left` and `lily58_right`) +- [Sofle](https://github.com/josefadamcik/SofleKeyboard) (`sofle_left` and `sofle_right`) +- [Splitreus62](https://github.com/Na-Cly/splitreus62) (`splitreus62_left` and `splitreus62_right`) +- [RoMac+ v4](https://www.littlekeyboards.com/products/romac) (`romac_plus`) +- [RoMac v2](https://mechboards.co.uk/shop/kits/romac-macro-pad/) (`romac') +- [QAZ](https://www.cbkbd.com/product/qaz-keyboard-kit) (`qaz`) ## Other Hardware From 7f7c7037b04c78d8a3b74557197e0a2996eb980e Mon Sep 17 00:00:00 2001 From: Noah Thornton Date: Sat, 26 Sep 2020 11:59:12 -0700 Subject: [PATCH 13/17] Add quefrency shield --- .github/workflows/build.yml | 2 + .../shields/quefrency/Kconfig.defconfig | 17 +++++++ app/boards/shields/quefrency/Kconfig.shield | 8 +++ app/boards/shields/quefrency/quefrency.conf | 0 app/boards/shields/quefrency/quefrency.dtsi | 29 +++++++++++ app/boards/shields/quefrency/quefrency.keymap | 51 +++++++++++++++++++ .../shields/quefrency/quefrency_left.conf | 2 + .../shields/quefrency/quefrency_left.overlay | 34 +++++++++++++ .../shields/quefrency/quefrency_right.conf | 2 + .../shields/quefrency/quefrency_right.overlay | 42 +++++++++++++++ 10 files changed, 187 insertions(+) create mode 100644 app/boards/shields/quefrency/Kconfig.defconfig create mode 100644 app/boards/shields/quefrency/Kconfig.shield create mode 100644 app/boards/shields/quefrency/quefrency.conf create mode 100644 app/boards/shields/quefrency/quefrency.dtsi create mode 100644 app/boards/shields/quefrency/quefrency.keymap create mode 100644 app/boards/shields/quefrency/quefrency_left.conf create mode 100644 app/boards/shields/quefrency/quefrency_left.overlay create mode 100644 app/boards/shields/quefrency/quefrency_right.conf create mode 100644 app/boards/shields/quefrency/quefrency_right.overlay diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9af3d22b..454ab796 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,8 @@ jobs: - romac - romac_plus - settings_reset + - quefrency_left + - quefrency_right include: - board: proton_c shield: clueboard_california diff --git a/app/boards/shields/quefrency/Kconfig.defconfig b/app/boards/shields/quefrency/Kconfig.defconfig new file mode 100644 index 00000000..c383340d --- /dev/null +++ b/app/boards/shields/quefrency/Kconfig.defconfig @@ -0,0 +1,17 @@ +#Copyright (c) 2020 Noah Thornton +#SPDX-License-Identifier: MIT + + +if SHIELD_QUEFRENCY_LEFT + +config ZMK_KEYBOARD_NAME + default "Quefrency Left" + +endif + +if SHIELD_QUEFRENCY_RIGHT + +config ZMK_KEYBOARD_NAME + default "Quefrency Right" + +endif diff --git a/app/boards/shields/quefrency/Kconfig.shield b/app/boards/shields/quefrency/Kconfig.shield new file mode 100644 index 00000000..d56a1b22 --- /dev/null +++ b/app/boards/shields/quefrency/Kconfig.shield @@ -0,0 +1,8 @@ +# Copyright (c) 2020 Noah Thornton +# SPDX-License-Identifier: MIT + +config SHIELD_QUEFRENCY_LEFT + def_bool $(shields_list_contains,quefrency_left) + +config SHIELD_QUEFRENCY_RIGHT + def_bool $(shields_list_contains,quefrency_right) diff --git a/app/boards/shields/quefrency/quefrency.conf b/app/boards/shields/quefrency/quefrency.conf new file mode 100644 index 00000000..e69de29b diff --git a/app/boards/shields/quefrency/quefrency.dtsi b/app/boards/shields/quefrency/quefrency.dtsi new file mode 100644 index 00000000..76f9b2e4 --- /dev/null +++ b/app/boards/shields/quefrency/quefrency.dtsi @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 Noah Thornton + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + chosen { + zmk,kscan = &kscan0; + + zmk,matrix_transform = &default_transform; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <15>; + rows = <6>; + 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(0,12) RC(0,14) RC(5,13) +RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) /**/RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13) RC(1,14) RC(5,14) +RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) /**/ RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) RC(2,14) RC(2,13) +RC(3,0) 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,12) RC(3,13) RC(3,14) RC(3,11) +RC(4,0) RC(4,1) RC(4,2) RC(4,4) RC(4,6) /**/ RC(4,7) RC(4,10) RC(4,11) RC(4,12) RC(4,13) RC(4,14) RC(4,9) + >; + }; +}; + diff --git a/app/boards/shields/quefrency/quefrency.keymap b/app/boards/shields/quefrency/quefrency.keymap new file mode 100644 index 00000000..1eb7caa8 --- /dev/null +++ b/app/boards/shields/quefrency/quefrency.keymap @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 Noah Thornton + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include + +/ { + keymap { + compatible = "zmk,keymap"; + +// ---------------------------------------------- ----------------------------------------------------- +// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BKSPC | ` | +// | TAB | Q | W | E | R | T | | Y | U | I | O | P | [ | ] | \ | DEL | +// | LCTRL | A | S | D | F | G | | H | J | K | L | ; | ' | ENTER | PGUP | +// | SHIFT | Z | X | C | V | B | | N | M | , | . | / | RSHFT | UP | PGDN | +// | LCTRL | LGUI | LALT | SPACE | FN | | SPACE | RALT | FN | RCTRL | LFT | DWN | RGHT | +// ------------------------------------------- ------------------------------------------------------ + + default_layer { + 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 MINUS &kp EQL &kp BKSP &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 LBKT &kp RBKT &kp BSLH &kp HOME + &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 RET &kp PGUP + &kp LSFT &kp Z &kp X &kp C &kp V &kp B /**/ &kp N &kp M &kp CMMA &kp DOT &kp FSLH &kp RSFT &kp UARW &kp PGDN + &kp LCTL &kp LGUI &kp LALT &kp SPC &mo 1 /**/ &kp SPC &kp RALT &mo 1 &kp RCTL &kp LARW &kp DARW &kp RARW + >; + }; + +// ---------------------------------------------- ----------------------------------------------------- +// |BT_CLR| F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | |BT_CLR| +// | | BT-0 | BT-1| BT-2 | | | | | | | | | | | | | +// | | | | | | | | | | | | | | | | +// | | | | | | | | | | | | | | | | +// | | | | | | | | | | | | | | +// ------------------------------------------- ------------------------------------------------------ + + fn_layer { + bindings = < + &bt BT_CLR &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 /**/ &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &trans &bt BT_CLR + &trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &trans &trans /**/ &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans /**/ &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans /**/ &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans /**/ &trans &trans &trans &trans &trans &trans &trans + >; + }; + }; +}; diff --git a/app/boards/shields/quefrency/quefrency_left.conf b/app/boards/shields/quefrency/quefrency_left.conf new file mode 100644 index 00000000..1e028a78 --- /dev/null +++ b/app/boards/shields/quefrency/quefrency_left.conf @@ -0,0 +1,2 @@ +CONFIG_ZMK_SPLIT=y +CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y diff --git a/app/boards/shields/quefrency/quefrency_left.overlay b/app/boards/shields/quefrency/quefrency_left.overlay new file mode 100644 index 00000000..a62ac8f7 --- /dev/null +++ b/app/boards/shields/quefrency/quefrency_left.overlay @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2020 Noah Thornton + * + * SPDX-License-Identifier: MIT + */ + +#include "quefrency.dtsi" + +/ { + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + + + col-gpios + = <&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> + , <&pro_micro_d 16 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 10 GPIO_ACTIVE_HIGH> + ; + + row-gpios + = <&pro_micro_a 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_a 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_a 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_a 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; +}; diff --git a/app/boards/shields/quefrency/quefrency_right.conf b/app/boards/shields/quefrency/quefrency_right.conf new file mode 100644 index 00000000..990cf7c0 --- /dev/null +++ b/app/boards/shields/quefrency/quefrency_right.conf @@ -0,0 +1,2 @@ +CONFIG_ZMK_SPLIT=y +CONFIG_ZMK_SPLIT_BLE_ROLE_PERIPHERAL=y diff --git a/app/boards/shields/quefrency/quefrency_right.overlay b/app/boards/shields/quefrency/quefrency_right.overlay new file mode 100644 index 00000000..f4037ced --- /dev/null +++ b/app/boards/shields/quefrency/quefrency_right.overlay @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 Noah Thornton + * + * SPDX-License-Identifier: MIT + */ + +#include "quefrency.dtsi" + +&default_transform { + col-offset = <7>; +}; + +/ { + + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + + + + col-gpios + = <&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> + , <&pro_micro_d 16 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 10 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 5 GPIO_ACTIVE_HIGH> + ; + + row-gpios + = <&pro_micro_a 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_a 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_a 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_a 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro_a 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + }; +}; From 24b638dfa37211fc5f0c09844d38760bae5eda5f Mon Sep 17 00:00:00 2001 From: Noah Thornton Date: Sat, 26 Sep 2020 21:09:19 -0500 Subject: [PATCH 14/17] Apply suggestions from code review Revise copyright header Co-authored-by: Pete Johanson --- app/boards/shields/quefrency/Kconfig.defconfig | 2 +- app/boards/shields/quefrency/Kconfig.shield | 2 +- app/boards/shields/quefrency/quefrency.dtsi | 3 +-- app/boards/shields/quefrency/quefrency.keymap | 2 +- app/boards/shields/quefrency/quefrency_left.overlay | 2 +- app/boards/shields/quefrency/quefrency_right.overlay | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/boards/shields/quefrency/Kconfig.defconfig b/app/boards/shields/quefrency/Kconfig.defconfig index c383340d..2b00cb62 100644 --- a/app/boards/shields/quefrency/Kconfig.defconfig +++ b/app/boards/shields/quefrency/Kconfig.defconfig @@ -1,4 +1,4 @@ -#Copyright (c) 2020 Noah Thornton +#Copyright (c) 2020 The ZMK Contributors #SPDX-License-Identifier: MIT diff --git a/app/boards/shields/quefrency/Kconfig.shield b/app/boards/shields/quefrency/Kconfig.shield index d56a1b22..d205e58f 100644 --- a/app/boards/shields/quefrency/Kconfig.shield +++ b/app/boards/shields/quefrency/Kconfig.shield @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Noah Thornton +# Copyright (c) 2020 The ZMK Contributors # SPDX-License-Identifier: MIT config SHIELD_QUEFRENCY_LEFT diff --git a/app/boards/shields/quefrency/quefrency.dtsi b/app/boards/shields/quefrency/quefrency.dtsi index 76f9b2e4..74ddc33d 100644 --- a/app/boards/shields/quefrency/quefrency.dtsi +++ b/app/boards/shields/quefrency/quefrency.dtsi @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Noah Thornton + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ @@ -26,4 +26,3 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,4) RC(4,6) /**/ RC(4,7) >; }; }; - diff --git a/app/boards/shields/quefrency/quefrency.keymap b/app/boards/shields/quefrency/quefrency.keymap index 1eb7caa8..21c5ed40 100644 --- a/app/boards/shields/quefrency/quefrency.keymap +++ b/app/boards/shields/quefrency/quefrency.keymap @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Noah Thornton + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/quefrency/quefrency_left.overlay b/app/boards/shields/quefrency/quefrency_left.overlay index a62ac8f7..a1d205e3 100644 --- a/app/boards/shields/quefrency/quefrency_left.overlay +++ b/app/boards/shields/quefrency/quefrency_left.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Noah Thornton + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ diff --git a/app/boards/shields/quefrency/quefrency_right.overlay b/app/boards/shields/quefrency/quefrency_right.overlay index f4037ced..3876144e 100644 --- a/app/boards/shields/quefrency/quefrency_right.overlay +++ b/app/boards/shields/quefrency/quefrency_right.overlay @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Noah Thornton + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ From 9afd44b9d4a6790d315f2824ca6d21953804b1af Mon Sep 17 00:00:00 2001 From: Noah Thornton Date: Sat, 26 Sep 2020 22:10:14 -0500 Subject: [PATCH 15/17] Provide context on Quefrency physical PCB layouts The Quefrency board has two options for each left and right half, resulting in 4 unique combinations. This has been noted in the overlay and dtsi files. --- app/boards/shields/quefrency/quefrency.dtsi | 4 ++++ app/boards/shields/quefrency/quefrency_left.overlay | 3 +++ app/boards/shields/quefrency/quefrency_right.overlay | 3 +++ 3 files changed, 10 insertions(+) diff --git a/app/boards/shields/quefrency/quefrency.dtsi b/app/boards/shields/quefrency/quefrency.dtsi index 74ddc33d..5f1e9086 100644 --- a/app/boards/shields/quefrency/quefrency.dtsi +++ b/app/boards/shields/quefrency/quefrency.dtsi @@ -13,6 +13,10 @@ zmk,matrix_transform = &default_transform; }; + /* + * This transform correspondsto the 60% left without macro keypad and 65% right, even this + * combination of PCBs can have keys in different locations based on configuration. + */ default_transform: keymap_transform_0 { compatible = "zmk,matrix-transform"; columns = <15>; diff --git a/app/boards/shields/quefrency/quefrency_left.overlay b/app/boards/shields/quefrency/quefrency_left.overlay index a1d205e3..a385cc58 100644 --- a/app/boards/shields/quefrency/quefrency_left.overlay +++ b/app/boards/shields/quefrency/quefrency_left.overlay @@ -7,6 +7,9 @@ #include "quefrency.dtsi" / { + /* This kscan is for the 60% left half without macro keys the + * macro pad layout may require different column and row pins + */ kscan0: kscan { compatible = "zmk,kscan-gpio-matrix"; label = "KSCAN"; diff --git a/app/boards/shields/quefrency/quefrency_right.overlay b/app/boards/shields/quefrency/quefrency_right.overlay index 3876144e..53e0f77c 100644 --- a/app/boards/shields/quefrency/quefrency_right.overlay +++ b/app/boards/shields/quefrency/quefrency_right.overlay @@ -12,6 +12,9 @@ / { + /* This kscan is for the 65% right half the 60% right half + * may require different column and row pins + */ kscan0: kscan { compatible = "zmk,kscan-gpio-matrix"; label = "KSCAN"; From c2a861c0e6a731fd92368768a9b07d5feac7d374 Mon Sep 17 00:00:00 2001 From: Jason Chestnut Date: Mon, 28 Sep 2020 08:24:51 -0400 Subject: [PATCH 16/17] Modify preprocessor directives to use basic #if !defined() rather than Zephyr macros where appropriate. --- app/drivers/zephyr/kscan_gpio_matrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/drivers/zephyr/kscan_gpio_matrix.c b/app/drivers/zephyr/kscan_gpio_matrix.c index b940c6da..5fa618bc 100644 --- a/app/drivers/zephyr/kscan_gpio_matrix.c +++ b/app/drivers/zephyr/kscan_gpio_matrix.c @@ -31,7 +31,7 @@ struct kscan_gpio_item_config { #define _KSCAN_GPIO_ROW_CFG_INIT(idx, n) _KSCAN_GPIO_ITEM_CFG_INIT(n, row_gpios, idx) #define _KSCAN_GPIO_COL_CFG_INIT(idx, n) _KSCAN_GPIO_ITEM_CFG_INIT(n, col_gpios, idx) -#ifdef CONFIG_ZMK_KSCAN_MATRIX_POLLING +#if !defined(CONFIG_ZMK_KSCAN_MATRIX_POLLING) static int kscan_gpio_config_interrupts(struct device **devices, const struct kscan_gpio_item_config *configs, size_t len, gpio_flags_t flags) { From 182a6dca1fc9b1d5e7b0d3828501d6be43ff70dd Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Tue, 29 Sep 2020 12:21:06 -0400 Subject: [PATCH 17/17] fix(bluetooth): Proper max paired/conns. * Proper max values for both split central, and non-split keyboards. --- app/Kconfig | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/Kconfig b/app/Kconfig index 61805656..ccd40da5 100644 --- a/app/Kconfig +++ b/app/Kconfig @@ -132,14 +132,28 @@ endif endif -if ZMK_BLE && (!ZMK_SPLIT_BLE || ZMK_SPLIT_BLE_ROLE_CENTRAL) +if ZMK_BLE + +if ZMK_SPLIT_BLE && ZMK_SPLIT_BLE_ROLE_CENTRAL config BT_MAX_CONN default 6 config BT_MAX_PAIRED + default 6 + +endif + +if !ZMK_SPLIT_BLE + +config BT_MAX_CONN default 5 +config BT_MAX_PAIRED + default 5 + +endif + endif endmenu