Skip to content

Commit

Permalink
all: switch to adv360pro board
Browse files Browse the repository at this point in the history
Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
  • Loading branch information
zchee committed Dec 27, 2023
1 parent 617f1c0 commit 051a504
Show file tree
Hide file tree
Showing 28 changed files with 246 additions and 280 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# https://github.com/github/linguist/blob/master/docs/overrides.md

* -text

config/**/*.dts linguist-language=devicetree
config/**/*.dtsi linguist-language=devicetree
config/**/*.keymap linguist-language=devicetree
config/**/*defconfig linguist-language=c
config/**/Kconfig* linguist-language=c
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
- name: West Zephyr export
run: west zephyr-export
- name: West Build (left)
run: west build -s zmk/app -d build/left -b adv360_left -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
run: west build -s zmk/app -d build/left -b adv360pro_left -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
- name: Adv360 Left Kconfig file
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"
run: west build -s zmk/app -d build/right -b adv360pro_right -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
- name: Adv360 Right Kconfig file
run: grep -vE '(^#|^$)' build/right/zephyr/.config
- name: Rename zmk.uf2
Expand Down
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
DOCKER := $(shell { command -v docker || command -v podman; })
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

CONTAINER_IMAGE = zmk:latest
DOCKER_FLAGS = --rm --pull -f Dockerfile -t ${CONTAINER_IMAGE}
Expand All @@ -27,8 +19,8 @@ build:

compile:
$(DOCKER) container run --rm -it --name zmk \
--mount type=bind,src=$(PWD)/firmware,dst=/app/firmware$(SELINUX1) \
--mount type=bind,src=$(PWD)/config,dst=/app/config:ro$(SELINUX2) \
--mount type=bind,src=$(PWD)/firmware,target=/app/firmware \
--mount type=bind,src=$(PWD)/config,target=/app/config,readonly \
--env TIMESTAMP=$(TIMESTAMP) \
--env COMMIT=$(COMMIT) \
${CONTAINER_IMAGE}
Expand Down
6 changes: 3 additions & 3 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ set -eu

PWD=$(pwd)
TIMESTAMP="${TIMESTAMP:-$(date -u +"%Y%m%d%H%M")}"
COMMIT="${COMMIT:-$(echo xxxxxx)}"
COMMIT="${COMMIT:-devel}"

# West Build (left)
west build -s zmk/app -d build/left -b adv360_left -- -DZMK_CONFIG="${PWD}/config"
west build -s zmk/app -d build/left -b adv360pro_left -- -Wno-dev -DZMK_CONFIG="${PWD}/config"
# Adv360 Left Kconfig file
grep -vE '(^#|^$)' build/left/zephyr/.config
# West Build (right)
west build -s zmk/app -d build/right -b adv360_right -- -DZMK_CONFIG="${PWD}/config"
west build -s zmk/app -d build/right -b adv360pro_right -- -Wno-dev -DZMK_CONFIG="${PWD}/config"
# Adv360 Right Kconfig file
grep -vE '(^#|^$)' build/right/zephyr/.config
# Rename zmk.uf2
Expand Down
82 changes: 0 additions & 82 deletions config/adv360.keymap

This file was deleted.

57 changes: 57 additions & 0 deletions config/adv360pro.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/rgb.h>
#include <dt-bindings/zmk/backlight.h>

/ {
keymap {
compatible = "zmk,keymap";

default_layer {
bindings = <
&kp AMPERSAND &kp LEFT_BRACKET &kp LEFT_BRACE &kp RIGHT_BRACE &kp LEFT_PARENTHESIS &kp EQUAL &none &mo 3 &kp ASTRK &kp RIGHT_PARENTHESIS &kp PLUS &kp RIGHT_BRACKET &kp EXCLAMATION &kp HASH
&kp TAB &kp COLON &kp COMMA &kp DOT &kp P &kp Y &none &none &kp F &kp G &kp C &kp R &kp L &kp BSLH
&kp LCTRL &kp A &kp O &kp E &kp U &kp I &none &kp LCMD &kp LALT &kp RALT &kp RCMD &none &kp D &kp H &kp T &kp N &kp S &kp MINUS
&mo 4 &kp SINGLE_QUOTE &kp Q &kp J &kp K &kp X &kp F9 &kp F9 &kp B &kp M &kp W &kp V &kp Z &mo 4
&kp LSHIFT &kp DOLLAR &kp TILDE &kp LEFT &kp DOWN &kp BSPC &kp LCTRL &kp F8 &kp ESCAPE &kp ENTER &kp SPACE &kp UP &kp RIGHT &kp SLASH &kp AT &kp RSHIFT
>;
};
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 &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 &none &bl BL_TOG &rgb_ug RGB_TOG &bl BL_INC &bl BL_DEC &none &none &none
>;
};
shift {
bindings = <
&kp PERCENT &kp NUMBER_7 &kp NUMBER_5 &kp NUMBER_3 &kp NUMBER_1 &kp NUMBER_9 &trans &trans &kp NUMBER_0 &kp NUMBER_2 &kp NUMBER_4 &kp NUMBER_6 &kp NUMBER_8 &kp GRAVE
&kp LS(TAB) &kp SEMICOLON &kp LESS_THAN &kp GREATER_THAN &kp LS(P) &kp LS(Y) &trans &trans &kp LS(F) &kp LS(G) &kp LS(C) &kp LS(R) &kp LS(L) &kp PIPE
&kp LS(LCTRL) &kp LS(A) &kp LS(O) &kp LS(E) &kp LS(U) &kp LS(I) &trans &kp LS(LCMD) &kp LS(LALT) &kp LS(RALT) &kp LS(RCMD) &trans &kp LS(D) &kp LS(H) &kp LS(T) &kp LS(N) &kp LS(S) &kp UNDERSCORE
&trans &kp DOUBLE_QUOTES &kp LS(Q) &kp LS(J) &kp LS(K) &kp LS(X) &trans &trans &kp LS(B) &kp LS(M) &kp LS(W) &kp LS(V) &kp LS(Z) &trans
&trans &kp DOLLAR &kp TILDE &kp LS(LEFT) &kp LS(DOWN) &kp LS(BSPC) &kp LS(LCTRL) &trans &kp LS(ESC) &kp LS(ENTER) &kp LS(SPACE) &kp LS(UP) &kp LS(RIGHT) &kp QUESTION &kp CARET &trans
>;
};
};
};
2 changes: 1 addition & 1 deletion config/adv360_left.keymap → config/adv360pro_left.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
*
*/

#include "adv360.keymap"
#include "adv360pro.keymap"
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
*
*/

#include "adv360.keymap"
#include "adv360pro.keymap"
12 changes: 0 additions & 12 deletions config/boards/arm/adv360/Kconfig.board

This file was deleted.

62 changes: 0 additions & 62 deletions config/boards/arm/adv360/Kconfig.defconfig

This file was deleted.

36 changes: 0 additions & 36 deletions config/boards/arm/adv360/macros.dtsi

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ config BOARD_ENABLE_DCDC
bool "Enable DCDC mode"
select SOC_DCDC_NRF52X
default y
depends on BOARD_ADV360_LEFT || BOARD_ADV360_RIGHT
depends on BOARD_ADV360PRO_LEFT || BOARD_ADV360PRO_RIGHT
12 changes: 12 additions & 0 deletions config/boards/arm/adv360pro/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT
#

config BOARD_ADV360PRO_LEFT
bool "adv360pro_left"
depends on SOC_NRF52840_QIAA

config BOARD_ADV360PRO_RIGHT
bool "adv360pro_right"
depends on SOC_NRF52840_QIAA
Loading

0 comments on commit 051a504

Please sign in to comment.