Skip to content

Commit

Permalink
add: configuration for dongle
Browse files Browse the repository at this point in the history
  • Loading branch information
zeljkobekcic committed Jul 9, 2024
1 parent 1b1e9b9 commit a18c35a
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 32 deletions.
12 changes: 6 additions & 6 deletions boards/shields/temper/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
if SHIELD_TEMPER_LEFT
if SHIELD_TEMPER_DONGLE

config ZMK_KEYBOARD_NAME
default "temper"

default "Temper Dongle"
config ZMK_SPLIT_ROLE_CENTRAL
default y

default y
endif

if SHIELD_TEMPER_LEFT || SHIELD_TEMPER_RIGHT
if SHIELD_TEMPER_LEFT || SHIELD_TEMPER_RIGHT || SHIELD_TEMPER_DONGLE

config ZMK_SPLIT
default y
Expand Down
3 changes: 3 additions & 0 deletions boards/shields/temper/Kconfig.shield
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ config SHIELD_TEMPER_LEFT

config SHIELD_TEMPER_RIGHT
def_bool $(shields_list_contains,temper_right)

config SHIELD_TEMPER_DONGLE
def_bool $(shields_list_contains,temper_dongle)
3 changes: 1 addition & 2 deletions boards/shields/temper/temper.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Uncomment the following line to enable deep sleep
CONFIG_ZMK_SLEEP=y
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
21 changes: 0 additions & 21 deletions boards/shields/temper/temper.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

/ {
chosen {
zephyr,display = &oled;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};
Expand Down Expand Up @@ -45,23 +44,3 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9)

// TODO: per-key RGB node(s)?
};

&pro_micro_i2c {
status = "okay";

oled: ssd1306@3c {
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
label = "DISPLAY";
width = <128>;
height = <32>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <31>;
segment-remap;
com-invdir;
com-sequential;
prechargep = <0x22>;
};
};
4 changes: 1 addition & 3 deletions boards/shields/temper/temper.zmk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ name: Chocofi Temper
type: shield
url: https://github.com/raeedcho/chocofi-temper
requires: [pro_micro]
exposes: [i2c_oled]
features:
- keys
- display
- underglow
siblings:
- temper_left
- temper_right
- temper_dongle
6 changes: 6 additions & 0 deletions boards/shields/temper/temper_dongle.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2

CONFIG_ZMK_SLEEP=n
# CONFIG_PM_DEVICE=n
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000
CONFIG_ZMK_EXT_POWER=y
17 changes: 17 additions & 0 deletions boards/shields/temper/temper_dongle.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2020 Pete Johanson
*
* SPDX-License-Identifier: MIT
*/

#include "temper.dtsi"

&kscan0 {
col-gpios
= <&pro_micro 15 GPIO_ACTIVE_HIGH>
, <&pro_micro 18 GPIO_ACTIVE_HIGH>
, <&pro_micro 19 GPIO_ACTIVE_HIGH>
, <&pro_micro 20 GPIO_ACTIVE_HIGH>
, <&pro_micro 21 GPIO_ACTIVE_HIGH>
;
};
24 changes: 24 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env zsh

ZMK_CONFIG_PATH="/Users/zeljkobekcic/Projects/Private/temper-zmk-config/config"
ZMK_EXTRA_MODULES_PATH="/Users/zeljkobekcic/Projects/Private/temper-zmk-config"
OUTPUT_DIRECTORY="/Users/zeljkobekcic/Projects/Private/temper-zmk-config/outputs/"

rm -rf "$OUTPUT_DIRECTORY"
mkdir -p "$OUTPUT_DIRECTORY"

(
cd ~/Projects/Private/zmk
source .venv/bin/activate
cd app
west build -d build/temper_left -b nice_nano_v2 --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_PATH" -DSHIELD=temper_left -DZMK_EXTRA_MODULES="$ZMK_EXTRA_MODULES_PATH"
west build -d build/temper_right -b nice_nano_v2 --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_PATH" -DSHIELD=temper_right -DZMK_EXTRA_MODULES="$ZMK_EXTRA_MODULES_PATH"
west build -d build/temper_dongle -b nice_nano_v2 --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_PATH" -DSHIELD=temper_dongle -DZMK_EXTRA_MODULES="$ZMK_EXTRA_MODULES_PATH"
deactivate

cp build/temper_dongle/zephyr/zmk.uf2 "$OUTPUT_DIRECTORY/temper_dongle.uf2"
cp build/temper_right/zephyr/zmk.uf2 "$OUTPUT_DIRECTORY/temper_right.uf2"
cp build/temper_left/zephyr/zmk.uf2 "$OUTPUT_DIRECTORY/temper_left.uf2"

rm -rf build
)
3 changes: 3 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ include:
shield: temper_left
- board: nice_nano_v2
shield: temper_right
- board: nice_nano_v2
shield: temper_dongle

0 comments on commit a18c35a

Please sign in to comment.