Skip to content

Commit

Permalink
Merge pull request #5 from nickconway/smart-interrupt
Browse files Browse the repository at this point in the history
Smart interrupt for fingerpunch
  • Loading branch information
autoferrit authored Dec 7, 2024
2 parents 16e92cf + fb95060 commit 48d62da
Show file tree
Hide file tree
Showing 291 changed files with 9,877 additions and 5,415 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ on:
schedule:
- cron: "22 4 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'schedule' }}
cancel-in-progress: true

permissions: {}

jobs:
build:
if: ${{ always() }}
Expand All @@ -25,6 +31,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Cache west modules
uses: actions/cache@v4
env:
Expand Down Expand Up @@ -71,7 +79,7 @@ jobs:
try {
console.log(`::group::${{ matrix.board}} ${shieldArgs.shield} Build`)
const output = execSync(`west build -s app -p -b ${{ matrix.board }} -- ${shieldArgs.shield ? '-DSHIELD="' + shieldArgs.shield + '"' : ''} ${shieldArgs['cmake-args'] || ''}`);
const output = execSync(`west build -s app -p -b ${{ matrix.board }} ${shieldArgs.snippet ? '-S ' + shieldArgs.snippet : ''} -- ${shieldArgs.shield ? '-DSHIELD="' + shieldArgs.shield + '"' : ''} ${shieldArgs['cmake-args'] || ''}`);
console.log(output.toString());
} catch (e) {
Expand Down Expand Up @@ -131,7 +139,7 @@ jobs:
throw new Error('Failed to build one or more configurations');
}
compile-matrix:
if: ${{ always() }}
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
needs: [core-coverage, board-changes, nightly]
outputs:
Expand Down Expand Up @@ -162,6 +170,7 @@ jobs:
perBoard[configuration.board].push({
shield: configuration.shield,
'cmake-args': configuration['cmake-args'],
snippet: configuration.snippet,
nickname: configuration.nickname
})
}
Expand All @@ -179,6 +188,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -284,7 +295,7 @@ jobs:
});
}))).flat();
nightly:
if: ${{ github.event_name == 'schedule' }}
if: ${{ github.event_name == 'schedule' && github.repository_owner == 'zmkfirmware' }}
runs-on: ubuntu-latest
needs: get-grouped-hardware
outputs:
Expand Down Expand Up @@ -335,6 +346,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -413,7 +426,11 @@ jobs:
board-changes: ${{ steps.board-changes.outputs.result }}
core-changes: ${{ steps.core-changes.outputs.result }}
steps:
- uses: tj-actions/changed-files@v42
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: tj-actions/changed-files@v44
id: changed-files
with:
json: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hardware-metadata-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: pip install -r app/scripts/requirements.txt
run: pip install --break-system-packages -r app/scripts/requirements.txt
- name: West init
run: west init -l app
- name: Update modules (west update)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ms-python.python",
"ms-vscode.cpptools",
"plorefice.devicetree",
"twxs.cmake"
"twxs.cmake",
"unifiedjs.vscode-mdx"
]
}
35 changes: 32 additions & 3 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ project(zmk)
zephyr_linker_sources(SECTIONS include/linker/zmk-behaviors.ld)
zephyr_linker_sources(RODATA include/linker/zmk-events.ld)

if(CONFIG_ZMK_BEHAVIOR_LOCAL_IDS)
zephyr_linker_sources(DATA_SECTIONS include/linker/zmk-behavior-local-id-map.ld)
endif()

zephyr_syscall_header(${APPLICATION_SOURCE_DIR}/include/drivers/behavior.h)
zephyr_syscall_header(${APPLICATION_SOURCE_DIR}/include/drivers/ext_power.h)

Expand All @@ -20,9 +24,9 @@ target_include_directories(app PRIVATE include)
target_sources(app PRIVATE src/stdlib.c)
target_sources(app PRIVATE src/activity.c)
target_sources(app PRIVATE src/behavior.c)
target_sources(app PRIVATE src/kscan.c)
target_sources_ifdef(CONFIG_ZMK_KSCAN_SIDEBAND_BEHAVIORS app PRIVATE src/kscan_sideband_behaviors.c)
target_sources(app PRIVATE src/matrix_transform.c)
target_sources(app PRIVATE src/physical_layouts.c)
target_sources(app PRIVATE src/sensors.c)
target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/wpm.c)
target_sources(app PRIVATE src/event_manager.c)
Expand All @@ -43,8 +47,8 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources_ifdef(CONFIG_ZMK_MOUSE app PRIVATE src/mouse.c)
target_sources(app PRIVATE src/behaviors/behavior_key_press.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_KEY_TOGGLE app PRIVATE src/behaviors/behavior_key_toggle.c)
target_sources(app PRIVATE src/behaviors/behavior_hold_tap.c)
target_sources(app PRIVATE src/behaviors/behavior_sticky_key.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_HOLD_TAP app PRIVATE src/behaviors/behavior_hold_tap.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_STICKY_KEY app PRIVATE src/behaviors/behavior_sticky_key.c)
target_sources(app PRIVATE src/behaviors/behavior_caps_word.c)
target_sources(app PRIVATE src/behaviors/behavior_key_repeat.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_MACRO app PRIVATE src/behaviors/behavior_macro.c)
Expand All @@ -54,11 +58,13 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE src/behaviors/behavior_toggle_layer.c)
target_sources(app PRIVATE src/behaviors/behavior_to_layer.c)
target_sources(app PRIVATE src/behaviors/behavior_transparent.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_TRI_STATE app PRIVATE src/behaviors/behavior_tri_state.c)
target_sources(app PRIVATE src/behaviors/behavior_none.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE app PRIVATE src/behaviors/behavior_sensor_rotate.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE_VAR app PRIVATE src/behaviors/behavior_sensor_rotate_var.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON app PRIVATE src/behaviors/behavior_sensor_rotate_common.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_MOUSE_KEY_PRESS app PRIVATE src/behaviors/behavior_mouse_key_press.c)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_STUDIO_UNLOCK app PRIVATE src/behaviors/behavior_studio_unlock.c)
target_sources(app PRIVATE src/combo.c)
target_sources(app PRIVATE src/behaviors/behavior_tap_dance.c)
target_sources(app PRIVATE src/behavior_queue.c)
Expand Down Expand Up @@ -101,4 +107,27 @@ target_sources(app PRIVATE src/main.c)
add_subdirectory(src/display/)
add_subdirectory_ifdef(CONFIG_SETTINGS src/settings/)

if (CONFIG_ZMK_STUDIO_RPC)
# For some reason this is failing if run from a different sub-file.
list(APPEND CMAKE_MODULE_PATH ${ZEPHYR_BASE}/modules/nanopb)

include(nanopb)

# Turn off the default nanopb behavior
set(NANOPB_GENERATE_CPP_STANDALONE OFF)

nanopb_generate_cpp(proto_srcs proto_hdrs RELPATH ${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}
${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/studio.proto
${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/meta.proto
${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/core.proto
${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/behaviors.proto
${ZEPHYR_ZMK_STUDIO_MESSAGES_MODULE_DIR}/proto/zmk/keymap.proto
)

target_include_directories(app PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_sources(app PRIVATE ${proto_srcs} ${proto_hdrs})

add_subdirectory(src/studio)
endif()

zephyr_cc_option(-Wfatal-errors)
24 changes: 21 additions & 3 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ config ZMK_HID_INDICATORS
Enable HID indicators, used for detecting state of Caps/Scroll/Num Lock,
Kata, and Compose.

config ZMK_HID_SEPARATE_MOD_RELEASE_REPORT
bool "Release Modifiers Separately"
help
Send a separate release event for the modifiers, to make sure the release
of the modifier doesn't get recognized before the actual key's release event.

menu "Output Types"

config ZMK_USB
Expand Down Expand Up @@ -157,7 +163,7 @@ config ZMK_BLE_EXPERIMENTAL_CONN
bool "Experimental BLE connection changes"
help
Enables a combination of settings that are planned to be default in future versions of ZMK
to improve connection stability. This includes changes to timing on BLE pairing initation,
to improve connection stability. This includes changes to timing on BLE pairing initiation,
restores use of the updated/new LLCP implementation, and disables 2M PHY support.

config ZMK_BLE_EXPERIMENTAL_SEC
Expand Down Expand Up @@ -252,12 +258,14 @@ rsource "src/split/Kconfig"
#Basic Keyboard Setup
endmenu

rsource "src/studio/Kconfig"

menu "Display/LED Options"

rsource "src/display/Kconfig"

menuconfig ZMK_RGB_UNDERGLOW
bool "RGB Adressable LED Underglow"
bool "RGB Addressable LED Underglow"
select LED_STRIP
select ZMK_LOW_PRIORITY_WORK_QUEUE

Expand Down Expand Up @@ -480,6 +488,12 @@ config ZMK_MACRO_DEFAULT_TAP_MS
int "Default time to wait (in milliseconds) between the press and release events of a tapped behavior in macros"
default 30

DT_COMPAT_ZMK_BEHAVIOR_TRI_STATE := zmk,behavior-tri-state

config ZMK_BEHAVIOR_TRI_STATE
bool
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_BEHAVIOR_TRI_STATE))

endmenu

menu "Advanced"
Expand All @@ -490,7 +504,11 @@ if USB_DEVICE_STACK

config ZMK_USB_INIT_PRIORITY
int "USB Init Priority"
default 50
default 94

config ZMK_USB_HID_INIT_PRIORITY
int "USB HID Init Priority"
default 95

#USB
endif
Expand Down
84 changes: 83 additions & 1 deletion app/Kconfig.behaviors
Original file line number Diff line number Diff line change
@@ -1,6 +1,68 @@
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT

config ZMK_BEHAVIOR_METADATA
bool "Metadata"
help
Enabling this option adds APIs for documenting and fetching
metadata describing a behaviors name, and supported parameters.

config ZMK_BEHAVIOR_LOCAL_IDS
bool "Local IDs"

if ZMK_BEHAVIOR_LOCAL_IDS

config ZMK_BEHAVIOR_LOCAL_IDS_IN_BINDINGS
bool "Track in behavior bindings"

choice ZMK_BEHAVIOR_LOCAL_ID_TYPE
prompt "Local ID Type"

config ZMK_BEHAVIOR_LOCAL_ID_TYPE_SETTINGS_TABLE
bool "Settings Table"
depends on SETTINGS
select ZMK_BEHAVIOR_LOCAL_IDS_IN_BINDINGS
help
Use persistent entries in the settings subsystem to identify
behaviors by local ID, which uses the device name to generate
a new settings entry tying a presistant local ID to that name.
This guarantees stable, colllision-free local IDs at the expense
of settings storage used.

config ZMK_BEHAVIOR_LOCAL_ID_TYPE_CRC16
bool "CRC16 Hash"
select CRC
help
Use the CRC16-ANSI hash of behavior device names to generate
stable behavior local IDs. This saves on settings storage at
the expense of (highly unlikely) risk of collisions.

endchoice

endif


config ZMK_BEHAVIOR_HOLD_TAP
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_HOLD_TAP_ENABLED

if ZMK_BEHAVIOR_HOLD_TAP

config ZMK_BEHAVIOR_HOLD_TAP_MAX_HELD
int "Hold Tap Max Held"
default 10
help
Max number of simultaneously held hold-taps

config ZMK_BEHAVIOR_HOLD_TAP_MAX_CAPTURED_EVENTS
int "Hold Tap Max Captured Events"
default 40
help
Max number of captured system events while waiting to resolve hold taps

endif

config ZMK_BEHAVIOR_KEY_TOGGLE
bool
default y
Expand All @@ -12,6 +74,21 @@ config ZMK_BEHAVIOR_MOUSE_KEY_PRESS
depends on DT_HAS_ZMK_BEHAVIOR_MOUSE_KEY_PRESS_ENABLED
imply ZMK_MOUSE

config ZMK_BEHAVIOR_STICKY_KEY
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_STICKY_KEY_ENABLED

if ZMK_BEHAVIOR_STICKY_KEY

config ZMK_BEHAVIOR_STICKY_KEY_MAX_HELD
int "Sticky Key Max Held"
default 10
help
Max number of simultaneously held sticky keys

endif

config ZMK_BEHAVIOR_SOFT_OFF
bool
default y
Expand All @@ -32,7 +109,12 @@ config ZMK_BEHAVIOR_SENSOR_ROTATE_VAR
depends on DT_HAS_ZMK_BEHAVIOR_SENSOR_ROTATE_VAR_ENABLED
select ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON

config ZMK_BEHAVIOR_STUDIO_UNLOCK
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_STUDIO_UNLOCK_ENABLED && ZMK_STUDIO

config ZMK_BEHAVIOR_MACRO
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_MACRO_ENABLED || DT_HAS_ZMK_BEHAVIOR_MACRO_ONE_PARAM_ENABLED || DT_HAS_ZMK_BEHAVIOR_MACRO_TWO_PARAM_ENABLED
depends on DT_HAS_ZMK_BEHAVIOR_MACRO_ENABLED || DT_HAS_ZMK_BEHAVIOR_MACRO_ONE_PARAM_ENABLED || DT_HAS_ZMK_BEHAVIOR_MACRO_TWO_PARAM_ENABLED
2 changes: 0 additions & 2 deletions app/boards/01space_rp2040_042lcd.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
* SPDX-License-Identifier: MIT
*/

#include "usb_console.dtsi"

&xiao_serial { status = "disabled"; };
2 changes: 0 additions & 2 deletions app/boards/adafruit_kb2040.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
* SPDX-License-Identifier: MIT
*/

#include "usb_console.dtsi"

&pro_micro_serial { status = "disabled"; };
2 changes: 0 additions & 2 deletions app/boards/adafruit_qt_py_rp2040.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
* SPDX-License-Identifier: MIT
*/

#include "usb_console.dtsi"

&xiao_serial { status = "disabled"; };
6 changes: 1 addition & 5 deletions app/boards/arm/adv360pro/adv360pro.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0;
zmk,backlight = &backlight;
zmk,battery = &vbatt;
Expand Down Expand Up @@ -90,11 +89,8 @@
status = "okay";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};

&flash0 {
Expand Down
Loading

0 comments on commit 48d62da

Please sign in to comment.