Skip to content

Commit

Permalink
Feature: pointer movement/scrolling zmkfirmware#2027
Browse files Browse the repository at this point in the history
  • Loading branch information
englmaxi committed Nov 26, 2023
1 parent 71c8272 commit 78b3b89
Show file tree
Hide file tree
Showing 152 changed files with 1,543 additions and 324 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/zmkfirmware/zmk-dev-arm:3.2
FROM docker.io/zmkfirmware/zmk-dev-arm:3.5-branch

COPY .bashrc tmp
RUN mv /tmp/.bashrc ~/.bashrc
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
if: ${{ always() }}
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-build-arm:3.2
image: docker.io/zmkfirmware/zmk-build-arm:3.5-branch
needs: compile-matrix
strategy:
matrix:
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 @@ -18,7 +18,7 @@ jobs:
validate-metadata:
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-dev-arm:3.2
image: docker.io/zmkfirmware/zmk-dev-arm:3.5-branch
steps:
- uses: actions/checkout@v3
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
test: ${{ fromJSON(needs.collect-tests.outputs.test-dirs) }}
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-build-arm:3.2
image: docker.io/zmkfirmware/zmk-build-arm:3.5-branch
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
84 changes: 37 additions & 47 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,38 @@
{
"configurations": [
{
"name": "LEFT",
"includePath": [
"/workspaces/zmk/**"
],
"defines": [],
"compilerPath": "/opt/zephyr-sdk-0.15.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc",
"cStandard": "c17",
"cppStandard": "c++98",
"intelliSenseMode": "linux-gcc-arm",
"compileCommands": "/workspaces/zmk/app/build/left/compile_commands.json",
"compilerPathInCppPropertiesJson": "/opt/zephyr-sdk-0.15.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc",
"compileCommandsInCppPropertiesJson": "${workspaceFolder}/app/build/left/compile_commands.json",
"mergeConfigurations": false,
"browse": {
"path": [
"/workspaces/zmk/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true
}
},
{
"name": "RIGHT",
"includePath": [
"/workspaces/zmk/**"
],
"defines": [],
"compilerPath": "/opt/zephyr-sdk-0.15.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc",
"cStandard": "c17",
"cppStandard": "c++98",
"intelliSenseMode": "linux-gcc-arm",
"compilerPathInCppPropertiesJson": "/opt/zephyr-sdk-0.15.2/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc",
"mergeConfigurations": false,
"browse": {
"path": [
"/workspaces/zmk/**",
"/workspaces/zmk"
],
"limitSymbolsToIncludedHeaders": true
},
"compileCommands": "/workspaces/zmk/app/build/right/compile_commands.json"
}
],
"version": 4
}
"configurations": [
{
"name": "LEFT",
"includePath": ["/workspaces/zmk/**"],
"defines": [],
"compilerPath": "/opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc",
"cStandard": "c17",
"cppStandard": "c++98",
"intelliSenseMode": "linux-gcc-arm",
"compileCommands": "/workspaces/zmk/app/build/left/compile_commands.json",
"compilerPathInCppPropertiesJson": "/opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc",
"compileCommandsInCppPropertiesJson": "${workspaceFolder}/app/build/left/compile_commands.json",
"mergeConfigurations": false,
"browse": {
"path": ["/workspaces/zmk/**", "${workspaceFolder}"],
"limitSymbolsToIncludedHeaders": true
}
},
{
"name": "RIGHT",
"includePath": ["/workspaces/zmk/**"],
"defines": [],
"compilerPath": "/opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc",
"cStandard": "c17",
"cppStandard": "c++98",
"intelliSenseMode": "linux-gcc-arm",
"compilerPathInCppPropertiesJson": "/opt/zephyr-sdk-0.16.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc",
"mergeConfigurations": false,
"browse": {
"path": ["/workspaces/zmk/**", "/workspaces/zmk"],
"limitSymbolsToIncludedHeaders": true
},
"compileCommands": "/workspaces/zmk/app/build/right/compile_commands.json"
}
],
"version": 4
}
10 changes: 8 additions & 2 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,33 @@ project(zmk)

zephyr_linker_sources(RODATA include/linker/zmk-events.ld)

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

# Add your source file to the "app" target. This must come after
# find_package(Zephyr) which defines the target.
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/kscan.c)
target_sources(app PRIVATE src/matrix_transform.c)
target_sources_ifdef(CONFIG_ZMK_MOUSE app PRIVATE src/mouse/main.c)
target_sources_ifdef(CONFIG_ZMK_MOUSE app PRIVATE src/mouse/input_config.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)
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/ext_power_generic.c)
target_sources(app PRIVATE src/events/activity_state_changed.c)
target_sources(app PRIVATE src/events/position_state_changed.c)
target_sources(app PRIVATE src/events/sensor_event.c)
target_sources(app PRIVATE src/events/mouse_button_state_changed.c)
target_sources_ifdef(CONFIG_ZMK_WPM app PRIVATE src/events/wpm_state_changed.c)
target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/events/usb_conn_state_changed.c)
target_sources(app PRIVATE src/behaviors/behavior_reset.c)
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/behaviors/behavior_ext_power.c)
if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE src/hid.c)
target_sources_ifdef(CONFIG_ZMK_MOUSE app PRIVATE src/mouse.c)
target_sources_ifdef(CONFIG_ZMK_MOUSE app PRIVATE src/mouse/main.c)
target_sources_ifdef(CONFIG_ZMK_MOUSE app PRIVATE src/mouse/hid_input_listener.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)
Expand All @@ -57,6 +62,7 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
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_INPUT_TWO_AXIS app PRIVATE src/behaviors/behavior_input_two_axis.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
14 changes: 3 additions & 11 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ if ZMK_BLE
config BT_TINYCRYPT_ECC
default y if BT_HCI && !BT_CTLR

choice BT_LL_SW_LLCP_IMPL
default BT_LL_SW_LLCP_LEGACY

endchoice

config SYSTEM_WORKQUEUE_STACK_SIZE
default 4096 if SOC_RP2040
default 2048
Expand Down Expand Up @@ -321,9 +316,7 @@ endmenu

menu "Mouse Options"

config ZMK_MOUSE
bool "Enable ZMK mouse emulation"
default n
rsource "src/mouse/Kconfig"

#Mouse Options
endmenu
Expand All @@ -342,13 +335,12 @@ config ZMK_IDLE_TIMEOUT

config ZMK_SLEEP
bool "Enable deep sleep support"
depends on HAS_POWEROFF
select POWEROFF
imply USB

if ZMK_SLEEP

config PM_DEVICE
default y

config ZMK_IDLE_SLEEP_TIMEOUT
int "Milliseconds of inactivity before entering deep sleep"
default 900000
Expand Down
8 changes: 7 additions & 1 deletion app/Kconfig.behaviors
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ config ZMK_BEHAVIOR_MOUSE_KEY_PRESS
depends on DT_HAS_ZMK_BEHAVIOR_MOUSE_KEY_PRESS_ENABLED
imply ZMK_MOUSE

config ZMK_BEHAVIOR_INPUT_TWO_AXIS
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_INPUT_TWO_AXIS_ENABLED
imply ZMK_MOUSE

config ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON
bool
default n
Expand All @@ -31,4 +37,4 @@ config ZMK_BEHAVIOR_SENSOR_ROTATE_VAR
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
3 changes: 0 additions & 3 deletions app/boards/arm/dz60rgb/dz60rgb_rev1_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ CONFIG_SOC_STM32F303XC=y
# 72MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000

# enable pinmux
CONFIG_PINMUX=y

# enable GPIO
CONFIG_GPIO=y

Expand Down
2 changes: 1 addition & 1 deletion app/boards/arm/ferris/ferris_rev02_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CONFIG_SOC_STM32F072XB=y
# 48MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000

# enable PINMUX
# enable PINCTRL
CONFIG_PINCTRL=y

# enable GPIO
Expand Down
5 changes: 1 addition & 4 deletions app/boards/arm/mikoto/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

if(CONFIG_PINMUX)
zephyr_library()
zephyr_library_sources(pinmux.c)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
endif()
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
3 changes: 0 additions & 3 deletions app/boards/arm/mikoto/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ endif # USB
config BT_CTLR
default BT

config PINMUX
default y

choice BOARD_MIKOTO_CHARGER_CURRENT
default BOARD_MIKOTO_CHARGER_CURRENT_100MA
endchoice
Expand Down
3 changes: 1 addition & 2 deletions app/boards/arm/mikoto/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#include <zephyr/sys/sys_io.h>
#include <zephyr/devicetree.h>

static int pinmux_mikoto_init(const struct device *port) {
ARG_UNUSED(port);
static int pinmux_mikoto_init(void) {

#if CONFIG_BOARD_MIKOTO_520
const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));
Expand Down
5 changes: 1 addition & 4 deletions app/boards/arm/nrfmicro/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

if(CONFIG_PINMUX)
zephyr_library()
zephyr_library_sources(pinmux.c)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
endif()
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
3 changes: 0 additions & 3 deletions app/boards/arm/nrfmicro/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ endif # USB_DEVICE_STACK
config BT_CTLR
default BT

config PINMUX
default y

if BOARD_NRFMICRO_13 || BOARD_NRFMICRO_13_52833

config BOARD_NRFMICRO_CHARGER
Expand Down
3 changes: 0 additions & 3 deletions app/boards/arm/planck/planck_rev6_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ CONFIG_SOC_STM32F303XC=y
# 72MHz system clock
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=72000000


# enable pinmux
CONFIG_PINMUX=y
CONFIG_PINCTRL=y

# enable GPIO
Expand Down
5 changes: 1 addition & 4 deletions app/boards/arm/puchi_ble/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

if(CONFIG_PINMUX)
zephyr_library()
zephyr_library_sources(pinmux.c)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
endif()
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
3 changes: 0 additions & 3 deletions app/boards/arm/puchi_ble/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,4 @@ endif # USB_DEVICE_STACK
config BT_CTLR
default BT

config PINMUX
default y

endif # BOARD_PUCHI_BLE_v1
5 changes: 1 addition & 4 deletions app/boards/shields/corne/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,14 @@ config I2C
config SSD1306
default y

config SSD1306_REVERSE_MODE
default y

endif # ZMK_DISPLAY

if LVGL

config LV_Z_VDB_SIZE
default 64

config LV_Z_DPI
config LV_DPI_DEF
default 148

config LV_Z_BITS_PER_PIXEL
Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/corne/corne.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ 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) RC(2,10
segment-remap;
com-invdir;
com-sequential;
inversion-on;
prechargep = <0x22>;
};
};
5 changes: 1 addition & 4 deletions app/boards/shields/elephant42/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,14 @@ config I2C
config SSD1306
default y

config SSD1306_REVERSE_MODE
default y

endif # ZMK_DISPLAY

if LVGL

config LV_Z_VDB_SIZE
default 64

config LV_Z_DPI
config LV_DPI_DEF
default 148

config LV_Z_BITS_PER_PIXEL
Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/elephant42/elephant42.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7)
segment-remap;
com-invdir;
com-sequential;
inversion-on;
prechargep = <0x22>;
};
};
5 changes: 1 addition & 4 deletions app/boards/shields/jorne/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ config I2C
config SSD1306
default y

config SSD1306_REVERSE_MODE
default y

endif # ZMK_DISPLAY

if LVGL

config LV_Z_VDB_SIZE
default 64

config LV_Z_DPI
config LV_DPI_DEF
default 148

config LV_Z_BITS_PER_PIXEL
Expand Down
Loading

0 comments on commit 78b3b89

Please sign in to comment.