aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2024-02-25 15:46:55 -0700
committerJack Sangdahl <[email protected]>2024-02-25 15:46:55 -0700
commit5144b1e7cb4ce6cad597231287db2706900f45b7 (patch)
tree5603fa629adca8d03d97b10ff7d55a3ea23f2649
parentd8353f5b4c5c8c5f28c9a81506f91ff3092cae0b (diff)
downloadzmk_build-5144b1e7cb4ce6cad597231287db2706900f45b7.tar.gz
zmk_build-5144b1e7cb4ce6cad597231287db2706900f45b7.zip
fixup revxlp
-rwxr-xr-xbuild.sh30
-rw-r--r--config/revxlp.conf1
-rw-r--r--config/util.h32
-rw-r--r--readme.md3
-rw-r--r--revxlp/boards/seeeduino_xiao.conf2
-rw-r--r--revxlp/boards/seeeduino_xiao_ble.overlay14
-rw-r--r--revxlp/revxlp.overlay2
7 files changed, 48 insertions, 36 deletions
diff --git a/build.sh b/build.sh
index 1633b15..416cd21 100755
--- a/build.sh
+++ b/build.sh
@@ -1,35 +1,37 @@
#!/bin/sh
-ZMK_DIR=~/waffle_git/zmk
+ZMK_DIR=~/git/zmk
RED=$(tput setaf 1)
-YELLOW=$(tput setaf 3)
GREEN=$(tput setaf 2)
+YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
BOLD=$(tput bold)
NORMAL=$(tput sgr0)
source $ZMK_DIR/.venv/bin/activate
+set -e
build() {
- printf "building $GREEN$1$NORMAL for $BLUE$2$NORMAL...\n"
+ printf "building ${GREEN}$1${NORMAL} for ${BLUE}$2${NORMAL}...\n"
(cd $ZMK_DIR/app
west build -p always -b $2 -- -DSHIELD=$1 \
- -DZMK_CONFIG="$HOME/waffle_git/zmk-build/config" \
- &> /dev/null
+ -DZMK_CONFIG="$HOME/waffle_git/zmk-build/config"
- read -p "${BOLD}flash? (y/n) $NORMAL" yn
+ read -p "${BOLD}flash? (y/n) ${NORMAL}" yn
case $yn in
[Yy]*)
- printf "${YELLOW}enter bootloader$NORMAL...\n"
+ printf "${YELLOW}enter bootloader${NORMAL}...\n"
sleep 5
- west flash
+ doas mount /dev/sdb ~/.local/Media
+ west flash &> /dev/nul
+ doas umount /dev/sdb
;;
[Nn]*) cp build/zephyr/zmk.uf2 ~/$1.uf2 ;;
- * ) printf "${RED}invalid entry$NORMAL\n" ;;
+ * ) printf "${RED}invalid entry${NORMAL}\n" ;;
esac
)
- printf "${GREEN}complete$NORMAL\n"
+ printf "${GREEN}complete${NORMAL}\n"
}
-printf "${BOLD}firmware to build...$NORMAL\n"
+printf "${BOLD}firmware to build${NORMAL}...\n"
printf "(1) corne\t(2) revxlp\t(3) sweep\t(4) settings reset:\t"
read opt;
case $opt in
@@ -48,16 +50,16 @@ case $opt in
build splitkb_aurora_sweep_right nice_nano_v2
;;
4)
- printf "${BOLD}select microcontroller...$NORMAL\n"
+ printf "${BOLD}select microcontroller${NORMAL}...\n"
printf "(1) nice nano\t(2) nice nano v2\t(3) xiao ble:\t"
read val;
case $val in
1) MCU="nice_nano" ;;
2) MCU="nice_nano_v2" ;;
3) MCU="seeeduino_xiao_ble" ;;
- *) printf "${RED}invalid entry$NORMAL\n" ;;
+ *) printf "${RED}invalid entry${NORMAL}\n" ;;
esac
build settings_reset $MCU
;;
- *) printf "${RED}invalid entry$NORMAL\n" ;;
+ *) printf "${RED}invalid entry${NORMAL}\n" ;;
esac
diff --git a/config/revxlp.conf b/config/revxlp.conf
index dfa521c..d85021a 100644
--- a/config/revxlp.conf
+++ b/config/revxlp.conf
@@ -1 +1,2 @@
CONFIG_ZMK_SLEEP=y
+CONFIG_ZMK_USB_LOGGING=n
diff --git a/config/util.h b/config/util.h
index e8b33a9..a5e503e 100644
--- a/config/util.h
+++ b/config/util.h
@@ -1,21 +1,21 @@
// Copyright 2022 jack (@waffle87)
// SPDX-License-Identifier: MIT
-#define COMBO(name, keypress, keypos) \
-combo_##name { \
- timeout-ms = <50>; \
- bindings = <keypress>; \
- key-positions = <keypos>; \
-};
+#define COMBO(name, keypress, keypos) \
+ combo_##name { \
+ timeout - ms = <50>; \
+ bindings = <keypress>; \
+ key - positions = <keypos>; \
+ };
-#define TAP_DANCE(name, keypress1, keypress2) \
-td_##name: name { \
- compatible = "zmk,behavior-tap-dance"; \
- label = ###name; \
- #binding-cells = <0>; \
- tapping-term-ms = <200>; \
- bindings = <keypress1>, <keypress2>; \
-};
+#define TAP_DANCE(name, keypress1, keypress2) \
+ td_##name : name { \
+ compatible = "zmk,behavior-tap-dance"; \
+ label = ## #name; \
+ #binding - cells = <0>; \
+ tapping - term - ms = <200>; \
+ bindings = <keypress1>, <keypress2>; \
+ };
-#define HRML(k1,k2,k3,k4) &hm LALT k1 &hm LGUI k2 &hm LCTRL k3 &hm LSHFT k4
-#define HRMR(k1,k2,k3,k4) &hm RSHFT k1 &hm RCTRL k2 &hm RGUI k3 &hm RALT k4
+#define HRML(k1, k2, k3, k4) &hm LALT k1 &hm LGUI k2 &hm LCTRL k3 &hm LSHFT k4
+#define HRMR(k1, k2, k3, k4) &hm RSHFT k1 &hm RCTRL k2 &hm RGUI k3 &hm RALT k4
diff --git a/readme.md b/readme.md
index 06d6703..d802568 100644
--- a/readme.md
+++ b/readme.md
@@ -5,6 +5,5 @@ my [zmk](https://zmk.dev) configuration & keyboard code
### misc
* [`util.h`](util.h) contains some simple c macros for combos, 2-key tap dance, & home-row mods.
-* [`build.sh`](build.sh) is an interactive script to build and flash firmware using a local build environment.\
-coincidentally, my primary zmk keyboards use an identical layout, so the necessary files can be temporarily copied over at build time
+* [`build.sh`](build.sh) is an interactive script to build and flash firmware using a local build environment.
* **layout** is near identical to my layout [here (keymapdb)](https://keymapdb.com/keymaps/waffle87), sans a couple things like unicode.
diff --git a/revxlp/boards/seeeduino_xiao.conf b/revxlp/boards/seeeduino_xiao.conf
new file mode 100644
index 0000000..81b8cd7
--- /dev/null
+++ b/revxlp/boards/seeeduino_xiao.conf
@@ -0,0 +1,2 @@
+CONFIG_SPI=y
+CONFIG_ZMK_KSCAN_MATRIX_POLLING=y
diff --git a/revxlp/boards/seeeduino_xiao_ble.overlay b/revxlp/boards/seeeduino_xiao_ble.overlay
index 5cd88ae..5b37ffb 100644
--- a/revxlp/boards/seeeduino_xiao_ble.overlay
+++ b/revxlp/boards/seeeduino_xiao_ble.overlay
@@ -1,3 +1,13 @@
-&xiao_spi {
- miso-pin = <6>;
+&spi2_default {
+ group1 {
+ psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
+ <NRF_PSEL(SPIM_MOSI, 1, 15)>;
+ };
+};
+
+&spi2_sleep {
+ group1 {
+ psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
+ <NRF_PSEL(SPIM_MOSI, 1, 15)>;
+ };
};
diff --git a/revxlp/revxlp.overlay b/revxlp/revxlp.overlay
index c9a3600..53faae0 100644
--- a/revxlp/revxlp.overlay
+++ b/revxlp/revxlp.overlay
@@ -14,7 +14,6 @@
gpio-controller;
spi-max-frequency = <200000>;
reg = <0>;
- label = "4HC595";
#gpio-cells = <2>;
ngpios = <8>;
};
@@ -41,7 +40,6 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(5,5) RC(5,4) RC(5,3) RC(5,2)
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
- label = "KSCAN";
diode-direction = "col2row";
col-gpios