diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..d7db1bb8ef --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,8 @@ +## Advantage 360 Pro PR template + +### What's changed: + +### Why has this change been implemented: + +### What (if any) actions must a user take after this change: + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7093b49eb3..353692db77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,9 +10,18 @@ jobs: name: Build steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Get version data + id: get_info + run: | + timestamp=$(date +"%Y%m%d%H%M") + commit=$(echo "${{ github.sha }}" | cut -c1-7) + file_prefix=$timestamp-$commit + branch_name=$(echo "${{ github.ref }}" | awk -F'/' '{print $3}' | cut -c1-4) + echo "file_prefix=$file_prefix" >> $GITHUB_OUTPUT + bin/get_version.sh $branch_name $commit - name: Cache west modules - uses: actions/cache@v2 + uses: actions/cache@v4 env: cache-name: cache-zephyr-modules with: @@ -36,17 +45,17 @@ jobs: - name: West Build (left) run: west build -s zmk/app -d build/left -b adv360_left -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - name: Adv360 Left Kconfig file - run: cat build/left/zephyr/.config | grep -v "^#" | grep -v "^$" + run: grep -vE '(^#|^$)' build/left/zephyr/.config - name: West Build (right) run: west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - name: Adv360 Right Kconfig file - run: cat build/right/zephyr/.config | grep -v "^#" | grep -v "^$" + run: grep -vE '(^#|^$)' build/right/zephyr/.config - name: Rename zmk.uf2 - run: cp build/left/zephyr/zmk.uf2 left.uf2 && cp build/right/zephyr/zmk.uf2 right.uf2 + run: cp build/left/zephyr/zmk.uf2 ${{ steps.get_info.outputs.file_prefix }}-left.uf2 && cp build/right/zephyr/zmk.uf2 ${{ steps.get_info.outputs.file_prefix }}-right.uf2 - name: Archive (Adv360) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: firmware path: | - left.uf2 - right.uf2 + ${{ steps.get_info.outputs.file_prefix }}-left.uf2 + ${{ steps.get_info.outputs.file_prefix }}-right.uf2 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..8191af3459 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,188 @@ +# Changelog +Here's all notable changes and commits to both the configuration repo and the base ZMK that the config repo builds against. + +Many thanks to all those who have submitted issues and pull requests to make this firmware better! +## Config repo + +18/2/2024 - Fix version.dtsi reset after build when running local builds [#385](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/385) + +12/2/2024 - Update GitHub build workflow to use the latest actions [#376](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/376) + +2/2/2024 - Makefile enhancements (build left side firmware only, separate clean targets for firmware and docker, reset of version.dtsi after build) [#363](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/363) + +1/16/2024 - Change the makefile to fis WSL2 compatibility [#335](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/335) + +1/14/2024 - Update base ZMK, change KConfig attributes to support, Enable experimental BLE features for improved stability [#326](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/326) + +12/27/2023 - Change how the characters are used in the versioning script for improved MacOS experience [#303](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/303) + +12/15/2022 - Update keymap.json to reflect new versioning macro [#300](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/300) + +12/15/2023 - Add PR template [#293](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/293) + +12/6/2023 - Update versioning script to use bash from $PATH [#287](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/287) + +12/5/2023 - Update Bluetooth settings in light of user feedback [#289](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/289) + +11/16/2023 - Update changelog with base ZMK update [#268](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/268) + +11/15/2023 - Add and document the new automatic versioning system [#267](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/267) + +11/7/2023 - Add and document a new configuration option for extended NKRO ranges [#264](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/264) + +11/2/2023 - Update the documentation to note the new configuration options, other miscellaneous improvements based on feedback [#260](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/260) + +10/30/2023 - Update the [settings_reset.uf2](/settings-reset.uf2) file to improve reset behaviour with the new update + +10/20/2023 - Disable BLE privacy due to conflict, disable BLE battery reporting, change to point to new ZMK branch with minor update. Please note that due to the minor update the boards will need the [settings_reset.uf2](/settings-reset.uf2) file flashing onto each side prior to updating [#248](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/248) (adv360-z3.2-2) + +10/9/2023 - Further documentation refinements, add section on beta testing, document BLE privacy [#241](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/241) + +10/9/2023 - Change build actions to fix warnings from shellcheck [#242](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/242) + +9/7/2023 - Add a changelog to the documentation, document key positions for combos and improve misc other areas of documentation [#221](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/221) [#222](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/222) + +7/28/2023 - Add a section in README explaining how to resolve connectivity issues after updating [#197](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/197) + +### 7/6/2023 - V3.0 - Major refactor to board definition to match the upstream PR and comply with ZMK pre-commit requirements, Final changes to key matrix in hope of avoiding any future git conflicts, switch to zephyr Pinctrl API, Update the settings-reset file, switch to the zephyr 3.2 branch of the base ZMK repo, add instructions to resolve the conflicts upon updating (adv360-z3.2) + +4/7/2023 - README improvements, adding instructions on flashing, links to the GUI editor and formatting cleanup [#128](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/128) + +3/4/2023 - Add extra keys into matrix that point to nowhere, fixes spurious keypress issues when using USB3.1 cables [#114](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/114) [#116](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/116) + +2/14/2023 - Disable ZMK logging by default to improve power consumption [#101](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/101) + +1/25/2023 - Fix automatic OS detection to build properly when using the local builder on OS-X [#91](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/91) + +1/16/2023 - Change formatting of keymap GUI files [#92](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/92) + +11/21/2022 - Rewrite README to take into account new makefile structure [#57](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/57) + +11/18/2022 - Add SELinux support to the makefile build sequence [#58](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/58) + +11/14/2022 - Makefile cleanup to delete docker images on clean and run more seamlessly [#42](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/42) + +10/30/2022 - Improve make clean so that it doesn't error when run without build firmware [#36](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/36) + +10/26/2022 - Add support for building through podman as opposed to docker [#10](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/10) + +10/23/2022 - Update GitHub actions to avoid deprecated actions [#33](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/33) + +10/23/2022 - Add a makefile to reuse the docker image every time [#29](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/29) + +10/20/2022 - Update settings reset file to fully erase peripheral data from the central + +10/12/2022 - Fix local docker build after V2.0 update [#25](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/25) + +10/11/2022 - Set manufacturer information over BLE [#28](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/28) + +10/9/2022 - Cleanup of keymap [#24](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/) + +10/7/2022 - Add USB VID, PID and Manufacturer information to config files + +9/26/2022 - Revise local building script to avoid errors after V2.0 update + +### 9/17/2022 - V2.0 - Changes to support Zephyr 3 (adv360-z3) + +8/9/2022 - Remove extraneous keys from the GUI [#5](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/5) + +6/13/2022 - Change default keymap, add default macros + +5/23/2022 - Add local building with Docker, Add a README [#4](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/4) + +5/6/2022 - Change LFCLK accuracy for improved reliability [#2](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/2) + +### 3/3/2022 - V1.0 - Initial config repo release [#1](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/pull/1) (adv360-beta) + +3/1/2022 - Initial publication of licence + +## Base ZMK + +There have beeen 5 branches of ZMK used for the 360 Pro so far. Beta branches are not changelogged as they are subject to frequent changes and tweaks. + +| Branch | Date From | Date To | Config Branch | +| -------- | ------- |-------|-----| +| [adv360-beta](https://github.com/ReFil/zmk/tree/adv360-beta) | 3/1/2022 | 9/17/2022 | V1.0 (since deleted) | +| [adv360-z3](https://github.com/ReFil/zmk/tree/adv360-z3) | 9/17/2022 | 7/6/2023 | V2.0 (since deleted) | +| [adv360-z3.2](https://github.com/ReFil/zmk/tree/adv360-z3.2) | 7/6/2023 | 20/10/2023 | [V3.0](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/tree/V3.0) (Up to commit 82494e7) | +| [adv360-z3.2-2](https://github.com/ReFil/zmk/tree/adv360-z3.2-2) | 20/10/2023 | 1/14/2024 | [V3.0](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/tree/V3.0) (Up to commit XXXXXXX) | +| [adv360-z3.2-3](https://github.com/ReFil/zmk/tree/adv360-z3.2-3) | 1/14/2024 | To date | [V3.0](https://github.com/KinesisCorporation/Adv360-Pro-ZMK/tree/V3.0) (current) | + + +### adv360-z3.2-3 + +1/8/2023 - Merge latest upstream ZMK (Commit 7652fbeb) + +12/17/2023 - Add KConfig line to ensure compatibility with previous NKRO extended report is maintained + +12/17/2023 - Fix conflicts with upstream HID indicators code for split communication + +12/17/2023 - Add defines for HID indicator LEDs to maintain compatibility with lighting code + +12/17/2023 - Merge latest upstream ZMK (Commit 78fa1e77) + +Note: Several features that used to be custom to this branch (BT battery reporting disable, Extended NKRO, HID Indicators) are now upstream + +### adv360-z3.2-2 + +11/16/2023 - Fix race condition in the bluetooth code causing issues with split connectivity + +11/7/2023 - Put HID max NKRO usage on a config option for compatibility (`CONFIG_ZMK_HID_KEYBOARD_EXTENDED_REPORT`) + +11/1/2023 - Increase behaviour queue size to permit longer macro sequences to be run + +11/1/2023 - Change order of RGB initialisation to prevent situations where lighting could get stuck in battery reporting mode + +10/27/2023 - Change HID max NKRO usage to allow usage of F13-F24 and other rarely used keycodes with NKRO enabled + +10/18/2023 - Disable saving certain RGB elements to flash memory to help with flash wear + +10/18/2023 - Re-enable BLE battery reporting in code (now disabled in config repo using the `CONFIG_BT_BAS` KConfig option) + +10/18/2023 - Merge latest upstream ZMK (Commit 7fe9ecd8) + +### adv360-z3.2 + +7/31/2023 - Fix broken CI builds [#6](https://github.com/ReFil/zmk/pull/6) + +5/30/2023 - Update RGB indicators code to match latest changes from pull requests + +5/30/2023 - Merge latest HID indicators pull request alongside dependencies [#999](https://github.com/zmkfirmware/zmk/pull/999) [#1803](https://github.com/zmkfirmware/zmk/pull/1803) + +5/30/2023 - Disable BLE battery reporting due to unreliability + +5/30/2023 - Various fixes to allow compilation on zephyr 3.2 + +5/29/2023 - Merge latest upstream ZMK (Commit b276a3b) + +### adv360-z3 + +3/27/2023 - Fix power on behaviour for RGB lighting + +2/24/2023 - Fix indication leds for BLE profile 5 + +1/12/2023 - Merge latest upstream ZMK (Commit a82a0ec) + +1/12/2023 - Fix pre-commit formatting + +1/12/2023 - Fix a compile time warning by defining struct in header [#4](https://github.com/ReFil/zmk/pull/4) + +11/25/2022 - Add extra BLE characteristic to fix HID light reporting on MacOS + +10/19/2022 - Add BLE whitelist scanning to improve performance in environments with many BLE devices + +10/19/2022 - Merge latest upstream ZMK (Commit c9eb631) + +10/19/2022 - Fix initial power on lighting + +10/2/2022 - Add ability to scale RGB and backlight brightness to improve battery life + +9/13/2022 - Add custom lighting functionality on top of base ZMK + +9/12/2022 - Merge HID indicators pull request [#999](https://github.com/zmkfirmware/zmk/pull/999) atop of base ZMK + +9/11/2022 - Diverge from base ZMK (Commit 6124d25) + + +### adv360-beta +This repository has been deprecated for a year and as such will not be documented, it is advisable to upgrade to V3.0 as this has more features and improved reliability diff --git a/Dockerfile b/Dockerfile index 121e0db896..bbb8e9ff01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,4 @@ -FROM zmkfirmware/zmk-build-arm:stable - -RUN mkdir -p /app/firmware +FROM docker.io/zmkfirmware/zmk-build-arm:stable WORKDIR /app @@ -13,7 +11,6 @@ RUN west update # West Zephyr export RUN west zephyr-export -COPY config config COPY bin/build.sh ./ CMD ["./build.sh"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..71691e2b96 --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +DOCKER := "$(shell { command -v podman || command -v docker; })" +TIMESTAMP := "$(shell date -u +"%Y%m%d%H%M")" +COMMIT := "$(shell git rev-parse --short HEAD 2>/dev/null)" +detected_OS := "$(shell uname)" # Classify UNIX OS +ifeq ($(strip $(detected_OS)),Darwin) #We only care if it's OS X +SELINUX1 := +SELINUX2 := +else +SELINUX1 := :z +SELINUX2 := ,z +endif + +.PHONY: all left clean_firmware clean_image clean + +all: + $(shell bin/get_version.sh >> /dev/null) + $(DOCKER) build --tag zmk --file Dockerfile . + $(DOCKER) run --rm -it --name zmk \ + -v $(PWD)/firmware:/app/firmware$(SELINUX1) \ + -v $(PWD)/config:/app/config:ro$(SELINUX2) \ + -e TIMESTAMP=$(TIMESTAMP) \ + -e COMMIT=$(COMMIT) \ + -e BUILD_RIGHT=true \ + zmk + git checkout config/version.dtsi + +left: + $(shell bin/get_version.sh >> /dev/null) + $(DOCKER) build --tag zmk --file Dockerfile . + $(DOCKER) run --rm -it --name zmk \ + -v $(PWD)/firmware:/app/firmware$(SELINUX1) \ + -v $(PWD)/config:/app/config:ro$(SELINUX2) \ + -e TIMESTAMP=$(TIMESTAMP) \ + -e COMMIT=$(COMMIT) \ + -e BUILD_RIGHT=false \ + zmk + git checkout config/version.dtsi + +clean_firmware: + rm -f firmware/*.uf2 + +clean_image: + $(DOCKER) image rm zmk docker.io/zmkfirmware/zmk-build-arm:stable + +clean: clean_firmware clean_image diff --git a/README.md b/README.md index c4886a09ad..dc60134dd9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,14 @@ -# ADV360-PRO-ZMK +# Kinesis Advantage 360 Pro ZMK Config -## To build Firmware in GitHub Actions +## Modifying the keymap + +[The ZMK documentation](https://zmk.dev/docs) covers both basic and advanced functionality and has a table of OS compatibility for keycodes. Please note that the RGB Underglow, Backlight and Power Management sections are not relevant to the Advantage 360 Pro's custom ZMK fork. For more information see [this note](#note) + +There is a web based GUI available for editing the keymap. It is available at https://kinesiscorporation.github.io/Adv360-Pro-GUI. This repository is also compatible with certain other web based ZMK keymap editors however they may have keycodes or behaviours that are not implemented on the 360 Pro and could cause unusual behaviour or build failures. Furthermore changes made on other keymap editors may not be compatible if one goes back to using the Kinesis GUI. + +Certain ZMK features (e.g. combos) require knowing the exact key positions in the matrix. They can be found in both image and text format [here](assets/key-positions.md) + +## Building the Firmware with GitHub Actions ### Setup @@ -12,21 +20,121 @@ 1. Push a commit to trigger the build. 2. Download the artifact. -## To build Firmware locally using Docker +## Building the Firmware in a local container ### Setup -1. Execute `setup.sh`. +#### Software -### Build firmware +- Either Podman or Docker is required, Podman is chosen if both are installed. +- Make is also required + +#### Windows specific + +- If compiling on Windows use WSL2 and Docker [Docker Setup Guide](https://docs.docker.com/desktop/windows/wsl/). +- Install make using `sudo apt-get install make` inside the WSL2 instance. +- The repository can be cloned directly into the WSL2 instance or accessed through the C: mount point WSL provides by default (`/mnt/c/path-to-repo`). + +#### macOS specific + +On macOS [brew](https://brew.sh) can be used to install the required components. + +- docker +- [colima](https://github.com/abiosoft/colima) can be used as the docker engine + +```shell +brew install docker colima +colima start +``` + +> Note: On Apple Silicon (ARM based) systems you need to make sure to start colima with the correct architecture for the container being used. +> +> ``` +> colima start --arch x86_64 +> ``` + +### Build firmware locally + +1. Execute `make` to build firmware for both halves or `make left` to only build firmware for the left hand side. +2. Check the `firmware` directory for the latest firmware build. The first part of the filename is the timestamp when the firmware was built. + +### Cleanup + +The built docker container and compiled firmware files can be deleted with `make clean`. This might be necessary if you updated your fork from V2.0 to V3.0 and are encountering build failures. + +Creating the docker container takes some time. Therefore `make clean_firmware` can be used to only clean firmware without removing the docker container. Similarly `make clean_image` can be used to remove the docker container without removing compiled firmware files. + +## Flashing firmware + +Follow the programming instruction on page 8 of the [Quick Start Guide](https://kinesis-ergo.com/wp-content/uploads/Advantage360-Professional-QSG-v8-25-22.pdf) to flash the firmware. + +### Overview + +1. Extract the firmwares from the archive downloaded from the GitHub build job (If using the cloud builder) or the firmware folder (If building locally). +1. Connect the left side keyboard to USB. +1. Press Mod+macro1 to put the left side into bootloader mode; it should attach to your computer as a USB drive. +1. Copy `left.uf2` to the USB drive and it will disconnect. +1. Power off both keyboards (by unplugging them and making sure the switches are off). +1. Turn on the left side keyboard with the switch. +1. Connect the right side keyboard to USB to power it on. +1. Press Mod+macro3 to put the right side into bootloader mode to attach it as a USB drive. +1. Copy `right.uf2` to the mounted drive. +1. Unplug the right side keyboard and turn it back on. +1. Enjoy! + +> Note: There are also physical reset buttons on both keyboards which can be used to enter and exit the bootloader mode. Their location is described in section 2.7 on page 9 in the [User Manual](https://kinesis-ergo.com/wp-content/uploads/Advantage360-ZMK-KB360-PRO-Users-Manual-v3-10-23.pdf) and use is described in section 5.9 on page 14. + +> Note: Some operating systems wont always treat the drive as ejected after the settings-reset file is flashed, this doesn't mean that the flashing process has failed. + +### Upgrading from V2 to V3 + +If you encounter a git conflict when updating your repository to V3.0 please follow the instructions on how to resolve it [here](UPGRADE.md). + +Updating from V2.0 based firmwares to V3.0 based firmwares can be a rather complex process. There are reset files for every major firmware revision as well as documentation on the update process available [here](https://kinesis-ergo.com/support/kb360pro/#firmware-updates). + +## Versioning + +Starting on 11/15/2023 the Advantage 360 Pro will now automatically record the compilation date, branch and Git commit hash in a macro that can be accessed with Mod+V. This will type out the following string: YYYYMMDD-XXXX-YYYYYY, where XXXX is the first 4 characters of the Git branch and YYYYYY is the Git commit hash. In addition to this the builds compiled by GitHub actions are now timestamped and also record the commit hash in the filename. + +## Bluetooth LE Privacy + +Since the update on 20/10/2023, BLE privacy is now disabled by default and due to an update in upstream ZMK cannot be enabled again as it will cause issues for the split halves connecting to each other. + +Recent updates to MacOS have improved the behaviour for devices without BLE privacy and caused regressions with privacy enabled (e.g. being unable to enter the password on the filevault screen) so BLE privacy is not necessary any more. + +## N-Key Rollover + +By default this keyboard has NKRO enabled, however for compatibility reasons the higher ranges are not enabled. If you want to use F13-F24 or the INTL1-9 keys with NKRO enabled you can change `CONFIG_ZMK_HID_KEYBOARD_EXTENDED_REPORT=n` to `CONFIG_ZMK_HID_KEYBOARD_EXTENDED_REPORT=y` in [adv360_left_defconfig](/config/boards/arm/adv360/adv360_left_defconfig#L65) + +## Battery reporting + +By default reporting the battery level over BLE is disabled as this can cause some computers to spontaneously wake up repeatedly. If you'd like to enable this functionality change `CONFIG_BT_BAS=n` to `CONFIG_BT_BAS=y` in [adv360_left_defconfig](/config/boards/arm/adv360/adv360_left_defconfig#L58). Please note that a known bug in windows prevents the battery level from updating by default, it is only updated when the board is paired. A workaround is to set `CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n` in [adv360_left_defconfig](/config/boards/arm/adv360/adv360_left_defconfig). This may cause unexpected results on other OSes + +## Changelog + +The changelog for both the config repo and the underlying ZMK fork that the config repo builds against can be found [here](CHANGELOG.md). + +## Beta testing + +The Advantage 360 Pro is always getting updates and refinements. If you are willing to beta test you can follow [this guide from ZMK](https://zmk.dev/docs/features/beta-testing#testing-features) on how to change where your config repo points to. The `west.yml` file that is mentioned is located in config/. [This link](config/west.yml) can take you to the file. Typically you will only need to change the `revision: ` to match the beta branch. The current beta branch is [adv360-z3.2-beta](https://github.com/ReFil/zmk/tree/adv360-z3.2-beta) which is compatible with V3.0 config repositories however users must [disable BT privacy](#bluetooth-le-privacy). + +Feedback on beta branches should be submitted as a GitHub issue on the base ZMK repository as opposed to this config repository + +In the event of a major update the beta branch may not be compatible with the current mainline version of the config repository. If this is the case it will be detailed here along with instructions on how to update. + +## Note + +By default this config repository references [a customised version of ZMK](https://github.com/ReFil/zmk/tree/adv360-z3.2) with Advantage 360 Pro specific functionality and changes over [base ZMK](https://github.com/zmkfirmware/zmk). The Kinesis fork is regularly updated to bring the latest updates and changes from base ZMK however will not always be completely up to date, some features such as new keycodes will not be immediately available on the 360 Pro after they are implemented in base ZMK. + +Whilst the Advantage 360 Pro is compatible with base ZMK (The pull request to merge it can be seen [here](https://github.com/zmkfirmware/zmk/pull/1454) if you want to see how to implement it) some of the more advanced features (the indicator RGB leds) will not work, and Kinesis cannot provide customer service for usage of base ZMK. Likewise the ZMK community cannot provide support for either the Kinesis keymap editor, nor any usage of the Kinesis custom fork. + +## Other support -1. Execute `run.sh` -2. Check the `firmware` directory for the latest firmware build. +Further support resources can be found on Kinesis.com: -### Flash firmware +- https://kinesis-ergo.com/support/kb360pro/#firmware-updates +- https://kinesis-ergo.com/support/kb360pro/#manuals -Resources can be found on Kinesis.com -https://kinesis-ergo.com/support/kb360pro/#firmware-updates -https://kinesis-ergo.com/support/kb360pro/#manuals +In the event of a hardware issue it may be necessary to open a support ticket directly with Kinesis as opposed to a GitHub issue in this repository. -cats +- https://kinesis-ergo.com/support/kb360pro/#ticket diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 0000000000..e3e7cbbb14 --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,62 @@ +# Advantage 360 Pro ZMK upgrade guide + +The last V2.0 update and the new V3.0 branch have introduced changes into the keymap files that causes merge conflicts for people updating with custom keymaps. This guide covers what changed, why it changed and how to fix it. + +## What changed and why + +To resolve issues some users were encountering with out of matrix keypresses, as well as to streamline the keymap for all future updates, several keys that are unused were removed from the keymap and [matrix transform](https://zmk.dev/docs/config/kscan#matrix-transform). Formatting was also standardised to fall in line with ZMK formatting conventions. As a result the board definition for the Advantage 360 Pro as it stands to get merged into ZMK main [here](https://github.com/zmkfirmware/zmk/pull/1454) matches the one in this repository to the greatest extent possible. +These changes result in a merge conflict when two diverging git branches try to get added together in the updating procedure. +This sort of breaking change shouldn't happen again in the future. + +## How to solve the merge conflict + +In order to solve the merge conflict all that has to be done is for the conflicting key behaviours to be manually removed from two files. +- adv360.keymap + +![The highlighted &none behaviours that need removing](/assets/keymap.jpg) +- keymap.json + +![The highlighted &none behaviours that need removing](/assets/json.jpg) + +These highlighted keys must be removed from each layer in both files. Be careful to preserve a comma in between every key behaviour in the keymap.json and at least one space between every behaviour in adv360.keymap or firmware builds will fail. The quotes need correctly preserving on the behaviours in keymap.json. Each behaviour needs to be wrapped in quotes. Whitespace within the quotes is ignored. +If you try to update your fork using the GitHub web interface you will see an error saying "This branch has merge conflicts and cannot be merged automatically" and you will be prompted to open a pull request instead. Solving the merge conflict this way is more challenging than doing it on GitHub desktop. + +### Github Desktop + +This assumes you already have [GitHub desktop](https://desktop.github.com/) downloaded, installed and you have logged in using the GitHub credentials for your account. Whilst it would be helpful to have an alternative text editor such as VSCode installed this task can be completed with notepad +1. Clone your repository + + Navigate in the menu to File->Clone repository. Your fork of the Adv360-Pro-ZMK repository should be visible in the menu of repositories to choose from. Click the blue "Clone" button +2. Open the folder + + Open the folder by using the "Show in your file manager" option and navigate to the "config" folder +3. Edit keymap.json + + Open keymap.json, and for each layer remove the 8 highlighted &none behaviours including the quotes wrapping them, and the commas +4. Edit adv 360.keymap + + Open adv360.keymap and remove the 8 highlighted &none behaviours in each layer +5. Commit your changes + + Returning to GitHub desktop you should see the changes you made in the bar on the left. Type an appropriate commit summary and click "Commit to *branch name*" + + ![The commit dialog of GitHub Desktop](/assets/commit.jpg) + +6. Merge + + Navigate to Branch->Merge into current branch and select "upstream/V2.0" or "upstream/V3.0". You will see a warning that there will be two conflicted files. Click "Create a merge commit". + + ![The merge dialog showing a warning of conflicts](/assets/merge.jpg) + +7. Resolve Conflicts + + The conflict resolution window has powerful options to soresolve the merge conflict, you will want to click on the down arrow next to "Open in *your text editor*" and click use the modified file from *your branch name*. In the case of this example it is called V2.0-beta. Using the file from upstream/V2.0 or upstream/V3.0 will result in none of your keymap changes being preserved. + Do this for both files then you will be able to click the "Continue Merge" option + + ![The merge dialog showing a warning of conflicts](/assets/conflict.jpg) +8. Push + + Once the merge is complete you should be able to click the "push origin" button in the top bar. At this point your changes should be uploaded to GitHub servers and the build should start +9. Test your firmware + + When the build succeeds download the uf2 files and flash them as normal. Test the keymap, if keys are shifted one way or the other it's likely you deleted too many or not enough behaviours. \ No newline at end of file diff --git a/assets/commit.jpg b/assets/commit.jpg new file mode 100644 index 0000000000..49788cf459 Binary files /dev/null and b/assets/commit.jpg differ diff --git a/assets/conflict.jpg b/assets/conflict.jpg new file mode 100644 index 0000000000..b047af73ca Binary files /dev/null and b/assets/conflict.jpg differ diff --git a/assets/json.jpg b/assets/json.jpg new file mode 100644 index 0000000000..4f8bf417b7 Binary files /dev/null and b/assets/json.jpg differ diff --git a/assets/key-positions.md b/assets/key-positions.md new file mode 100644 index 0000000000..1c2a7bac29 --- /dev/null +++ b/assets/key-positions.md @@ -0,0 +1,26 @@ +# Advantage 360 Pro key positions +## Image +![The key positions on the Advantage 360](key-positions.png) + +## Code +``` +#define KEYS_L 0 1 2 3 4 5 6 \ + 14 15 16 17 18 19 20 \ + 28 29 30 31 32 33 34 \ + 46 47 48 49 50 51 \ + 60 61 62 63 64 + +#define THUMBS_LEFT 35 36 \ + 52 \ + 65 66 67 \ + +#define KEYS_R 7 8 9 10 11 12 13 \ + 21 22 23 24 25 26 27 \ + 39 40 41 42 43 44 45 \ + 54 55 56 57 58 59 \ + 71 72 73 74 75 + +#define THUMBS_RIGHT 37 38 \ + 53 \ + 68 69 70 \ + ``` \ No newline at end of file diff --git a/assets/key-positions.png b/assets/key-positions.png new file mode 100644 index 0000000000..7ca1bd7025 Binary files /dev/null and b/assets/key-positions.png differ diff --git a/assets/keymap.jpg b/assets/keymap.jpg new file mode 100644 index 0000000000..190c306a1e Binary files /dev/null and b/assets/keymap.jpg differ diff --git a/assets/merge.jpg b/assets/merge.jpg new file mode 100644 index 0000000000..20d67e2ae0 Binary files /dev/null and b/assets/merge.jpg differ diff --git a/bin/build.sh b/bin/build.sh index 2f6c8cde64..bab8570a9e 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -1,17 +1,24 @@ #!/usr/bin/env bash -set -e +set -eu PWD=$(pwd) -TIMESTAMP=$(date -u +"%Y%m%d%H%M%S") +TIMESTAMP="${TIMESTAMP:-$(date -u +"%Y%m%d%H%M")}" +COMMIT="${COMMIT:-$(echo xxxxxx)}" # West Build (left) west build -s zmk/app -d build/left -b adv360_left -- -DZMK_CONFIG="${PWD}/config" # Adv360 Left Kconfig file -cat build/left/zephyr/.config | grep -v "^#" | grep -v "^$" -# West Build (right) -west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${PWD}/config" -# Adv360 Right Kconfig file -cat build/right/zephyr/.config | grep -v "^#" | grep -v "^$" +grep -vE '(^#|^$)' build/left/zephyr/.config # Rename zmk.uf2 -cp build/left/zephyr/zmk.uf2 ./firmware/${TIMESTAMP}-left.uf2 && cp build/right/zephyr/zmk.uf2 ./firmware/${TIMESTAMP}-right.uf2 +cp build/left/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-left.uf2" + +# Build right side if selected +if [ "${BUILD_RIGHT}" = true ]; then + # West Build (right) + west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${PWD}/config" + # Adv360 Right Kconfig file + grep -vE '(^#|^$)' build/right/zephyr/.config + # Rename zmk.uf2 + cp build/right/zephyr/zmk.uf2 "./firmware/${TIMESTAMP}-${COMMIT}-right.uf2" +fi diff --git a/bin/get_version.sh b/bin/get_version.sh new file mode 100755 index 0000000000..aa23e1719d --- /dev/null +++ b/bin/get_version.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +# Get the date, first 4 chars of branch name and short commit hash +date=$(date -u +"%Y%m%d") +branch=${1:-$(git rev-parse --abbrev-ref HEAD | cut -c1-4)} +commit=${2:-$(git rev-parse --short HEAD)} + +uppercase_char() { + local char=$1 + + (echo $char | tr '[a-z]' '[A-Z]' 2> /dev/null) || echo "${char^^}" +} + +# Function to transform characters to ZMK key behaviours +transform_char() { + local char=$1 + + if [[ $char =~ [A-Za-z] ]]; then + echo "<&kp $(uppercase_char $char)>, " + elif [[ $char =~ [0-9] ]]; then + echo "<&kp N${char}>, " + elif [ "$char" = "." ]; then + echo "<&kp DOT>, " + fi +} + +# Iterate over the date and format characters +formatted_date="" +for ((i = 0; i < ${#date}; i++)); do + formatted_date+=$(transform_char "${date:$i:1}") +done + +# Insert separator between date and branch +formatted_date+="<&kp MINUS>, " + +# Iterate over the branch and format characters +formatted_branch="" +for ((i = 0; i < ${#branch}; i++)); do + formatted_branch+=$(transform_char "${branch:$i:1}") +done + +# Insert separator between branch and commit hash +formatted_branch+="<&kp MINUS>, " + +# Iterate over the commit hash and format characters +formatted_commit="" +for ((i = 0; i < ${#commit}; i++)); do + formatted_commit+=$(transform_char "${commit:$i:1}") +done + +# Combine the formatted string, add trailing carriage return +formatted_result="$formatted_date$formatted_branch$formatted_commit" +formatted_result+="<&kp RET>" + +echo $formatted_result +# Create new macro to define version, overwrite previous one + +echo '#define VERSION_MACRO' > "config/version.dtsi" +echo 'macro_ver: macro_ver {' >> "config/version.dtsi" +echo 'compatible = "zmk,behavior-macro";' >> "config/version.dtsi" +echo 'label = "macro_ver";' >> "config/version.dtsi" +echo '#binding-cells = <0>;' >> "config/version.dtsi" +echo "bindings = $formatted_result;" >> "config/version.dtsi" +echo '};' >> "config/version.dtsi" diff --git a/config/adv360.keymap b/config/adv360.keymap index 9b8a6f1b37..58cd593fb9 100644 --- a/config/adv360.keymap +++ b/config/adv360.keymap @@ -8,18 +8,68 @@ #define HYPER LS(LC(LALT)) / { - behaviors { - #include "macros.dtsi" + behaviors { + #include "macros.dtsi" + #include "version.dtsi" + #ifndef VERSION_MACRO + macro_ver: macro_ver { + compatible = "zmk,behavior-macro"; + label = "macro_version"; + #binding-cells = <0>; + bindings = <&kp RET>; + }; + #endif - hm: homerow_mods { - compatible = "zmk,behavior-hold-tap"; - label = "HOMEROW_MODS"; - #binding-cells = <2>; - tapping-term-ms = <150>; - quick-tap-ms = <0>; - flavor = "tap-preferred"; - bindings = <&kp>, <&kp>; - global-quick-tap; + hm: homerow_mods { + compatible = "zmk,behavior-hold-tap"; + label = "HOMEROW_MODS"; + #binding-cells = <2>; + tapping-term-ms = <200>; + quick_tap_ms = <50>; + flavor = "tap-preferred"; + bindings = <&kp>, <&kp>; + global-quick-tap; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &tog 1 &mo 3 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS + &kp TAB &kp Q &kp W &kp E &kp R &kp T &none &none &kp Y &kp U &kp I &kp O &kp P &kp BSLH + &kp ESC &kp A &kp S &kp D &kp F &kp G &none &kp LCTRL &kp LALT &kp LGUI &kp RCTRL &none &kp H &kp J &kp K &kp L &kp SEMI &kp SQT + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp HOME &kp PG_UP &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT + &mo 2 &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT &kp BSPC &kp DEL &kp END &kp PG_DN &kp ENTER &kp SPACE &kp UP &kp DOWN &kp LBKT &kp RBKT &mo 2 + >; + }; + keypad { + bindings = < + &kp EQUAL &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &trans &mo 3 &kp N6 &kp KP_NUM &kp KP_EQUAL &kp KP_DIVIDE &kp KP_MULTIPLY &kp MINUS + &kp TAB &kp Q &kp W &kp E &kp R &kp T &none &none &kp Y &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MINUS &kp BSLH + &kp ESC &kp A &kp S &kp D &kp F &kp G &none &kp LCTRL &kp LALT &kp LGUI &kp RCTRL &none &kp H &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp SQT + &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp HOME &kp PG_UP &kp N &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER &kp RSHFT + &mo 2 &kp GRAVE &kp CAPS &kp LEFT &kp RIGHT &kp BSPC &kp DEL &kp END &kp PG_DN &kp ENTER &kp KP_N0 &kp UP &kp DOWN &kp KP_DOT &kp RBKT &mo 2 + >; + }; + fn { + bindings = < + &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &tog 1 &mo 3 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 + &trans &trans &trans &trans &trans &trans &none &none &trans &trans &trans &trans &trans &trans + &trans &trans &trans &trans &trans &trans &none &trans &trans &trans &trans &none &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 + >; + }; + mod { + bindings = < + &none &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none &trans &none &none &none &none &none &none + &none &none &none &none &none &none &bootloader &bootloader &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &bt BT_CLR &none &rgb_ug RGB_MEFS_CMD 5 &none &none &none &none &none &none + &none &none &none &none ¯o_ver &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &bl BL_TOG &rgb_ug RGB_TOG &bl BL_INC &bl BL_DEC &none &none &none + >; }; }; diff --git a/config/boards/arm/adv360/Kconfig b/config/boards/arm/adv360/Kconfig index 350014a0da..db5273eb0c 100644 --- a/config/boards/arm/adv360/Kconfig +++ b/config/boards/arm/adv360/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT config BOARD_ENABLE_DCDC - bool "Enable DCDC mode" - select SOC_DCDC_NRF52X - default y - depends on BOARD_ADV360_LEFT || BOARD_ADV360_RIGHT + bool "Enable DCDC mode" + select SOC_DCDC_NRF52X + default y + depends on BOARD_ADV360_LEFT || BOARD_ADV360_RIGHT \ No newline at end of file diff --git a/config/boards/arm/adv360/Kconfig.board b/config/boards/arm/adv360/Kconfig.board index cacf2cf812..cf534c5e05 100644 --- a/config/boards/arm/adv360/Kconfig.board +++ b/config/boards/arm/adv360/Kconfig.board @@ -1,12 +1,12 @@ # -# Copyright (c) 2021 Polarity Works +# Copyright (c) 2022 The ZMK Contributors # SPDX-License-Identifier: MIT # config BOARD_ADV360_LEFT - bool "adv360_left" - depends on SOC_NRF52840_QIAA + bool "adv360_left" + depends on SOC_NRF52840_QIAA config BOARD_ADV360_RIGHT - bool "adv360_right" - depends on SOC_NRF52840_QIAA + bool "adv360_right" + depends on SOC_NRF52840_QIAA diff --git a/config/boards/arm/adv360/Kconfig.defconfig b/config/boards/arm/adv360/Kconfig.defconfig index 9d60f88e74..7333f89a0b 100644 --- a/config/boards/arm/adv360/Kconfig.defconfig +++ b/config/boards/arm/adv360/Kconfig.defconfig @@ -1,19 +1,21 @@ # -# Copyright (c) 2021 Polarity Works +# Copyright (c) 2022 The ZMK Contributors # SPDX-License-Identifier: MIT # if BOARD_ADV360_LEFT - config ZMK_KEYBOARD_NAME - default "Adv360 Pro" + config ZMK_KEYBOARD_NAME + default "Adv360 Pro" + config ZMK_SPLIT_ROLE_CENTRAL + default y endif # BOARD_ADV360_LEFT if BOARD_ADV360_RIGHT - config ZMK_KEYBOARD_NAME - default "Adv360 Pro rt" + config ZMK_KEYBOARD_NAME + default "Adv360 Pro rt" endif # BOARD_ADV360_RIGHT @@ -21,39 +23,33 @@ endif # BOARD_ADV360_RIGHT if BOARD_ADV360_LEFT || BOARD_ADV360_RIGHT config BOARD - default "adv360" + default "adv360" config ZMK_SPLIT - default y + default y config SPI bool default y config BT_CTLR - default BT - -config ZMK_BLE - default y - -config ZMK_USB - default y + default BT if USB config USB_NRFX - default y + default y config USB_DEVICE_STACK - default y + default y endif # USB config ZMK_BATTERY_VOLTAGE_DIVIDER - default y + default y config SPI - default y + default y diff --git a/config/boards/arm/adv360/adv360.dtsi b/config/boards/arm/adv360/adv360.dtsi index c57764b6b9..0e092033d8 100644 --- a/config/boards/arm/adv360/adv360.dtsi +++ b/config/boards/arm/adv360/adv360.dtsi @@ -11,171 +11,153 @@ #include #include +#include "adv360_pinctrl.dtsi" + / { - model = "Adv360"; - compatible = "adv360"; - - chosen { - zephyr,code-partition = &code_partition; - zephyr,sram = &sram0; - zephyr,flash = &flash0; - zmk,kscan = &kscan0; - zmk,underglow = &led_strip; - zmk,backlight = &backlight; - zmk,matrix_transform = &default_transform; - zmk,battery = &vbatt; - zephyr,console = &cdc_acm_uart; - }; - - default_transform: keymap_transform_0 { - compatible = "zmk,matrix-transform"; - columns = <22>; - rows = <5>; - - - map = < - RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,15) RC(4,16) RC(4,17) RC(4,18) RC(4,19) RC(4,20) RC(4,21) - RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,15) RC(3,16) RC(3,17) RC(3,18) RC(3,19) RC(3,20) RC(3,21) - RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,8) RC(2,9) RC(2,12) RC(2,13) RC(2,15) RC(2,16) RC(2,17) RC(2,18) RC(2,19) RC(2,20) RC(2,21) - 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(1,16) RC(1,17) RC(1,18) RC(1,19) RC(1,20) RC(1,21) - RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,7) RC(0,8) RC(0,9) RC(0,12) RC(0,13) RC(0,14) RC(0,17) RC(0,18) RC(0,19) RC(0,20) RC(0,21) - - >; - }; - ext-power { - compatible = "zmk,ext-power-generic"; - label = "EXT_POWER"; - control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; - }; - backlight: pwmleds { - compatible = "pwm-leds"; - label = "Backlight LEDs"; - pwm_led_0 { - pwms = <&pwm0 17>; - label = "Backlight LED 0"; + model = "Adv360"; + compatible = "kinesis,adv360"; + + chosen { + zephyr,code-partition = &code_partition; + zephyr,sram = &sram0; + zephyr,flash = &flash0; + zephyr,console = &cdc_acm_uart; + zmk,kscan = &kscan0; + zmk,backlight = &backlight; + zmk,battery = &vbatt; + zmk,matrix_transform = &default_transform; + zmk,underglow = &led_strip; }; -}; - leds { - compatible = "gpio-leds"; - blue_led: led_0 { - gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; - label = "Blue LED"; - }; - }; - - vbatt: vbatt { - compatible = "zmk,battery-voltage-divider"; - label = "VBATT"; - io-channels = <&adc 2>; - output-ohms = <100000>; - full-ohms = <(100000 + 100000)>; - }; + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <20>; + rows = <5>; + + + map = < + RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,13) RC(4,14) RC(4,15) RC(4,16) RC(4,17) RC(4,18) RC(4,19) + RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,13) RC(3,14) RC(3,15) RC(3,16) RC(3,17) RC(3,18) RC(3,19) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,13) RC(2,14) RC(2,15) RC(2,16) RC(2,17) RC(2,18) RC(2,19) + RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,9) RC(1,10) RC(1,14) RC(1,15) RC(1,16) RC(1,17) RC(1,18) RC(1,19) + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,15) RC(0,16) RC(0,17) RC(0,18) RC(0,19) + + >; + }; + EXT_POWER { + compatible = "zmk,ext-power-generic"; + control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + }; + + vbatt: vbatt { + compatible = "zmk,battery-voltage-divider"; + io-channels = <&adc 2>; + output-ohms = <100000>; + full-ohms = <(100000 + 100000)>; + }; + + backlight: pwmleds { + compatible = "pwm-leds"; + pwm_led_0 { + pwms = <&pwm0 0 10000 PWM_POLARITY_NORMAL>; + }; + }; + }; &pwm0 { - status = "okay"; - ch0-pin = <17>; + status = "okay"; + pinctrl-0 = <&pwm0_default>; + pinctrl-1 = <&pwm0_sleep>; + pinctrl-names = "default", "sleep"; }; &adc { - status = "okay"; + status = "okay"; }; &gpiote { - status = "okay"; + status = "okay"; }; &gpio0 { - status = "okay"; + status = "okay"; }; &gpio1 { - status = "okay"; + status = "okay"; }; &usbd { - status = "okay"; - cdc_acm_uart: cdc_acm_uart { - compatible = "zephyr,cdc-acm-uart"; - label = "CDC_ACM_0"; - }; -}; - -&uart0 { - compatible = "nordic,nrf-uarte"; - status = "okay"; - current-speed = <115200>; - tx-pin = <39>; - rx-pin = <44>; - rts-pin = <34>; - cts-pin = <9>; + status = "okay"; + cdc_acm_uart: cdc_acm_uart { + compatible = "zephyr,cdc-acm-uart"; + }; }; &flash0 { - /* - * For more information, see: - * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html - */ - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - sd_partition: partition@0 { - label = "softdevice"; - reg = <0x00000000 0x00026000>; - }; - code_partition: partition@26000 { - label = "code_partition"; - reg = <0x00026000 0x000c6000>; - }; - - /* - * The flash starting at 0x000ec000 and ending at - * 0x000f3fff is reserved for use by the application. - */ - - /* - * Storage partition will be used by FCB/LittleFS/NVS - * if enabled. - */ - storage_partition: partition@ec000 { - label = "storage"; - reg = <0x000ec000 0x00008000>; - }; - - boot_partition: partition@f4000 { - label = "adafruit_boot"; - reg = <0x000f4000 0x0000c000>; - }; - }; + /* + * For more information, see: + * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html + */ + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + sd_partition: partition@0 { + label = "softdevice"; + reg = <0x00000000 0x00026000>; + }; + code_partition: partition@26000 { + label = "code_partition"; + reg = <0x00026000 0x000c6000>; + }; + + /* + * The flash starting at 0x000ec000 and ending at + * 0x000f3fff is reserved for use by the application. + */ + + /* + * Storage partition will be used by FCB/LittleFS/NVS + * if enabled. + */ + storage_partition: partition@ec000 { + label = "storage"; + reg = <0x000ec000 0x00008000>; + }; + + boot_partition: partition@f4000 { + label = "adafruit_boot"; + reg = <0x000f4000 0x0000c000>; + }; + }; }; -&spi1 { - compatible = "nordic,nrf-spim"; - status = "okay"; - mosi-pin = <20>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <27>; - miso-pin = <8>; +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + pinctrl-0 = <&spi3_default>; + pinctrl-1 = <&spi3_sleep>; + pinctrl-names = "default", "sleep"; - led_strip: ws2812@0 { - compatible = "worldsemi,ws2812-spi"; - label = "WS2812"; + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; - /* SPI */ - reg = <0>; - spi-max-frequency = <4000000>; + /* SPI */ + reg = <0>; + spi-max-frequency = <4000000>; - /* WS2812 */ - chain-length = <3>; /* number of LEDs */ - spi-one-frame = <0x70>; - spi-zero-frame = <0x40>; + /* WS2812 */ + chain-length = <3>; /* number of LEDs */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; - color-mapping = ; - }; + }; }; diff --git a/config/boards/arm/adv360/adv360.yaml b/config/boards/arm/adv360/adv360.yaml index 1cefe88776..4fa5d6c6cb 100644 --- a/config/boards/arm/adv360/adv360.yaml +++ b/config/boards/arm/adv360/adv360.yaml @@ -1,5 +1,5 @@ identifier: adv360 -name: Adv360 +name: Advantage 360 Pro type: keyboard arch: arm toolchain: diff --git a/config/boards/arm/adv360/adv360.zmk.yml b/config/boards/arm/adv360/adv360.zmk.yml new file mode 100644 index 0000000000..d1a6021adb --- /dev/null +++ b/config/boards/arm/adv360/adv360.zmk.yml @@ -0,0 +1,16 @@ +file_format: "1" +id: adv360 +name: Advantage 360 Pro +type: board +url: https://kinesis-ergo.com/keyboards/advantage360 +arch: arm +features: + - keys + - underglow + - backlight +outputs: + - usb + - ble +siblings: + - adv360pro_left + - adv360pro_right diff --git a/config/boards/arm/adv360/adv360_left.dts b/config/boards/arm/adv360/adv360_left.dts index 8055fd109b..87813e861e 100644 --- a/config/boards/arm/adv360/adv360_left.dts +++ b/config/boards/arm/adv360/adv360_left.dts @@ -8,40 +8,29 @@ #include "adv360.dtsi" /{ - kscan0: kscan { - compatible = "zmk,kscan-gpio-matrix"; - label = "KSCAN"; + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; - diode-direction = "col2row"; - row-gpios - = <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio1 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio0 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio1 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio1 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - ; - - col-gpios - = <&gpio0 25 GPIO_ACTIVE_HIGH> - , <&gpio0 11 GPIO_ACTIVE_HIGH> - , <&gpio0 2 GPIO_ACTIVE_HIGH> - , <&gpio0 28 GPIO_ACTIVE_HIGH> - , <&gpio0 29 GPIO_ACTIVE_HIGH> - , <&gpio0 30 GPIO_ACTIVE_HIGH> - , <&gpio0 31 GPIO_ACTIVE_HIGH> - , <&gpio1 9 GPIO_ACTIVE_HIGH> - , <&gpio0 12 GPIO_ACTIVE_HIGH> - , <&gpio0 7 GPIO_ACTIVE_HIGH> - , <&gpio0 5 GPIO_ACTIVE_HIGH> - ; - }; - - leds { - compatible = "gpio-leds"; - blue_led: led_0 { - gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; - label = "Blue LED"; - }; - }; + diode-direction = "col2row"; + row-gpios + = <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio1 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio1 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio1 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + col-gpios + = <&gpio0 25 GPIO_ACTIVE_HIGH> + , <&gpio0 11 GPIO_ACTIVE_HIGH> + , <&gpio0 2 GPIO_ACTIVE_HIGH> + , <&gpio0 28 GPIO_ACTIVE_HIGH> + , <&gpio0 29 GPIO_ACTIVE_HIGH> + , <&gpio0 30 GPIO_ACTIVE_HIGH> + , <&gpio0 31 GPIO_ACTIVE_HIGH> + , <&gpio1 9 GPIO_ACTIVE_HIGH> + , <&gpio0 12 GPIO_ACTIVE_HIGH> + , <&gpio0 7 GPIO_ACTIVE_HIGH> + ; + }; }; diff --git a/config/boards/arm/adv360/adv360_left_defconfig b/config/boards/arm/adv360/adv360_left_defconfig index a3380c7c13..b37679a4d3 100644 --- a/config/boards/arm/adv360/adv360_left_defconfig +++ b/config/boards/arm/adv360/adv360_left_defconfig @@ -1,15 +1,11 @@ # -# Copyright (c) 2021 Polarity Works +# Copyright (c) 2022 The ZMK Contributors # SPDX-License-Identifier: MIT # CONFIG_SOC_SERIES_NRF52X=y CONFIG_SOC_NRF52840_QIAA=y CONFIG_BOARD_ADV360_LEFT=y -CONFIG_ZMK_BLE=y - -CONFIG_ZMK_SPLIT=y -CONFIG_ZMK_SPLIT_ROLE_CENTRAL=y # Enable MPU CONFIG_ARM_MPU=y @@ -17,10 +13,9 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y - -# Enable SPI +# Enable SPI for LEDS +CONFIG_PINCTRL=y CONFIG_SPI=y - CONFIG_SPI_NRFX=y # Enable writing to flash @@ -34,34 +29,46 @@ CONFIG_FLASH_MAP=y # Enable 32kHz crystal CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y -CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y +CONFIG_CLOCK_CONTROL_NRF_K32SRC_150PPM=y +#RGB leds config +CONFIG_WS2812_STRIP=y CONFIG_ZMK_RGB_UNDERGLOW=y CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=y CONFIG_ZMK_RGB_UNDERGLOW_ON_START=y CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=4 CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE=y -# Use the STRIP config specific to the LEDs you're using -CONFIG_WS2812_STRIP=y -CONFIG_BT_CTLR_TX_PWR_PLUS_8=y +#Backlighting configuration CONFIG_PWM=y CONFIG_LED_PWM=y CONFIG_ZMK_BACKLIGHT=y +CONFIG_ZMK_BACKLIGHT_BRT_START=20 CONFIG_ZMK_BACKLIGHT_AUTO_OFF_IDLE=y -CONFIG_ZMK_HID_REPORT_TYPE_NKRO=y -CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y - +#BT configuration +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y +CONFIG_BT_DIS_MANUF="Kinesis Corporation" +#CONFIG_BT_PRIVACY=n +#CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS=y +#CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=600 +#CONFIG_BT_PERIPHERAL_PREF_MIN_INT=12 +#CONFIG_BT_PERIPHERAL_PREF_MAX_INT=24 +#CONFIG_BT_PERIPHERAL_PREF_LATENCY=30 +CONFIG_BT_BAS=n #Set this to y to enable BLE battery reporting + +#Misc configuration CONFIG_USB_DEVICE_VID=0x29EA CONFIG_USB_DEVICE_PID=0x0362 CONFIG_USB_DEVICE_MANUFACTURER="Kinesis Corporation" -CONFIG_BT_DIS_MANUF="Kinesis Corporation" - -# Turn on logging, and set ZMK logging to debug output -CONFIG_LOG=y -CONFIG_ZMK_USB_LOGGING=y - +CONFIG_ZMK_HID_REPORT_TYPE_NKRO=y +CONFIG_ZMK_HID_KEYBOARD_EXTENDED_REPORT=n #Set this to y for F13-F24 and intl keys with NKRO +CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y +CONFIG_BUILD_OUTPUT_UF2=y +CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES=y +CONFIG_ZMK_BLE_PASSKEY_ENTRY=n -CONFIG_BUILD_OUTPUT_UF2=y +CONFIG_ZMK_BLE=y +CONFIG_ZMK_USB=y +CONFIG_ZMK_HID_INDICATORS=y \ No newline at end of file diff --git a/config/boards/arm/adv360/adv360_pinctrl.dtsi b/config/boards/arm/adv360/adv360_pinctrl.dtsi new file mode 100644 index 0000000000..7dafcdcecf --- /dev/null +++ b/config/boards/arm/adv360/adv360_pinctrl.dtsi @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2023 The ZMK Contributors + * SPDX-License-Identifier: MIT + */ + +&pinctrl { + spi3_default: spi3_default { + group1 { + psels = ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; + pwm0_default: pwm0_default { + group1 { + psels = ; + }; + }; + pwm0_sleep: pwm0_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; \ No newline at end of file diff --git a/config/boards/arm/adv360/adv360_right.dts b/config/boards/arm/adv360/adv360_right.dts index afd38f355f..b7d96787e4 100644 --- a/config/boards/arm/adv360/adv360_right.dts +++ b/config/boards/arm/adv360/adv360_right.dts @@ -11,44 +11,33 @@ - kscan0: kscan { - compatible = "zmk,kscan-gpio-matrix"; - label = "KSCAN"; - - diode-direction = "col2row"; - row-gpios - = <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio0 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio0 31 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio0 30 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio0 29 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - ; - - col-gpios - = <&gpio1 14 GPIO_ACTIVE_HIGH> - , <&gpio0 12 GPIO_ACTIVE_HIGH> - , <&gpio1 9 GPIO_ACTIVE_HIGH> - , <&gpio0 7 GPIO_ACTIVE_HIGH> - , <&gpio1 11 GPIO_ACTIVE_HIGH> - , <&gpio1 10 GPIO_ACTIVE_HIGH> - , <&gpio1 13 GPIO_ACTIVE_HIGH> - , <&gpio1 15 GPIO_ACTIVE_HIGH> - , <&gpio0 3 GPIO_ACTIVE_HIGH> - , <&gpio0 2 GPIO_ACTIVE_HIGH> - , <&gpio0 28 GPIO_ACTIVE_HIGH> - ; - }; - - leds { - compatible = "gpio-leds"; - blue_led: led_0 { - gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; - label = "Blue LED"; - }; - }; - + kscan0: kscan { + compatible = "zmk,kscan-gpio-matrix"; + + diode-direction = "col2row"; + row-gpios + = <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 31 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 30 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&gpio0 29 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + col-gpios + = <&gpio0 12 GPIO_ACTIVE_HIGH> + , <&gpio1 9 GPIO_ACTIVE_HIGH> + , <&gpio0 7 GPIO_ACTIVE_HIGH> + , <&gpio1 11 GPIO_ACTIVE_HIGH> + , <&gpio1 10 GPIO_ACTIVE_HIGH> + , <&gpio1 13 GPIO_ACTIVE_HIGH> + , <&gpio1 15 GPIO_ACTIVE_HIGH> + , <&gpio0 3 GPIO_ACTIVE_HIGH> + , <&gpio0 2 GPIO_ACTIVE_HIGH> + , <&gpio0 28 GPIO_ACTIVE_HIGH> + ; + }; }; &default_transform { - col-offset = <11>; - }; + col-offset = <10>; + }; diff --git a/config/boards/arm/adv360/adv360_right_defconfig b/config/boards/arm/adv360/adv360_right_defconfig index 1a7a122881..3c2e65a3b1 100644 --- a/config/boards/arm/adv360/adv360_right_defconfig +++ b/config/boards/arm/adv360/adv360_right_defconfig @@ -1,14 +1,11 @@ # -# Copyright (c) 2021 Polarity Works +# Copyright (c) 2022 The ZMK Contributors # SPDX-License-Identifier: MIT # CONFIG_SOC_SERIES_NRF52X=y CONFIG_SOC_NRF52840_QIAA=y CONFIG_BOARD_ADV360_RIGHT=y -CONFIG_ZMK_BLE=y -CONFIG_ZMK_SPLIT=y - # Enable MPU CONFIG_ARM_MPU=y @@ -16,9 +13,8 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y - - -# Enable SPI +# Enable SPI for LEDS +CONFIG_PINCTRL=y CONFIG_SPI=y CONFIG_SPI_NRFX=y @@ -33,35 +29,33 @@ CONFIG_FLASH_MAP=y # Enable 32kHz crystal CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y -CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y +CONFIG_CLOCK_CONTROL_NRF_K32SRC_150PPM=y +#RGB leds config +CONFIG_WS2812_STRIP=y CONFIG_ZMK_RGB_UNDERGLOW=y CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=y CONFIG_ZMK_RGB_UNDERGLOW_ON_START=y CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=4 CONFIG_ZMK_RGB_UNDERGLOW_AUTO_OFF_IDLE=y -# Use the STRIP config specific to the LEDs you're using -CONFIG_WS2812_STRIP=y -CONFIG_BT_CTLR_TX_PWR_PLUS_8=y +#Backlighting configuration CONFIG_PWM=y CONFIG_LED_PWM=y CONFIG_ZMK_BACKLIGHT=y +CONFIG_ZMK_BACKLIGHT_BRT_START=20 CONFIG_ZMK_BACKLIGHT_AUTO_OFF_IDLE=y -CONFIG_ZMK_HID_REPORT_TYPE_NKRO=y -CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y - +#Misc configuration CONFIG_USB_DEVICE_VID=0x29EA CONFIG_USB_DEVICE_PID=0x0362 CONFIG_USB_DEVICE_MANUFACTURER="Kinesis Corporation" +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y +CONFIG_ZMK_HID_REPORT_TYPE_NKRO=y +CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y +CONFIG_BUILD_OUTPUT_UF2=y -# Turn on logging, and set ZMK logging to debug output -CONFIG_LOG=y -CONFIG_ZMK_USB_LOGGING=y - - - - +CONFIG_ZMK_BLE_EXPERIMENTAL_FEATURES=y -CONFIG_BUILD_OUTPUT_UF2=y +CONFIG_ZMK_BLE=y +CONFIG_ZMK_USB=y diff --git a/config/boards/arm/adv360/board.cmake b/config/boards/arm/adv360/board.cmake index 4eb48208af..34652907dc 100644 --- a/config/boards/arm/adv360/board.cmake +++ b/config/boards/arm/adv360/board.cmake @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Polarity Works +# Copyright (c) 2022 The ZMK Contributors # SPDX-License-Identifier: MIT # diff --git a/config/boards/arm/adv360/macros.dtsi b/config/boards/arm/adv360/macros.dtsi new file mode 100644 index 0000000000..69f6c4f3ab --- /dev/null +++ b/config/boards/arm/adv360/macros.dtsi @@ -0,0 +1,36 @@ + macro_quotes: macro_quotes { + compatible = "zmk,behavior-macro"; + label = "macro_quotes"; + #binding-cells = <0>; + bindings = <&kp SQT>, <&kp SQT>, <&kp LEFT>; + }; + macro_dquotes: macro_dquotes { + compatible = "zmk,behavior-macro"; + label = "macro_dquotes"; + #binding-cells = <0>; + bindings = <&kp DQT>, <&kp DQT>, <&kp LEFT>; + }; + macro_braces: macro_braces { + compatible = "zmk,behavior-macro"; + label = "macro_braces"; + #binding-cells = <0>; + bindings = <&kp LBRC>, <&kp RBRC>, <&kp LEFT>; + }; + macro_parens: macro_parens { + compatible = "zmk,behavior-macro"; + label = "macro_parens"; + #binding-cells = <0>; + bindings = <&kp LPAR>, <&kp RPAR>, <&kp LEFT>; + }; + macro_brackets: macro_brackets { + compatible = "zmk,behavior-macro"; + label = "macro_brackets"; + #binding-cells = <0>; + bindings = <&kp LBKT>, <&kp RBKT>, <&kp LEFT>; + }; + macro_kinesis: macro_kinesis { + compatible = "zmk,behavior-macro"; + label = "macro_kinesis"; + #binding-cells = <0>; + bindings = <&kp K>, <&kp I>, <&kp N>, <&kp E>, <&kp S>, <&kp I>, <&kp S>; + }; diff --git a/config/info.json b/config/info.json index 5b0841d6e3..c25173a926 100644 --- a/config/info.json +++ b/config/info.json @@ -9,13 +9,13 @@ { "label": "4", "row": 0, "col": 4, "x": 4.25, "y": 0 }, { "label": "5", "row": 0, "col": 5, "x": 5.25, "y": 0 }, { "label": "mod1", "row": 0, "col": 6, "x": 6.25, "y": 0 }, - { "label": "mod2", "row": 0, "col": 7, "x": 10.75, "y": 0 }, - { "label": "6", "row": 0, "col": 8, "x": 11.75, "y": 0 }, - { "label": "7", "row": 0, "col": 9, "x": 12.75, "y": 0 }, - { "label": "8", "row": 0, "col": 10, "x": 13.75, "y": 0 }, - { "label": "9", "row": 0, "col": 11, "x": 14.75, "y": 0 }, - { "label": "0", "row": 0, "col": 12, "x": 15.75, "y": 0.25 }, - { "label": "-", "row": 0, "col": 13, "x": 16.75, "y": 0.25, "w": 1.25 }, + { "label": "mod2", "row": 0, "col": 13, "x": 10.75, "y": 0 }, + { "label": "6", "row": 0, "col": 14, "x": 11.75, "y": 0 }, + { "label": "7", "row": 0, "col": 15, "x": 12.75, "y": 0 }, + { "label": "8", "row": 0, "col": 16, "x": 13.75, "y": 0 }, + { "label": "9", "row": 0, "col": 17, "x": 14.75, "y": 0 }, + { "label": "0", "row": 0, "col": 18, "x": 15.75, "y": 0.25 }, + { "label": "-", "row": 0, "col": 19, "x": 16.75, "y": 0.25, "w": 1.25 }, { "label": "Tab", "row": 1, "col": 0, "x": 0, "y": 1.25, "w": 1.25 }, { "label": "Q", "row": 1, "col": 1, "x": 1.25, "y": 1.25 }, @@ -24,13 +24,13 @@ { "label": "R", "row": 1, "col": 4, "x": 4.25, "y": 1 }, { "label": "T", "row": 1, "col": 5, "x": 5.25, "y": 1 }, { "label": "mod3", "row": 1, "col": 6, "x": 6.25, "y": 1 }, - { "label": "mod4", "row": 1, "col": 7, "x": 10.75, "y": 1 }, - { "label": "Y", "row": 1, "col": 8, "x": 11.75, "y": 1 }, - { "label": "U", "row": 1, "col": 9, "x": 12.75, "y": 1 }, - { "label": "I", "row": 1, "col": 10, "x": 13.75, "y": 1 }, - { "label": "O", "row": 1, "col": 11, "x": 14.75, "y": 1 }, - { "label": "P", "row": 1, "col": 12, "x": 15.75, "y": 1.25 }, - { "label": "\\", "row": 1, "col": 13, "x": 16.75, "y": 1.25, "w": 1.25 }, + { "label": "mod4", "row": 1, "col": 13, "x": 10.75, "y": 1 }, + { "label": "Y", "row": 1, "col": 14, "x": 11.75, "y": 1 }, + { "label": "U", "row": 1, "col": 15, "x": 12.75, "y": 1 }, + { "label": "I", "row": 1, "col": 16, "x": 13.75, "y": 1 }, + { "label": "O", "row": 1, "col": 17, "x": 14.75, "y": 1 }, + { "label": "P", "row": 1, "col": 18, "x": 15.75, "y": 1.25 }, + { "label": "\\", "row": 1, "col": 19, "x": 16.75, "y": 1.25, "w": 1.25 }, { "label": "Caps", "row": 2, "col": 0, "x": 0, "y": 2.25, "w":1.25 }, @@ -58,14 +58,8 @@ { "label": "C", "row": 3, "col": 3, "x": 3.25, "y": 3 }, { "label": "V", "row": 3, "col": 4, "x": 4.25, "y": 3 }, { "label": "B", "row": 3, "col": 5, "x": 5.25, "y": 3 }, - { "label": "1U1", "row": 3, "col": 6, "x": 5.75, "y": 5, "r":15, "rx":5.25 ,"ry":4, "h":0}, - { "label": "1U2", "row": 3, "col": 7, "x": 6.75, "y": 5, "r":15, "rx":5.25 ,"ry":4, "h":0}, { "label": "Home", "row": 3, "col": 8, "x": 7.75, "y": 5, "r":15, "rx":5.25 ,"ry":4}, - { "label": "Ped3", "row": 3, "col": 9, "x": 20, "y": 5}, - { "label": "Ped4", "row": 3, "col": 10, "x": 21, "y": 5}, { "label": "PgUp", "row": 3, "col": 11, "x": 9.25, "y": 5, "r":-15, "rx":12.75 ,"ry":4}, - { "label": "1U3", "row": 3, "col": 12, "x": 10.25, "y": 5, "r":-15, "rx":12.75 ,"ry":4, "h":0}, - { "label": "1U4", "row": 3, "col": 13, "x": 11.25, "y": 5, "r":-15, "rx":12.75 ,"ry":4, "h":0}, { "label": "N", "row": 3, "col": 14, "x": 11.75, "y": 3 }, { "label": "M", "row": 3, "col": 15, "x": 12.75, "y": 3 }, { "label": ",", "row": 3, "col": 16, "x": 13.75, "y": 3 }, @@ -75,20 +69,20 @@ { "label": "mod7", "row": 4, "col": 0, "x": 0, "y": 4.25, "w":1.25}, { "label": "`", "row": 4, "col": 1, "x": 1.25, "y": 4.25 }, - { "label": "\\", "row": 4, "col": 2, "x": 2.25, "y": 4 }, - { "label": "V", "row": 4, "col": 3, "x": 3.25, "y": 4 }, - { "label": "B", "row": 4, "col": 4, "x": 4.25, "y": 4 }, - { "label": "Bksp", "row": 4, "col": 5, "x": 5.75, "y": 5, "r":15, "rx":5.25 ,"ry":4, "h":2}, - { "label": "Del", "row": 4, "col": 6, "x": 6.75, "y": 5, "r":15, "rx":5.25 ,"ry":4, "h":2}, - { "label": "End", "row": 4, "col": 7, "x": 7.75, "y": 6, "r":15, "rx":5.25 ,"ry":4}, - { "label": "PgDn", "row": 4, "col": 8, "x": 9.25, "y": 6, "r":-15, "rx":12.75 ,"ry":4}, - { "label": "Enter", "row": 4, "col": 9, "x": 10.25, "y": 5, "r":-15, "rx":12.75 ,"ry":4, "h":2}, - { "label": "Space", "row": 4, "col": 10, "x": 11.25, "y": 5, "r":-15, "rx":12.75 ,"ry":4, "h":2}, - { "label": "Up", "row": 4, "col": 11, "x": 12.75, "y": 4 }, - { "label": "Down", "row": 4, "col": 12, "x": 13.75, "y": 4 }, - { "label": ",", "row": 4, "col": 13, "x": 14.75, "y": 4 }, - { "label": ".", "row": 4, "col": 14, "x": 15.75, "y": 4.25 }, - { "label": "mod8", "row": 4, "col": 15, "x": 16.75, "y": 4.25, "w":1.25 } + { "label": "Caps", "row": 4, "col": 2, "x": 2.25, "y": 4 }, + { "label": "Left", "row": 4, "col": 3, "x": 3.25, "y": 4 }, + { "label": "Right", "row": 4, "col": 4, "x": 4.25, "y": 4 }, + { "label": "Bksp", "row": 4, "col": 6, "x": 5.75, "y": 5, "r":15, "rx":5.25 ,"ry":4, "h":2}, + { "label": "Del", "row": 4, "col": 7, "x": 6.75, "y": 5, "r":15, "rx":5.25 ,"ry":4, "h":2}, + { "label": "End", "row": 4, "col": 8, "x": 7.75, "y": 6, "r":15, "rx":5.25 ,"ry":4}, + { "label": "PgDn", "row": 4, "col": 11, "x": 9.25, "y": 6, "r":-15, "rx":12.75 ,"ry":4}, + { "label": "RET", "row": 4, "col": 12, "x": 10.25, "y": 5, "r":-15, "rx":12.75 ,"ry":4, "h":2}, + { "label": "SPC", "row": 4, "col": 13, "x": 11.25, "y": 5, "r":-15, "rx":12.75 ,"ry":4, "h":2}, + { "label": "Up", "row": 4, "col": 15, "x": 12.75, "y": 4 }, + { "label": "Down", "row": 4, "col": 16, "x": 13.75, "y": 4 }, + { "label": ",", "row": 4, "col": 17, "x": 14.75, "y": 4 }, + { "label": ".", "row": 4, "col": 18, "x": 15.75, "y": 4.25 }, + { "label": "mod8", "row": 4, "col": 19, "x": 16.75, "y": 4.25, "w":1.25 } ] } } diff --git a/config/keymap.json b/config/keymap.json index c64c6e2f2e..bc6421a1c9 100644 --- a/config/keymap.json +++ b/config/keymap.json @@ -2,37 +2,343 @@ "keyboard": "adv360", "keymap": "default", "layout": "LAYOUT", - "layer_names": [ - "base", - "keypad", - "fn", - "mod" - ], + "layer_names": ["base", "keypad", "fn", "mod"], "layers": [ [ - "&kp EQUAL", "&kp N1", "&kp N2", "&kp N3", "&kp N4", "&kp N5", "&tog 1", "&mo 3", "&kp N6", "&kp N7", "&kp N8", "&kp N9", "&kp N0", "&kp MINUS", - "&kp TAB", "&kp Q", "&kp W", "&kp F", "&kp P", "&kp B", "&tog 0", "&none", "&kp J", "&kp L", "&kp O", "&kp Y", "&kp SEMI", "&kp BSLH", - "&kp ESC", "&kp A", "&kp R", "&kp S", "&kp T", "&kp G", "&tog 2", "&mo 2", "&kp LEFT_ALT", "&kp PG_UP", "&kp LEFT_META", "&kp LEFT_SHIFT", "&kp M", "&kp N", "&kp E", "&kp I", "&kp U", "&kp SQT", - "&kp LSHFT", "&kp Z", "&kp X", "&kp C", "&kp D", "&kp V", "&none", "&none", "&kp LEFT_SHIFT", "&none", "&none", "&kp PG_DN", "&none", "&none", "&kp K", "&kp H", "&kp COMMA", "&kp DOT", "&kp FSLH", "&kp RSHFT", - "&mo 2", "&kp GRAVE", "&kp CAPS", "&kp LEFT_ARROW", "&kp RIGHT_ARROW", "&mt LEFT_CONTROL ESCAPE", "&mt LEFT_SHIFT SPACE", "&mt LEFT_GUI ENTER", "&kp TAB", "&kp BACKSPACE", "&mt RIGHT_META TAB", "&kp UP_ARROW", "&kp DOWN_ARROW", "&kp LBKT", "&kp RBKT", "&mo 2" - ], [ - "&kp EQUAL", "&kp N1", "&kp N2", "&kp N3", "&kp N4", "&kp N5", "&trans", "&mo 3", "&kp N6", "&kp KP_NUM", "&kp KP_EQUAL", "&kp KP_DIVIDE", "&kp KP_MULTIPLY", "&kp MINUS", - "&kp TAB", "&kp LEFT_BRACKET", "&kp NUMBER_7", "&kp NUMBER_8", "&kp NUMBER_9", "&kp RIGHT_BRACKET", "&trans", "&trans", "&kp Y", "&kp KP_N7", "&kp KP_N8", "&kp KP_N9", "&kp KP_MINUS", "&kp BSLH", - "&kp ESC", "&kp SEMICOLON", "&kp NUMBER_4", "&kp N5", "&kp N6", "&kp EQUAL", "&none", "&trans", "&trans", "&trans", "&trans", "&trans", "&kp H", "&kp KP_N4", "&kp KP_N5", "&kp KP_N6", "&kp KP_PLUS", "&kp SQT", - "&kp LSHFT", "&kp GRAVE", "&kp N1", "&kp N2", "&kp N3", "&kp BACKSLASH", "&none", "&none", "&trans", "&none", "&none", "&trans", "&none", "&none", "&kp N", "&kp KP_N1", "&kp KP_N2", "&kp KP_N3", "&kp KP_ENTER", "&kp RSHFT", - "&mo 2", "&kp GRAVE", "&kp CAPS", "&kp LEFT", "&kp RIGHT", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&kp UP", "&kp DOWN", "&kp KP_DOT", "&kp RBKT", "&mo 2" - ], [ - "&kp F1", "&kp F2", "&kp F3", "&kp F4", "&kp F5", "&kp F6", "&trans", "&mo 3", "&kp F7", "&kp F8", "&kp F9", "&kp F10", "&kp F11", "&kp F12", - "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&kp K_REDO", "&kp K_PASTE", "&kp K_COPY", "&kp K_CUT", "&kp K_UNDO", "&trans", - "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&none", "&kp LEFT_ARROW", "&kp DOWN_ARROW", "&kp UP_ARROW", "&kp RIGHT_ARROW", "&trans", - "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&none", "&none", "&trans", "&none", "&none", "&trans", "&none", "&none", "&kp INSERT", "&trans", "&kp PAGE_DOWN", "&kp PAGE_UP", "&kp END", "&trans", - "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&trans", "&kp UP_ARROW", "&kp DOWN_ARROW", "&trans", "&trans", "&trans" - ], [ - "&none", "&bt BT_SEL 0", "&bt BT_SEL 1", "&bt BT_SEL 2", "&bt BT_SEL 3", "&bt BT_SEL 4", "&tog 0", "&trans", "&bt BT_SEL 0", "&bt BT_SEL 1", "&bt BT_SEL 2", "&bt BT_SEL 3", "&bt BT_SEL 4", "&none", - "&none", "&none", "&none", "&none", "&none", "&none", "&trans", "&bootloader", "&none", "&none", "&none", "&none", "&none", "&none", - "&none", "&none", "&none", "&none", "&none", "&none", "&rgb_ug RGB_MEFS_CMD 5", "&bt BT_CLR", "&none", "&bt BT_CLR", "&bt BT_CLR", "&rgb_ug RGB_MEFS_CMD 5", "&none", "&none", "&none", "&none", "&none", "&none", - "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", "&none", - "&none", "&none", "&none", "&bl BL_INC", "&bl BL_DEC", "&rgb_ug RGB_TOG", "&bl BL_TOG", "&none", "&none", "&bl BL_TOG", "&rgb_ug RGB_TOG", "&bl BL_INC", "&bl BL_DEC", "&none", "&none", "&none" + "&kp EQUAL", + "&kp N1", + "&kp N2", + "&kp N3", + "&kp N4", + "&kp N5", + "&tog 1", + "&mo 3", + "&kp N6", + "&kp N7", + "&kp N8", + "&kp N9", + "&kp N0", + "&kp MINUS", + "&kp TAB", + "&kp Q", + "&kp W", + "&kp F", + "&kp P", + "&kp B", + "&tog 0", + "&none", + "&kp J", + "&kp L", + "&kp O", + "&kp Y", + "&kp SEMI", + "&kp BSLH", + "&kp ESC", + "&kp A", + "&kp R", + "&kp S", + "&kp T", + "&kp G", + "&tog 2", + "&mo 2", + "&kp LEFT_ALT", + "&kp PG_UP", + "&kp LEFT_META", + "&kp LEFT_SHIFT", + "&kp M", + "&kp N", + "&kp E", + "&kp I", + "&kp U", + "&kp SQT", + "&kp LSHFT", + "&kp Z", + "&kp X", + "&kp C", + "&kp D", + "&kp V", + "&none", + "&none", + "&kp LEFT_SHIFT", + "&none", + "&none", + "&kp PG_DN", + "&none", + "&none", + "&kp K", + "&kp H", + "&kp COMMA", + "&kp DOT", + "&kp FSLH", + "&kp RSHFT", + "&mo 2", + "&kp GRAVE", + "&kp CAPS", + "&kp LEFT_ARROW", + "&kp RIGHT_ARROW", + "&mt LEFT_CONTROL ESCAPE", + "&mt LEFT_SHIFT SPACE", + "&mt LEFT_GUI ENTER", + "&kp TAB", + "&kp BACKSPACE", + "&mt RIGHT_META TAB", + "&kp UP_ARROW", + "&kp DOWN_ARROW", + "&kp LBKT", + "&kp RBKT", + "&mo 2" + ], + [ + "&kp EQUAL", + "&kp N1", + "&kp N2", + "&kp N3", + "&kp N4", + "&kp N5", + "&trans", + "&mo 3", + "&kp N6", + "&kp KP_NUM", + "&kp KP_EQUAL", + "&kp KP_DIVIDE", + "&kp KP_MULTIPLY", + "&kp MINUS", + "&kp TAB", + "&kp LEFT_BRACKET", + "&kp NUMBER_7", + "&kp NUMBER_8", + "&kp NUMBER_9", + "&kp RIGHT_BRACKET", + "&trans", + "&trans", + "&kp Y", + "&kp KP_N7", + "&kp KP_N8", + "&kp KP_N9", + "&kp KP_MINUS", + "&kp BSLH", + "&kp ESC", + "&kp SEMICOLON", + "&kp NUMBER_4", + "&kp N5", + "&kp N6", + "&kp EQUAL", + "&none", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&kp H", + "&kp KP_N4", + "&kp KP_N5", + "&kp KP_N6", + "&kp KP_PLUS", + "&kp SQT", + "&kp LSHFT", + "&kp GRAVE", + "&kp N1", + "&kp N2", + "&kp N3", + "&kp BACKSLASH", + "&none", + "&none", + "&trans", + "&none", + "&none", + "&trans", + "&none", + "&none", + "&kp N", + "&kp KP_N1", + "&kp KP_N2", + "&kp KP_N3", + "&kp KP_ENTER", + "&kp RSHFT", + "&mo 2", + "&kp GRAVE", + "&kp CAPS", + "&kp LEFT", + "&kp RIGHT", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&kp UP", + "&kp DOWN", + "&kp KP_DOT", + "&kp RBKT", + "&mo 2" + ], + [ + "&kp F1", + "&kp F2", + "&kp F3", + "&kp F4", + "&kp F5", + "&kp F6", + "&trans", + "&mo 3", + "&kp F7", + "&kp F8", + "&kp F9", + "&kp F10", + "&kp F11", + "&kp F12", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&kp K_REDO", + "&kp K_PASTE", + "&kp K_COPY", + "&kp K_CUT", + "&kp K_UNDO", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&none", + "&kp LEFT_ARROW", + "&kp DOWN_ARROW", + "&kp UP_ARROW", + "&kp RIGHT_ARROW", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&none", + "&none", + "&trans", + "&none", + "&none", + "&trans", + "&none", + "&none", + "&kp INSERT", + "&trans", + "&kp PAGE_DOWN", + "&kp PAGE_UP", + "&kp END", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&trans", + "&kp UP_ARROW", + "&kp DOWN_ARROW", + "&trans", + "&trans", + "&trans" + ], + [ + "&none", + "&bt BT_SEL 0", + "&bt BT_SEL 1", + "&bt BT_SEL 2", + "&bt BT_SEL 3", + "&bt BT_SEL 4", + "&tog 0", + "&trans", + "&bt BT_SEL 0", + "&bt BT_SEL 1", + "&bt BT_SEL 2", + "&bt BT_SEL 3", + "&bt BT_SEL 4", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&trans", + "&bootloader", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&rgb_ug RGB_MEFS_CMD 5", + "&bt BT_CLR", + "&none", + "&bt BT_CLR", + "&bt BT_CLR", + "&rgb_ug RGB_MEFS_CMD 5", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&none", + "&bl BL_INC", + "&bl BL_DEC", + "&rgb_ug RGB_TOG", + "&bl BL_TOG", + "&none", + "&none", + "&bl BL_TOG", + "&rgb_ug RGB_TOG", + "&bl BL_INC", + "&bl BL_DEC", + "&none", + "&none", + "&none" ] ] -} \ No newline at end of file +} diff --git a/config/version.dtsi b/config/version.dtsi new file mode 100644 index 0000000000..e69de29bb2 diff --git a/config/west.yml b/config/west.yml index bf3935ad9d..e35c82658b 100644 --- a/config/west.yml +++ b/config/west.yml @@ -7,7 +7,7 @@ manifest: projects: - name: zmk remote: refil - revision: adv360-z3 + revision: adv360-z3.2-3 import: app/west.yml self: path: config diff --git a/run.sh b/run.sh deleted file mode 100755 index 4fc5cacccd..0000000000 --- a/run.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e - -docker run -it --name zmk zmk -docker cp zmk:/app/firmware/ ./ -docker stop zmk -docker rm zmk diff --git a/settings-reset.uf2 b/settings-reset.uf2 index 6a2b426837..4fb2546704 100644 Binary files a/settings-reset.uf2 and b/settings-reset.uf2 differ diff --git a/setup.sh b/setup.sh deleted file mode 100755 index 96a478e774..0000000000 --- a/setup.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -e - -docker build --tag zmk .