Skip to content

Commit

Permalink
Merge remote-tracking branch 'kinesis/V3.0' into V3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderdrummer committed Jul 14, 2023
2 parents 63a73ce + 771d68f commit 37091d1
Show file tree
Hide file tree
Showing 22 changed files with 368 additions and 263 deletions.
62 changes: 62 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -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 later
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 clik 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.
Binary file added assets/commit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/conflict.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/json.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/keymap.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/merge.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions config/adv360.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
keymap {
compatible = "zmk,keymap";


default_layer {
bindings = <
&none &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &none &mo 1 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &none
Expand Down Expand Up @@ -117,7 +116,7 @@
&trans &kp TILDE &kp GRAVE &kp LBKT &kp RBKT &kp PLUS &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;
};
};

symbols {
bindings = <
Expand Down
8 changes: 4 additions & 4 deletions config/boards/arm/adv360/Kconfig
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions config/boards/arm/adv360/Kconfig.board
Original file line number Diff line number Diff line change
@@ -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
30 changes: 16 additions & 14 deletions config/boards/arm/adv360/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -1,59 +1,61 @@
#
# 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


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
default BT

config ZMK_BLE
default y
default y

config ZMK_USB
default y
default y

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



Expand Down
Loading

0 comments on commit 37091d1

Please sign in to comment.