Skip to content

Commit

Permalink
config/boards/arm/adv360: decrease CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS
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 Nov 22, 2023
1 parent ad31852 commit f92ff0f
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 20 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# syntax=docker/dockerfile-upstream:1-labs
# syntax=docker/dockerfile-upstream:master

FROM docker.io/zmkfirmware/zmk-build-arm:stable
FROM --platform=$BUILDPLATFORM zmkfirmware/zmk-build-arm:3.2-branch

WORKDIR /app

COPY --link config/west.yml config/west.yml

# West Init
RUN west init -l config
# Set CMake flags
RUN west config build.cmake-args -- "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
# West Update
RUN west update
# West Zephyr export
Expand Down
39 changes: 25 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,36 @@ 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 :=
SELINUX1 :=
SELINUX2 :=
else
SELINUX1 := :z
SELINUX2 := ,z
SELINUX1 := :z
SELINUX2 := ,z
endif

.PHONY: all clean
CONTAINER_IMAGE = zmk:latest
DOCKER_FLAGS = --rm --pull -f Dockerfile -t ${CONTAINER_IMAGE}
DOCKER_NOCACHE =
ifneq (${DOCKER_NOCACHE},)
DOCKER_FLAGS += --no-cache
endif

.PHONY: all build compile clean

all:
all: build compile

build:
$(shell bin/get_version.sh >> /dev/null)
$(DOCKER) build --tag zmk --file Dockerfile .
$(DOCKER) run --rm -it --name zmk \
-v $(PWD)/firmware:/app/firmware$(SELINUX1) \
-v $(PWD)/config:/app/config:ro$(SELINUX2) \
-e TIMESTAMP=$(TIMESTAMP) \
-e COMMIT=$(COMMIT) \
zmk
$(DOCKER) image build ${DOCKER_FLAGS} .

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) \
--env TIMESTAMP=$(TIMESTAMP) \
--env COMMIT=$(COMMIT) \
${CONTAINER_IMAGE}

clean:
rm -f firmware/*.uf2
$(DOCKER) image rm zmk docker.io/zmkfirmware/zmk-build-arm:stable
$(DOCKER) image rm -f ${CONTAINER_IMAGE} docker.io/zmkfirmware/zmk-build-arm:stable
2 changes: 1 addition & 1 deletion bin/get_version.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Get the date, first 4 chars of branch name and short commit hash
date=$(date -u +"%Y%m%d")
Expand Down
12 changes: 12 additions & 0 deletions config/boards/arm/adv360/adv360.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;

/* https://docs.zephyrproject.org/apidoc/latest/dt-bindings_2led_2led_8h.html */
/*
LED_COLOR_ID_WHITE
LED_COLOR_ID_RED
LED_COLOR_ID_GREEN
LED_COLOR_ID_BLUE
LED_COLOR_ID_AMBER
LED_COLOR_ID_VIOLET
LED_COLOR_ID_YELLOW
LED_COLOR_ID_IR
LED_COLOR_ID_MAX
*/
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_BLUE
LED_COLOR_ID_RED>;
Expand Down
5 changes: 3 additions & 2 deletions config/boards/arm/adv360/adv360_left_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ CONFIG_USB_DEVICE_VID=0x29EA
CONFIG_USB_DEVICE_PID=0x0362
CONFIG_USB_DEVICE_MANUFACTURER="Kinesis Corporation"
CONFIG_ZMK_HID_REPORT_TYPE_NKRO=n
CONFIG_ZMK_HID_KEYBOARD_EXTENDED_REPORT=n #Set this to y for F13-F24 and intl keys with NKRO
CONFIG_ZMK_HID_KEYBOARD_EXTENDED_REPORT=n # Set this to y for F13-F24 and intl keys with NKRO
CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y
CONFIG_BUILD_OUTPUT_UF2=y

CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=20
# avoid debouncing: https://zmk.dev/docs/features/debouncing
CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=0
CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=20

# https://github.com/wilser/EW-Nauticus-Adv360/blob/2c9834e14059/config/boards/arm/adv360/adv360_left_defconfig#L71-L75
Expand Down
3 changes: 2 additions & 1 deletion config/boards/arm/adv360/adv360_right_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ CONFIG_ZMK_HID_REPORT_TYPE_NKRO=n
CONFIG_ZMK_HID_CONSUMER_REPORT_USAGES_BASIC=y
CONFIG_BUILD_OUTPUT_UF2=y

CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=20
# avoid debouncing: https://zmk.dev/docs/features/debouncing
CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=0
CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=20

# EW test 'idle' setting for hacking the small LED status lights timeout - see notes in LEFT file
Expand Down
7 changes: 7 additions & 0 deletions config/version.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#define VERSION_MACRO
macro_ver: macro_ver {
compatible = "zmk,behavior-macro";
label = "macro_ver";
#binding-cells = <0>;
bindings = <&kp N2>, <&kp N0>, <&kp N2>, <&kp N3>, <&kp N1>, <&kp N1>, <&kp N2>, <&kp N2>, <&kp MINUS>, <&kp M>, <&kp A>, <&kp I>, <&kp N>, <&kp MINUS>, <&kp N7>, <&kp N9>, <&kp N4>, <&kp N3>, <&kp N6>, <&kp N8>, <&kp N1>, <&kp RET>;
};

0 comments on commit f92ff0f

Please sign in to comment.