Merge remote-tracking branch 'upstream/main' into corne-ish-zen-v2
This commit is contained in:
commit
d849944368
26 changed files with 8882 additions and 7033 deletions
67
.github/workflows/build-user-config.yml
vendored
67
.github/workflows/build-user-config.yml
vendored
|
@ -18,8 +18,8 @@ on:
|
|||
default: "bin"
|
||||
required: false
|
||||
type: string
|
||||
artifact_name:
|
||||
description: 'Artifact output file name'
|
||||
archive_name:
|
||||
description: 'Archive output file name'
|
||||
default: 'firmware'
|
||||
required: false
|
||||
type: string
|
||||
|
@ -29,21 +29,18 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
name: Fetch Build Keyboards
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
build_matrix: ${{ env.build_matrix }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install yaml2json
|
||||
run: python3 -m pip install remarshal
|
||||
|
||||
- name: Fetch Build Matrix
|
||||
id: set-matrix
|
||||
run: |
|
||||
set -x
|
||||
matrix=$(yaml2json ${{ inputs.build_matrix_path }} | jq -c .)
|
||||
yaml2json ${{ inputs.build_matrix_path }}
|
||||
echo "::set-output name=matrix::${matrix}"
|
||||
echo "build_matrix=$(yaml2json ${{ inputs.build_matrix_path }} | jq -c .)" >> $GITHUB_ENV
|
||||
yaml2json ${{ inputs.build_matrix_path }} | jq
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -53,35 +50,31 @@ jobs:
|
|||
name: Build
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
|
||||
matrix: ${{ fromJson(needs.matrix.outputs.build_matrix) }}
|
||||
steps:
|
||||
- name: Prepare variables
|
||||
id: variables
|
||||
shell: sh -x {0}
|
||||
run: |
|
||||
set -x
|
||||
if [ -n "${{ matrix.shield }}" ]
|
||||
then
|
||||
EXTRA_CMAKE_ARGS="-DSHIELD=\"${{ matrix.shield }}\""
|
||||
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk"
|
||||
DISPLAY_NAME="${{ matrix.shield }} - ${{ matrix.board }}"
|
||||
echo "extra_cmake_args=-DSHIELD=\"${{ matrix.shield }}\"" >> $GITHUB_ENV
|
||||
echo "artifact_name=${{ matrix.shield }}-${{ matrix.board }}-zmk" >> $GITHUB_ENV
|
||||
echo "display_name=${{ matrix.shield }} - ${{ matrix.board }}" >> $GITHUB_ENV
|
||||
else
|
||||
EXTRA_CMAKE_ARGS=
|
||||
DISPLAY_NAME="${{ matrix.board }}"
|
||||
ARTIFACT_NAME="${{ matrix.board }}-zmk"
|
||||
echo "extra_cmake_args=" >> $GITHUB_ENV
|
||||
echo "artifact_name=${{ matrix.board }}-zmk" >> $GITHUB_ENV
|
||||
echo "display_name=${{ matrix.board }}" >> $GITHUB_ENV
|
||||
fi
|
||||
echo ::set-output name=extra-cmake-args::${EXTRA_CMAKE_ARGS}
|
||||
echo ::set-output name=artifact-name::${ARTIFACT_NAME}
|
||||
echo ::set-output name=display-name::${DISPLAY_NAME}
|
||||
echo ::set-output name=zephyr-version::${ZEPHYR_VERSION}
|
||||
echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Cache west modules
|
||||
uses: actions/cache@v3.0.2
|
||||
uses: actions/cache@v3.0.11
|
||||
continue-on-error: true
|
||||
env:
|
||||
cache-name: cache-zephyr-${{ steps.variables.outputs.zephyr-version }}-modules
|
||||
cache_name: cache-zephyr-${{ env.zephyr_version }}-modules
|
||||
with:
|
||||
path: |
|
||||
modules/
|
||||
|
@ -89,9 +82,9 @@ jobs:
|
|||
zephyr/
|
||||
bootloader/
|
||||
zmk/
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }}
|
||||
key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-${{ env.cache_name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
|
@ -104,28 +97,28 @@ jobs:
|
|||
- name: West Zephyr export
|
||||
run: west zephyr-export
|
||||
|
||||
- name: West Build (${{ steps.variables.outputs.display-name }})
|
||||
- name: West Build (${{ env.display_name }})
|
||||
shell: sh -x {0}
|
||||
run: |
|
||||
set -x
|
||||
west build -s zmk/app -b ${{ matrix.board }} -- -DZMK_CONFIG=${GITHUB_WORKSPACE}/${{ inputs.config_path }} ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }}
|
||||
west build -s zmk/app -b ${{ matrix.board }} -- -DZMK_CONFIG=${GITHUB_WORKSPACE}/${{ inputs.config_path }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}
|
||||
|
||||
- name: ${{ steps.variables.outputs.display-name }} Kconfig file
|
||||
- name: ${{ env.display_name }} Kconfig file
|
||||
run: grep -v -e "^#" -e "^$" build/zephyr/.config | sort
|
||||
|
||||
- name: Rename artifacts
|
||||
shell: sh -x {0}
|
||||
run: |
|
||||
set -x
|
||||
mkdir build/artifacts
|
||||
if [ -f build/zephyr/zmk.uf2 ]
|
||||
then
|
||||
cp build/zephyr/zmk.uf2 "build/artifacts/${{ steps.variables.outputs.artifact-name }}.uf2"
|
||||
cp build/zephyr/zmk.uf2 "build/artifacts/${{ env.artifact_name }}.uf2"
|
||||
elif [ -f build/zephyr/zmk.${{ inputs.fallback_binary }} ]
|
||||
then
|
||||
cp build/zephyr/zmk.${{ inputs.fallback_binary }} "build/artifacts/${{ steps.variables.outputs.artifact-name }}.${{ inputs.fallback_binary }}"
|
||||
cp build/zephyr/zmk.${{ inputs.fallback_binary }} "build/artifacts/${{ env.artifact_name }}.${{ inputs.fallback_binary }}"
|
||||
fi
|
||||
|
||||
- name: Archive (${{ steps.variables.outputs.display-name }})
|
||||
uses: actions/upload-artifact@v2
|
||||
- name: Archive (${{ env.display_name }})
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ inputs.artifact_name }}
|
||||
name: ${{ inputs.archive_name }}
|
||||
path: build/artifacts
|
||||
|
|
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
|
@ -24,7 +24,7 @@ jobs:
|
|||
include: ${{ fromJSON(needs.compile-matrix.outputs.include-list) }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Cache west modules
|
||||
uses: actions/cache@v3.0.2
|
||||
env:
|
||||
|
@ -151,7 +151,7 @@ jobs:
|
|||
core-include: ${{ steps.core-list.outputs.result }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
|
@ -180,7 +180,7 @@ jobs:
|
|||
boards-include: ${{ steps.boards-list.outputs.result }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
|
@ -307,7 +307,7 @@ jobs:
|
|||
organized-metadata: ${{ steps.organize-metadata.outputs.result }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
|
|
2
.github/workflows/clang-format-lint.yml
vendored
2
.github/workflows/clang-format-lint.yml
vendored
|
@ -22,7 +22,7 @@ jobs:
|
|||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: DoozyX/clang-format-lint-action@v0.13
|
||||
with:
|
||||
source: "./app"
|
||||
|
|
6
.github/workflows/doc-checks.yml
vendored
6
.github/workflows/doc-checks.yml
vendored
|
@ -14,7 +14,7 @@ jobs:
|
|||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: bahmutov/npm-install@v1
|
||||
with:
|
||||
working-directory: docs
|
||||
|
@ -24,7 +24,7 @@ jobs:
|
|||
prettier:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: bahmutov/npm-install@v1
|
||||
with:
|
||||
working-directory: docs
|
||||
|
@ -34,7 +34,7 @@ jobs:
|
|||
typecheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: bahmutov/npm-install@v1
|
||||
with:
|
||||
working-directory: docs
|
||||
|
|
|
@ -18,8 +18,8 @@ jobs:
|
|||
check-metadata-format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v3
|
||||
- uses: bahmutov/npm-install@v1
|
||||
with:
|
||||
working-directory: app
|
||||
|
@ -31,7 +31,7 @@ jobs:
|
|||
container:
|
||||
image: docker.io/zmkfirmware/zmk-dev-arm:3.0
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install dependencies
|
||||
run: pip install -r app/scripts/requirements.txt
|
||||
- name: West init
|
||||
|
|
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
@ -19,7 +19,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Find test directories
|
||||
id: test-dirs
|
||||
run: |
|
||||
|
@ -36,7 +36,7 @@ jobs:
|
|||
image: docker.io/zmkfirmware/zmk-build-arm:3.0
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
- name: Cache west modules
|
||||
uses: actions/cache@v3.0.2
|
||||
env:
|
||||
|
|
49
app/boards/shields/snap/Kconfig.defconfig
Normal file
49
app/boards/shields/snap/Kconfig.defconfig
Normal file
|
@ -0,0 +1,49 @@
|
|||
# Copyright (c) 2022 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
if SHIELD_SNAP_LEFT
|
||||
|
||||
config ZMK_KEYBOARD_NAME
|
||||
default "SNAP"
|
||||
|
||||
config ZMK_SPLIT_ROLE_CENTRAL
|
||||
default y
|
||||
|
||||
endif
|
||||
|
||||
if SHIELD_SNAP_LEFT || SHIELD_SNAP_RIGHT
|
||||
|
||||
config ZMK_SPLIT
|
||||
default y
|
||||
|
||||
if ZMK_DISPLAY
|
||||
|
||||
config I2C
|
||||
default y
|
||||
|
||||
config SSD1306
|
||||
default y
|
||||
|
||||
config SSD1306_REVERSE_MODE
|
||||
default y
|
||||
|
||||
endif # ZMK_DISPLAY
|
||||
|
||||
if LVGL
|
||||
|
||||
config LVGL_VDB_SIZE
|
||||
default 64
|
||||
|
||||
config LVGL_DPI
|
||||
default 148
|
||||
|
||||
config LVGL_BITS_PER_PIXEL
|
||||
default 1
|
||||
|
||||
choice LVGL_COLOR_DEPTH
|
||||
default LVGL_COLOR_DEPTH_1
|
||||
endchoice
|
||||
|
||||
endif # LVGL
|
||||
|
||||
endif
|
8
app/boards/shields/snap/Kconfig.shield
Normal file
8
app/boards/shields/snap/Kconfig.shield
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2022 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
config SHIELD_SNAP_LEFT
|
||||
def_bool $(shields_list_contains,snap_left)
|
||||
|
||||
config SHIELD_SNAP_RIGHT
|
||||
def_bool $(shields_list_contains,snap_right)
|
37
app/boards/shields/snap/boards/nice_nano.overlay
Normal file
37
app/boards/shields/snap/boards/nice_nano.overlay
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <dt-bindings/led/led.h>
|
||||
|
||||
&spi1 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
mosi-pin = <10>;
|
||||
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
|
||||
sck-pin = <5>;
|
||||
miso-pin = <7>;
|
||||
|
||||
led_strip: ws2812@0 {
|
||||
compatible = "worldsemi,ws2812-spi";
|
||||
label = "WS2812";
|
||||
|
||||
/* SPI */
|
||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||
spi-max-frequency = <4000000>;
|
||||
|
||||
/* WS2812 */
|
||||
chain-length = <5>; /* arbitrary; change at will */
|
||||
spi-one-frame = <0x70>;
|
||||
spi-zero-frame = <0x40>;
|
||||
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
};
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,underglow = &led_strip;
|
||||
};
|
||||
};
|
37
app/boards/shields/snap/boards/nice_nano_v2.overlay
Normal file
37
app/boards/shields/snap/boards/nice_nano_v2.overlay
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <dt-bindings/led/led.h>
|
||||
|
||||
&spi1 {
|
||||
compatible = "nordic,nrf-spim";
|
||||
status = "okay";
|
||||
mosi-pin = <10>;
|
||||
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
|
||||
sck-pin = <5>;
|
||||
miso-pin = <7>;
|
||||
|
||||
led_strip: ws2812@0 {
|
||||
compatible = "worldsemi,ws2812-spi";
|
||||
label = "WS2812";
|
||||
|
||||
/* SPI */
|
||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||
spi-max-frequency = <4000000>;
|
||||
|
||||
/* WS2812 */
|
||||
chain-length = <5>; /* arbitrary; change at will */
|
||||
spi-one-frame = <0x70>;
|
||||
spi-zero-frame = <0x40>;
|
||||
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
|
||||
};
|
||||
};
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zmk,underglow = &led_strip;
|
||||
};
|
||||
};
|
17
app/boards/shields/snap/snap.conf
Normal file
17
app/boards/shields/snap/snap.conf
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Copyright (c) 2022 The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# Uncomment these two lines to add support for encoders to your firmware
|
||||
# and enable the encoders
|
||||
# CONFIG_EC11=y
|
||||
# CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
|
||||
|
||||
# Uncomment the following line to enable the OLED Display
|
||||
# CONFIG_ZMK_DISPLAY=y
|
||||
|
||||
# Uncomment the following lines to enable the RGB underglow
|
||||
# CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n
|
||||
# CONFIG_ZMK_RGB_UNDERGLOW=y
|
||||
# CONFIG_WS2812_STRIP=y
|
||||
# CONFIG_ZMK_RGB_UNDERGLOW_HUE_STEP=5
|
||||
# CONFIG_ZMK_RGB_UNDERGLOW_SPD_START=1
|
86
app/boards/shields/snap/snap.dtsi
Normal file
86
app/boards/shields/snap/snap.dtsi
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <dt-bindings/zmk/matrix_transform.h>
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zephyr,display = &oled;
|
||||
zmk,kscan = &kscan_composite;
|
||||
zmk,matrix_transform = &default_transform;
|
||||
};
|
||||
|
||||
left_encoder: encoder_left {
|
||||
compatible = "alps,ec11";
|
||||
label = "LEFT_ENCODER";
|
||||
resolution = <4>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
right_encoder: encoder_right {
|
||||
compatible = "alps,ec11";
|
||||
label = "RIGHT_ENCODER";
|
||||
resolution = <4>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
default_transform: keymap_transform_0 {
|
||||
compatible = "zmk,matrix-transform";
|
||||
columns = <17>;
|
||||
rows = <6>;
|
||||
|
||||
// | R0C06L | R0C05L | R0C04L | R0C03L | R0C02L | R0C01L | R0C00L | | R0C15R | R0C14R | R0C13R | R0C12R | R0C11R | R0C10R | R0C09R | R0C08R |
|
||||
// R1C07L | R1C06L | R1C05L | R1C04L | R1C03L | R1C02L | R1C01L | R1C00L | | R1C15R | R1C14R | R1C13R | R1C12R | R1C11R | R1C10R | R1C09R | R1C08R | R2C0XR |
|
||||
// R2C07L | R2C06L | R2C05L | R2C04L | R2C03L | R2C02L | R2C00L | | R2C15R | R2C14R | R2C13R | R2C12R | R2C11R | R2C10R | R2C09R | R3C08R | R2C08R |
|
||||
// R3C07L | R3C06L | R3C05L | R3C04L | R3C03L | R3C02L | R3C00L | | R3C15R | R3C14R | R3C13R | R3C12R | R3C11R | R3C10R | R3C09R | R4C08R |
|
||||
// R4C07L | R4C06L | R4C05L | R4C04L | R4C03L | R4C02L | R4C01L | R4C00L | | R4C15R | R4C14R | R4C13R | R4C12R | R4C11R | R4C10R | R4C09R | R5C08R |
|
||||
// R5C07L | R5C06L | R5C05L | R5C04L | R5C02L | R5C00L | | R5C15R | R5C14R | R5C13R | R5C12R | R5C11R | R5C10R | R5C09R |
|
||||
|
||||
map = <
|
||||
RC(0,6) RC(0,5) RC(0,4) RC(0,3) RC(0,2) RC(0,1) RC(0,0) RC(0,15) RC(0,14) RC(0,13) RC(0,12) RC(0,11) RC(0,10) RC(0,9) RC(0,8)
|
||||
RC(1,7) RC(1,6) RC(1,5) RC(1,4) RC(1,3) RC(1,2) RC(1,1) RC(1,0) RC(1,15) RC(1,14) RC(1,13) RC(1,12) RC(1,11) RC(1,10) RC(1,9) RC(1,8) RC(1,16)
|
||||
RC(2,7) RC(2,6) RC(2,5) RC(2,4) RC(2,3) RC(2,2) RC(2,0) RC(2,15) RC(2,14) RC(2,13) RC(2,12) RC(2,11) RC(2,10) RC(2,9) RC(3,8) RC(2,8)
|
||||
RC(3,7) RC(3,6) RC(3,5) RC(3,4) RC(3,3) RC(3,2) RC(3,0) RC(3,15) RC(3,14) RC(3,13) RC(3,12) RC(3,11) RC(3,10) RC(3,9) RC(4,8)
|
||||
RC(4,7) RC(4,6) RC(4,5) RC(4,4) RC(4,3) RC(4,2) RC(4,1) RC(4,0) RC(4,15) RC(4,14) RC(4,13) RC(4,12) RC(4,11) RC(4,10) RC(4,9) RC(5,8)
|
||||
RC(5,7) RC(5,6) RC(5,5) RC(5,4) RC(5,2) RC(5,0) RC(5,15) RC(5,14) RC(5,13) RC(5,12) RC(5,11) RC(5,10) RC(5,9)
|
||||
>;
|
||||
};
|
||||
|
||||
kscan_composite: kscan {
|
||||
compatible = "zmk,kscan-composite";
|
||||
label = "KSCAN";
|
||||
rows = <6>;
|
||||
columns = <17>;
|
||||
|
||||
demux {
|
||||
kscan = <&kscan_demux>;
|
||||
};
|
||||
};
|
||||
|
||||
kscan_demux: kscan_demux {
|
||||
compatible = "zmk,kscan-gpio-demux";
|
||||
label = "DEMUX";
|
||||
polling-interval-msec = <25>;
|
||||
};
|
||||
};
|
||||
|
||||
&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>;
|
||||
com-sequential;
|
||||
prechargep = <0x22>;
|
||||
};
|
||||
};
|
47
app/boards/shields/snap/snap.keymap
Normal file
47
app/boards/shields/snap/snap.keymap
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <behaviors.dtsi>
|
||||
#include <dt-bindings/zmk/keys.h>
|
||||
#include <dt-bindings/zmk/rgb.h>
|
||||
#include <dt-bindings/zmk/rgb.h>
|
||||
|
||||
/ {
|
||||
sensors {
|
||||
compatible = "zmk,keymap-sensors";
|
||||
sensors = <&left_encoder &right_encoder>;
|
||||
};
|
||||
|
||||
keymap {
|
||||
compatible = "zmk,keymap";
|
||||
|
||||
default_layer {
|
||||
label = "Default";
|
||||
sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp C_VOL_UP C_VOL_DN>;
|
||||
bindings = <
|
||||
&kp ESC &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp KP_NUM &kp PAUSE_BREAK
|
||||
&kp C_MUTE &kp TILDE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp DEL &kp HOME
|
||||
&kp F13 &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH &kp END
|
||||
&kp F14 &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET &kp PG_UP
|
||||
&kp F15 &kp LSHFT &kp NUHS &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &kp UP &kp PG_DN
|
||||
&kp F16 &kp LCTRL &kp LGUI &kp LALT &mo 1 &kp SPACE &kp BSPC &mo 1 &kp RALT &kp RCTRL &kp LEFT &kp DOWN &kp RIGHT
|
||||
>;
|
||||
};
|
||||
|
||||
function_layer {
|
||||
label = "Function";
|
||||
sensor-bindings = <&inc_dec_kp C_NEXT C_PREV &inc_dec_kp C_NEXT C_PREV>;
|
||||
bindings = <
|
||||
&bootloader &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &bootloader
|
||||
&kp C_PP &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &kp C_PP
|
||||
&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 &trans &trans &trans &trans &trans &trans &trans &trans &rgb_ug RGB_TOG &rgb_ug RGB_BRI &rgb_ug RGB_EFF
|
||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &rgb_ug RGB_HUD &rgb_ug RGB_BRD &rgb_ug RGB_HUI
|
||||
>;
|
||||
};
|
||||
};
|
||||
};
|
15
app/boards/shields/snap/snap.zmk.yml
Normal file
15
app/boards/shields/snap/snap.zmk.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
file_format: "1"
|
||||
id: snap
|
||||
name: SNAP
|
||||
type: shield
|
||||
url: https://nullbits.co/snap
|
||||
requires: [pro_micro]
|
||||
exposes: [i2c_oled]
|
||||
features:
|
||||
- keys
|
||||
- display
|
||||
- encoder
|
||||
- underglow
|
||||
siblings:
|
||||
- snap_left
|
||||
- snap_right
|
34
app/boards/shields/snap/snap_left.overlay
Normal file
34
app/boards/shields/snap/snap_left.overlay
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include "snap.dtsi"
|
||||
|
||||
&kscan_demux {
|
||||
input-gpios
|
||||
= <&pro_micro 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
;
|
||||
output-gpios
|
||||
= <&pro_micro 18 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 19 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 20 GPIO_ACTIVE_HIGH>
|
||||
;
|
||||
};
|
||||
|
||||
&left_encoder {
|
||||
a-gpios = <&pro_micro 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||
b-gpios = <&pro_micro 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&oled {
|
||||
segment-remap;
|
||||
com-invdir;
|
||||
};
|
51
app/boards/shields/snap/snap_right.overlay
Normal file
51
app/boards/shields/snap/snap_right.overlay
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) 2022 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include "snap.dtsi"
|
||||
|
||||
/ {
|
||||
kscan_direct: kscan_direct {
|
||||
compatible = "zmk,kscan-gpio-direct";
|
||||
label = "DIRECT";
|
||||
input-gpios
|
||||
= <&pro_micro 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
&default_transform {
|
||||
col-offset = <8>;
|
||||
};
|
||||
|
||||
&kscan_composite {
|
||||
direct {
|
||||
kscan = <&kscan_direct>;
|
||||
row-offset = <1>;
|
||||
column-offset = <8>;
|
||||
};
|
||||
};
|
||||
|
||||
&kscan_demux {
|
||||
input-gpios
|
||||
= <&pro_micro 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
, <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
;
|
||||
output-gpios
|
||||
= <&pro_micro 6 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
|
||||
, <&pro_micro 4 GPIO_ACTIVE_HIGH>
|
||||
;
|
||||
};
|
||||
|
||||
&right_encoder {
|
||||
a-gpios = <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||
b-gpios = <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||
status = "okay";
|
||||
};
|
|
@ -68,7 +68,7 @@ lv_obj_t *zmk_display_status_screen() {
|
|||
|
||||
#if IS_ENABLED(CONFIG_ZMK_WIDGET_WPM_STATUS)
|
||||
zmk_widget_wpm_status_init(&wpm_status_widget, screen);
|
||||
lv_obj_align(zmk_widget_wpm_status_obj(&wpm_status_widget), NULL, LV_ALIGN_IN_BOTTOM_RIGHT, -12,
|
||||
lv_obj_align(zmk_widget_wpm_status_obj(&wpm_status_widget), NULL, LV_ALIGN_IN_BOTTOM_RIGHT, 0,
|
||||
0);
|
||||
#endif
|
||||
return screen;
|
||||
|
|
|
@ -27,13 +27,13 @@ struct battery_status_state {
|
|||
};
|
||||
|
||||
static void set_battery_symbol(lv_obj_t *label, struct battery_status_state state) {
|
||||
char text[2] = " ";
|
||||
char text[8] = {};
|
||||
|
||||
uint8_t level = state.level;
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_DEVICE_STACK)
|
||||
if (state.usb_present) {
|
||||
strcpy(text, LV_SYMBOL_CHARGE);
|
||||
strcpy(text, LV_SYMBOL_CHARGE " ");
|
||||
}
|
||||
#endif /* IS_ENABLED(CONFIG_USB_DEVICE_STACK) */
|
||||
|
||||
|
@ -49,6 +49,7 @@ static void set_battery_symbol(lv_obj_t *label, struct battery_status_state stat
|
|||
strcat(text, LV_SYMBOL_BATTERY_EMPTY);
|
||||
}
|
||||
lv_label_set_text(label, text);
|
||||
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_RIGHT, 0, 0);
|
||||
}
|
||||
|
||||
void battery_status_update_cb(struct battery_status_state state) {
|
||||
|
|
|
@ -24,15 +24,15 @@ struct layer_status_state {
|
|||
|
||||
static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) {
|
||||
if (state.label == NULL) {
|
||||
char text[6] = {};
|
||||
char text[7] = {};
|
||||
|
||||
sprintf(text, LV_SYMBOL_KEYBOARD "%i", state.index);
|
||||
sprintf(text, LV_SYMBOL_KEYBOARD " %i", state.index);
|
||||
|
||||
lv_label_set_text(label, text);
|
||||
} else {
|
||||
char text[12] = {};
|
||||
char text[13] = {};
|
||||
|
||||
snprintf(text, 12, LV_SYMBOL_KEYBOARD "%s", state.label);
|
||||
snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %s", state.label);
|
||||
|
||||
lv_label_set_text(label, text);
|
||||
}
|
||||
|
|
|
@ -39,24 +39,24 @@ static struct output_status_state get_state(const zmk_event_t *_eh) {
|
|||
}
|
||||
|
||||
static void set_status_symbol(lv_obj_t *label, struct output_status_state state) {
|
||||
char text[9] = {};
|
||||
char text[10] = {};
|
||||
|
||||
switch (state.selected_endpoint) {
|
||||
case ZMK_ENDPOINT_USB:
|
||||
strcat(text, LV_SYMBOL_USB " ");
|
||||
strcat(text, LV_SYMBOL_USB);
|
||||
break;
|
||||
case ZMK_ENDPOINT_BLE:
|
||||
if (state.active_profile_bonded) {
|
||||
if (state.active_profile_connected) {
|
||||
snprintf(text, sizeof(text), LV_SYMBOL_WIFI "%i " LV_SYMBOL_OK,
|
||||
state.active_profile_index);
|
||||
snprintf(text, sizeof(text), LV_SYMBOL_WIFI " %i " LV_SYMBOL_OK,
|
||||
state.active_profile_index + 1);
|
||||
} else {
|
||||
snprintf(text, sizeof(text), LV_SYMBOL_WIFI "%i " LV_SYMBOL_CLOSE,
|
||||
state.active_profile_index);
|
||||
snprintf(text, sizeof(text), LV_SYMBOL_WIFI " %i " LV_SYMBOL_CLOSE,
|
||||
state.active_profile_index + 1);
|
||||
}
|
||||
} else {
|
||||
snprintf(text, sizeof(text), LV_SYMBOL_WIFI "%i " LV_SYMBOL_SETTINGS,
|
||||
state.active_profile_index);
|
||||
snprintf(text, sizeof(text), LV_SYMBOL_WIFI " %i " LV_SYMBOL_SETTINGS,
|
||||
state.active_profile_index + 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -28,9 +28,10 @@ void set_wpm_symbol(lv_obj_t *label, struct wpm_status_state state) {
|
|||
char text[4] = {};
|
||||
|
||||
LOG_DBG("WPM changed to %i", state.wpm);
|
||||
snprintf(text, sizeof(text), "%i ", state.wpm);
|
||||
snprintf(text, sizeof(text), "%i", state.wpm);
|
||||
|
||||
lv_label_set_text(label, text);
|
||||
lv_obj_align(label, NULL, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
|
||||
}
|
||||
|
||||
void wpm_status_update_cb(struct wpm_status_state state) {
|
||||
|
|
15369
docs/package-lock.json
generated
15369
docs/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -3,7 +3,7 @@
|
|||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "docusaurus start",
|
||||
"start": "docusaurus start --host 0.0.0.0",
|
||||
"build": "docusaurus build",
|
||||
"serve": "docusaurus serve",
|
||||
"swizzle": "docusaurus swizzle",
|
||||
|
@ -15,8 +15,8 @@
|
|||
"typecheck": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docusaurus/core": "^2.0.0-beta.21",
|
||||
"@docusaurus/preset-classic": "^2.0.0-beta.21",
|
||||
"@docusaurus/core": "^2.1.0",
|
||||
"@docusaurus/preset-classic": "^2.1.0",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
||||
"@fortawesome/react-fontawesome": "^0.1.18",
|
||||
|
@ -43,16 +43,16 @@
|
|||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@docusaurus/module-type-aliases": "^2.0.0-beta.21",
|
||||
"@docusaurus/types": "^2.0.0-beta.21",
|
||||
"@docusaurus/module-type-aliases": "^2.1.0",
|
||||
"@docusaurus/types": "^2.1.0",
|
||||
"@tsconfig/docusaurus": "^1.0.5",
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
"@types/react": "^17.0.3",
|
||||
"@types/react-helmet": "^6.1.5",
|
||||
"@types/react-router-dom": "^5.1.7",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint": "^8.0.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-mdx": "^1.17.0",
|
||||
"eslint-plugin-mdx": "^2.0.5",
|
||||
"eslint-plugin-react": "^7.30.0",
|
||||
"json-schema-to-typescript": "^10.1.5",
|
||||
"mustache": "^4.2.0",
|
||||
|
|
|
@ -34,7 +34,7 @@ function CustomBoardForm({
|
|||
<div className="profilerInput">
|
||||
<label>
|
||||
Output Voltage{" "}
|
||||
<span tooltip="Output Voltage of the PSU used by the system">
|
||||
<span data-tooltip="Output Voltage of the PSU used by the system">
|
||||
ⓘ
|
||||
</span>
|
||||
</label>
|
||||
|
@ -45,7 +45,7 @@ function CustomBoardForm({
|
|||
<div className="profilerInput">
|
||||
<label>
|
||||
PSU Efficiency{" "}
|
||||
<span tooltip="The estimated efficiency with a VIN of 3.8 and the output voltage entered above">
|
||||
<span data-tooltip="The estimated efficiency with a VIN of 3.8 and the output voltage entered above">
|
||||
ⓘ
|
||||
</span>
|
||||
</label>
|
||||
|
@ -64,7 +64,7 @@ function CustomBoardForm({
|
|||
<div className="profilerInput">
|
||||
<label>
|
||||
PSU Quiescent{" "}
|
||||
<span tooltip="The standby usage of the PSU">ⓘ</span>
|
||||
<span data-tooltip="The standby usage of the PSU">ⓘ</span>
|
||||
</label>
|
||||
<div className="inputBox">
|
||||
<input {...bindQuiescentMicroA} type="number" />
|
||||
|
@ -74,7 +74,7 @@ function CustomBoardForm({
|
|||
<div className="profilerInput">
|
||||
<label>
|
||||
Other Quiescent{" "}
|
||||
<span tooltip="Any other standby usage of the board (voltage dividers, extra ICs, etc)">
|
||||
<span data-tooltip="Any other standby usage of the board (voltage dividers, extra ICs, etc)">
|
||||
ⓘ
|
||||
</span>
|
||||
</label>
|
||||
|
|
|
@ -26,12 +26,12 @@
|
|||
font-size: 14px;
|
||||
}
|
||||
|
||||
span[tooltip] {
|
||||
span[data-tooltip] {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
span[tooltip]::before {
|
||||
content: attr(tooltip);
|
||||
span[data-tooltip]::before {
|
||||
content: attr(data-tooltip);
|
||||
font-size: 13px;
|
||||
padding: 5px 10px;
|
||||
position: absolute;
|
||||
|
@ -47,7 +47,7 @@ span[tooltip]::before {
|
|||
left: 50%;
|
||||
}
|
||||
|
||||
span[tooltip]::after {
|
||||
span[data-tooltip]::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
border-top: 8px solid var(--ifm-background-surface-color);
|
||||
|
@ -62,12 +62,12 @@ span[tooltip]::after {
|
|||
left: 50%;
|
||||
}
|
||||
|
||||
span[tooltip]:hover::before {
|
||||
span[data-tooltip]:hover::before {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
span[tooltip]:hover::after {
|
||||
span[data-tooltip]:hover::after {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ function PowerProfiler() {
|
|||
<div className="profilerInput">
|
||||
<label>
|
||||
Bonded Bluetooth Profiles{" "}
|
||||
<span tooltip="The average number of host devices connected at once">
|
||||
<span data-tooltip="The average number of host devices connected at once">
|
||||
ⓘ
|
||||
</span>
|
||||
</label>
|
||||
|
@ -167,7 +167,7 @@ function PowerProfiler() {
|
|||
<div className="profilerInput">
|
||||
<label>
|
||||
Percentage Asleep{" "}
|
||||
<span tooltip="How much time the keyboard is in deep sleep (15 min. default timeout)">
|
||||
<span data-tooltip="How much time the keyboard is in deep sleep (15 min. default timeout)">
|
||||
ⓘ
|
||||
</span>
|
||||
</label>
|
||||
|
|
Loading…
Add table
Reference in a new issue