Skip to content

Commit

Permalink
fixup revxlp
Browse files Browse the repository at this point in the history
  • Loading branch information
waffle87 committed Feb 25, 2024
1 parent d8353f5 commit 5144b1e
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 36 deletions.
30 changes: 16 additions & 14 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
1 change: 1 addition & 0 deletions config/revxlp.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_USB_LOGGING=n
32 changes: 16 additions & 16 deletions config/util.h
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 2 additions & 0 deletions revxlp/boards/seeeduino_xiao.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_SPI=y
CONFIG_ZMK_KSCAN_MATRIX_POLLING=y
14 changes: 12 additions & 2 deletions revxlp/boards/seeeduino_xiao_ble.overlay
Original file line number Diff line number Diff line change
@@ -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)>;
};
};
2 changes: 0 additions & 2 deletions revxlp/revxlp.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
gpio-controller;
spi-max-frequency = <200000>;
reg = <0>;
label = "4HC595";
#gpio-cells = <2>;
ngpios = <8>;
};
Expand All @@ -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
Expand Down

0 comments on commit 5144b1e

Please sign in to comment.