Skip to content

Commit

Permalink
Merge branch 'ptdevice-alpotato' of github.com:ALpotato/zmk into ALpo…
Browse files Browse the repository at this point in the history
…tato-ptdevice-alpotato
  • Loading branch information
christianholman committed Aug 4, 2024
2 parents fd3aa4b + 5591ade commit 85095af
Show file tree
Hide file tree
Showing 326 changed files with 22,699 additions and 19 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build-user-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ jobs:
shell: sh -x {0}
run: west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" -- -DZMK_CONFIG=${{ env.base_dir }}/${{ inputs.config_path }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}

<<<<<<< HEAD
- name: ${{ env.display_name }} Kconfig file
run: |
if [ -f "${{ env.build_dir }}/zephyr/.config" ]
Expand All @@ -143,6 +144,16 @@ jobs:
echo "No Devicetree output"
fi
if: ${{ !cancelled() }}
=======
- name: ${{ steps.variables.outputs.display-name }} DTS File
if: ${{ always() }}
run: |
if [ -f "build/zephyr/${{ matrix.board }}.dts.pre.tmp" ]; then cat -n build/zephyr/${{ matrix.board }}.dts.pre.tmp; fi
if [ -f "build/zephyr/zephyr.dts" ]; then cat -n build/zephyr/zephyr.dts; fi
- name: ${{ steps.variables.outputs.display-name }} Kconfig file
run: grep -v -e "^#" -e "^$" build/zephyr/.config | sort
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048

- name: Rename artifacts
shell: sh -x {0}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ on:
paths:
- ".github/workflows/build.yml"
- "app/**"
<<<<<<< HEAD
schedule:
- cron: "22 4 * * *"
=======
# disabling auto build until fixing all build errors to prevent excessive emails
# schedule:
# - cron: '22 4 * * *'
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048

jobs:
build:
Expand All @@ -24,7 +30,11 @@ jobs:
include: ${{ fromJSON(needs.compile-matrix.outputs.include-list) }}
steps:
- name: Checkout
<<<<<<< HEAD
uses: actions/checkout@v4
=======
uses: actions/checkout@v3
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048
- name: Cache west modules
uses: actions/cache@v4
env:
Expand Down Expand Up @@ -178,7 +188,11 @@ jobs:
core-include: ${{ steps.core-list.outputs.result }}
steps:
- name: Checkout
<<<<<<< HEAD
uses: actions/checkout@v4
=======
uses: actions/checkout@v3
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -207,7 +221,11 @@ jobs:
boards-include: ${{ steps.boards-list.outputs.result }}
steps:
- name: Checkout
<<<<<<< HEAD
uses: actions/checkout@v4
=======
uses: actions/checkout@v3
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -335,7 +353,11 @@ jobs:
organized-metadata: ${{ steps.organize-metadata.outputs.result }}
steps:
- name: Checkout
<<<<<<< HEAD
uses: actions/checkout@v4
=======
uses: actions/checkout@v3
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
/build
*.DS_Store
__pycache__
<<<<<<< HEAD
.python-version
.venv
=======
*.~undo-tree~
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"files.associations": {
"*.overlay": "dts",
"*.keymap": "dts"
"*.keymap": "dts",
"usb_conn_state_changed.h": "c",
"ble_active_profile_changed.h": "c"
},
"python.formatting.provider": "black",
"[c]": {
Expand Down
29 changes: 29 additions & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,27 @@ target_sources(app PRIVATE src/activity.c)
target_sources(app PRIVATE src/behavior.c)
target_sources(app PRIVATE src/kscan.c)
target_sources(app PRIVATE src/matrix_transform.c)
target_sources(app PRIVATE src/mouse/key_listener.c)
target_sources(app PRIVATE src/mouse/main.c)
target_sources(app PRIVATE src/mouse/tick_listener.c)
target_sources(app PRIVATE src/sensors.c)
target_sources(app PRIVATE src/point_device/main.c)
target_sources(app PRIVATE src/point_device/sliders.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)
<<<<<<< HEAD
target_sources(app PRIVATE src/events/mouse_button_state_changed.c)
=======
target_sources(app PRIVATE src/events/pd_raw_event.c)
target_sources(app PRIVATE src/events/mouse_button_state_changed.c)
target_sources(app PRIVATE src/events/mouse_move_state_changed.c)
target_sources(app PRIVATE src/events/mouse_tick.c)
target_sources(app PRIVATE src/events/mouse_scroll_state_changed.c)
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048
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)
Expand All @@ -55,10 +68,19 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE src/behaviors/behavior_to_layer.c)
target_sources(app PRIVATE src/behaviors/behavior_transparent.c)
target_sources(app PRIVATE src/behaviors/behavior_none.c)
<<<<<<< HEAD
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(app PRIVATE src/behaviors/behavior_sensor_rotate_key_press.c)
target_sources(app PRIVATE src/behaviors/behavior_mouse_key_press.c)
target_sources(app PRIVATE src/behaviors/behavior_mouse_move.c)
target_sources(app PRIVATE src/behaviors/behavior_mouse_scroll.c)
target_sources(app PRIVATE src/behaviors/behavior_point_device_incremental.c)
target_sources(app PRIVATE src/behaviors/behavior_point_device_directional.c)
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048
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 All @@ -70,7 +92,14 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE src/events/layer_state_changed.c)
target_sources(app PRIVATE src/events/modifiers_state_changed.c)
target_sources(app PRIVATE src/events/keycode_state_changed.c)
<<<<<<< HEAD
target_sources_ifdef(CONFIG_ZMK_HID_INDICATORS app PRIVATE src/hid_indicators.c)
=======
target_sources(app PRIVATE src/events/pd_scroll_state_changed.c)
target_sources(app PRIVATE src/events/pd_position_state_changed.c)
target_sources(app PRIVATE src/point_device/pd_listener.c)
target_sources(app PRIVATE src/point_device/trackballs.c)
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048

if (CONFIG_ZMK_BLE)
target_sources(app PRIVATE src/events/ble_active_profile_changed.c)
Expand Down
22 changes: 22 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ config ZMK_BLE_MOUSE_REPORT_QUEUE_SIZE
int "Max number of mouse HID reports to queue for sending over BLE"
default 20

config ZMK_BLE_MOUSE_REPORT_QUEUE_SIZE
int "Max number of mouse HID reports to queue for sending over BLE"
default 20

config ZMK_BLE_CLEAR_BONDS_ON_START
bool "Configuration that clears all bond information from the keyboard on startup."
default n
Expand Down Expand Up @@ -381,13 +385,26 @@ endmenu

menu "Mouse Options"

<<<<<<< HEAD
config ZMK_MOUSE
bool "Enable ZMK mouse emulation"
default n
=======
rsource "src/mouse/Kconfig"
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048

#Mouse Options
endmenu

<<<<<<< HEAD
=======
menu "Point Device Options"

rsource "src/point_device/Kconfig"

endmenu

>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048
menu "Power Management"

config ZMK_BATTERY_REPORTING
Expand Down Expand Up @@ -536,13 +553,18 @@ config ZMK_USB_LOGGING

if ZMK_USB_LOGGING

<<<<<<< HEAD
choice USB_CDC_ACM_LOG_LEVEL_CHOICE
default USB_CDC_ACM_LOG_LEVEL_OFF
endchoice

choice USB_DRIVER_LOG_LEVEL_CHOICE
default USB_DRIVER_LOG_LEVEL_OFF
endchoice
=======
# config ZMK_LOG_LEVEL
# default 1
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048

# We do this to avoid log loop where logging to USB generates more log messages.

Expand Down
12 changes: 12 additions & 0 deletions app/boards/arm/nice_nano/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) 2021 Darryl deHaan
# SPDX-License-Identifier: MIT
#

if (CONFIG_NICE_NANO_POINTDEVICE)
add_subdirectory_ifdef(CONFIG_PINNACLE trackpad)
add_subdirectory_ifdef(CONFIG_PMW33XX trackball)
add_subdirectory_ifdef(CONFIG_PMW3360 trackball)
add_subdirectory_ifdef(CONFIG_PAW3395 trackball)
add_subdirectory_ifdef(CONFIG_PMW3610 trackball)
endif()
46 changes: 44 additions & 2 deletions app/boards/arm/nice_nano/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,59 @@

if BOARD_NICE_NANO || BOARD_NICE_NANO_V2

<<<<<<< HEAD
config BOARD
=======
config BOARD
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048
default "nice_nano"

if USB_DEVICE_STACK
if USB_DEVICE_STACK

<<<<<<< HEAD
config USB_NRFX
default y
=======
config USB_NRFX
default y
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048

endif # USB_DEVICE_STACK
endif # USB_DEVICE_STACK

<<<<<<< HEAD
config BT_CTLR
default BT
=======
config BT_CTLR
default BT

config ZMK_BLE
default y

config ZMK_USB
default y

# Role of the keyboard in split setup, default is master (i.e., central)
## NOTE: this is a dedicated config option for nrfmacro board, so that all shields
## using this board can share the some configuration. It's mainly used for controlling
## which widget to show on different side of the keyboard
choice
prompt "Role of the keyboard"
help
Specify the role of the keyboard

config NICE_NANO_SHIELD_MASTER
bool "master side, in charge of communication with host"

config NICE_NANO_SHIELD_SLAVE
bool "slave side, acting as a peripheral to master side"

endchoice

# add point device
config NICE_NANO_POINTDEVICE
bool "add support for point device"
select SPI
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048

endif # BOARD_NICE_NANO || BOARD_NICE_NANO_V2
4 changes: 4 additions & 0 deletions app/boards/arm/nice_nano/nice_nano.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
pinctrl-names = "default", "sleep";
};

&spi0 {
compatible = "nordic,nrf-spim";
};

&uart0 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
Expand Down
2 changes: 2 additions & 0 deletions app/boards/arm/nice_nano/nice_nano.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ supported:
- ieee802154
- pwm
- watchdog
- spi
- i2c
2 changes: 2 additions & 0 deletions app/boards/arm/nice_nano/nice_nano_v2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@
compatible = "zmk,battery-nrf-vddh";
};
};

nice_nano_spi: &spi2 {};
2 changes: 2 additions & 0 deletions app/boards/arm/nice_nano/nice_nano_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ supported:
- ieee802154
- pwm
- watchdog
- spi
- i2c
8 changes: 7 additions & 1 deletion app/boards/arm/nice_nano/nice_nano_v2_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@ CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

<<<<<<< HEAD
CONFIG_ZMK_BLE=y
CONFIG_ZMK_USB=y
CONFIG_ZMK_USB=y
=======
# added from nrfmacro, not sure if needed for trackball
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
>>>>>>> 5591ade36fef72969c7328b61dd0da901d713048
9 changes: 9 additions & 0 deletions app/boards/arm/nice_nano/trackball/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
zephyr_library()
zephyr_library_sources_ifdef(CONFIG_PMW33XX trackball.c)
zephyr_library_sources_ifdef(CONFIG_PMW3360 trackball_new.c)
zephyr_library_sources_ifdef(CONFIG_PAW3395 trackball_new.c)
zephyr_library_sources_ifdef(CONFIG_PMW3610 trackball_new.c)

zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/include)
zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/drivers/sensor)
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
Loading

0 comments on commit 85095af

Please sign in to comment.