Skip to content

Commit

Permalink
Merge branch 'main' into rgb-momentary-eff
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Apr 11, 2024
2 parents 829b75b + 7d5aa0c commit 2f600a7
Show file tree
Hide file tree
Showing 123 changed files with 1,583 additions and 277 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build-user-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
board: ${{ matrix.board }}
shield: ${{ matrix.shield }}
artifact_name: ${{ matrix.artifact-name }}
snippet: ${{ matrix.snippet }}
run: |
if [ -e zephyr/module.yml ]; then
export zmk_load_arg=" -DZMK_EXTRA_MODULES='${GITHUB_WORKSPACE}'"
Expand All @@ -75,7 +76,12 @@ jobs:
echo "base_dir=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
fi
if [ -n "${snippet}" ]; then
extra_west_args="-S \"${snippet}\""
fi
echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV
echo "extra_west_args=${extra_west_args}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}${zmk_load_arg}" >> $GITHUB_ENV
echo "display_name=${shield:+$shield - }${board}" >> $GITHUB_ENV
echo "artifact_name=${artifact_name:-${shield:+$shield-}${board}-zmk}" >> $GITHUB_ENV
Expand Down Expand Up @@ -120,7 +126,7 @@ jobs:
- name: West Build (${{ env.display_name }})
working-directory: ${{ env.base_dir }}
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 }}
run: west build -s zmk/app -d "${{ env.build_dir }}" -b "${{ matrix.board }}" ${{ env.extra_west_args }} -- -DZMK_CONFIG=${{ env.base_dir }}/${{ inputs.config_path }} ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}

- name: ${{ env.display_name }} Kconfig file
run: |
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
/zephyr
/zmk-config
/build

# macOS
*.DS_Store

# Python
__pycache__
.python-version
.venv

# clangd
app/.cache/
8 changes: 4 additions & 4 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ set(ZEPHYR_EXTRA_MODULES "${ZMK_EXTRA_MODULES};${CMAKE_CURRENT_SOURCE_DIR}/modul
find_package(Zephyr REQUIRED HINTS ../zephyr)
project(zmk)

if(CONFIG_ZMK_SLEEP)
zephyr_linker_sources(SECTIONS include/linker/zmk-pm-devices.ld)
endif()

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

Expand All @@ -25,11 +21,14 @@ 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/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_PM app PRIVATE src/pm.c)
target_sources_ifdef(CONFIG_ZMK_EXT_POWER app PRIVATE src/ext_power_generic.c)
target_sources_ifdef(CONFIG_ZMK_GPIO_KEY_WAKEUP_TRIGGER app PRIVATE src/gpio_key_wakeup_trigger.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)
Expand All @@ -38,6 +37,7 @@ 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)
target_sources_ifdef(CONFIG_ZMK_BEHAVIOR_SOFT_OFF app PRIVATE src/behaviors/behavior_soft_off.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)
Expand Down
50 changes: 50 additions & 0 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,20 @@ config ZMK_BATTERY_REPORTING
select ZMK_LOW_PRIORITY_WORK_QUEUE
imply BT_BAS if ZMK_BLE

if ZMK_BATTERY_REPORTING

choice ZMK_BATTERY_REPORTING_FETCH_MODE
prompt "Battery Reporting Fetch Mode"

config ZMK_BATTERY_REPORTING_FETCH_MODE_STATE_OF_CHARGE
bool "State of charge"

config ZMK_BATTERY_REPORTING_FETCH_MODE_LITHIUM_VOLTAGE
bool "Lithium Voltage"

endchoice
endif

config ZMK_IDLE_TIMEOUT
int "Milliseconds of inactivity before entering idle state (OLED shutoff, etc)"
default 30000
Expand All @@ -391,6 +405,7 @@ config ZMK_SLEEP
bool "Enable deep sleep support"
depends on HAS_POWEROFF
select POWEROFF
select ZMK_PM_DEVICE_SUSPEND_RESUME
imply USB

if ZMK_SLEEP
Expand All @@ -409,6 +424,26 @@ config ZMK_EXT_POWER
bool "Enable support to control external power output"
default y

config ZMK_PM
bool

config ZMK_PM_DEVICE_SUSPEND_RESUME
bool
select ZMK_PM

config ZMK_PM_SOFT_OFF
bool "Soft-off support"
depends on HAS_POWEROFF
select ZMK_PM
select PM_DEVICE
select ZMK_PM_DEVICE_SUSPEND_RESUME
select POWEROFF

config ZMK_GPIO_KEY_WAKEUP_TRIGGER
bool "Hardware supported wakeup (GPIO)"
default y
depends on DT_HAS_ZMK_GPIO_KEY_WAKEUP_TRIGGER_ENABLED && ZMK_PM_SOFT_OFF

#Power Management
endmenu

Expand Down Expand Up @@ -485,6 +520,21 @@ config ZMK_KSCAN_EVENT_QUEUE_SIZE

endif # ZMK_KSCAN

config ZMK_KSCAN_SIDEBAND_BEHAVIORS
bool
default y
depends on DT_HAS_ZMK_KSCAN_SIDEBAND_BEHAVIORS_ENABLED
select KSCAN

if ZMK_KSCAN_SIDEBAND_BEHAVIORS

config ZMK_KSCAN_SIDEBAND_BEHAVIORS_INIT_PRIORITY
int "Keyboard scan sideband behaviors driver init priority"
# The default kscan init priority is 90, so be sure we are initialized later.
default 95

endif # ZMK_KSCAN_SIDEBAND_BEHAVIORS

menu "Logging"

config ZMK_LOGGING_MINIMAL
Expand Down
5 changes: 5 additions & 0 deletions app/Kconfig.behaviors
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ config ZMK_BEHAVIOR_MOUSE_KEY_PRESS
depends on DT_HAS_ZMK_BEHAVIOR_MOUSE_KEY_PRESS_ENABLED
imply ZMK_MOUSE

config ZMK_BEHAVIOR_SOFT_OFF
bool
default y
depends on DT_HAS_ZMK_BEHAVIOR_SOFT_OFF_ENABLED && ZMK_PM_SOFT_OFF

config ZMK_BEHAVIOR_SENSOR_ROTATE_COMMON
bool

Expand Down
1 change: 1 addition & 0 deletions app/boards/arm/adv360pro/adv360pro_left.dts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/{
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
1 change: 1 addition & 0 deletions app/boards/arm/adv360pro/adv360pro_right.dts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/{
kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
2 changes: 2 additions & 0 deletions app/boards/arm/bt60/bt60_v1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@

kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

col-gpios
Expand Down
2 changes: 2 additions & 0 deletions app/boards/arm/bt60/bt60_v1_hs.dts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

col-gpios
Expand Down
2 changes: 2 additions & 0 deletions app/boards/arm/ckp/ckp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

col-gpios
Expand Down
1 change: 1 addition & 0 deletions app/boards/arm/corneish_zen/corneish_zen_v1_left.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
1 change: 1 addition & 0 deletions app/boards/arm/corneish_zen/corneish_zen_v1_right.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
1 change: 1 addition & 0 deletions app/boards/arm/corneish_zen/corneish_zen_v2_left.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
1 change: 1 addition & 0 deletions app/boards/arm/corneish_zen/corneish_zen_v2_right.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
2 changes: 2 additions & 0 deletions app/boards/arm/glove80/glove80.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
debounce-press-ms = <4>;
debounce-release-ms = <20>;
Expand Down
1 change: 1 addition & 0 deletions app/boards/arm/nice60/nice60.dts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) R

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
1 change: 1 addition & 0 deletions app/boards/arm/s40nc/s40nc.dts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
2 changes: 2 additions & 0 deletions app/boards/shields/a_dux/a_dux.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-direct";
wakeup-source;

input-gpios =
<&pro_micro 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/bat43/bat43.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(6,0) RC(6,1) RC(6,2)

kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;
diode-direction = "col2row";

col-gpios
Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/bfo9000/bfo9000.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
2 changes: 2 additions & 0 deletions app/boards/shields/boardsource3x4/boardsource3x4.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

row-gpios
Expand Down
2 changes: 2 additions & 0 deletions app/boards/shields/boardsource5x12/boardsource5x12.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

row-gpios
Expand Down
2 changes: 2 additions & 0 deletions app/boards/shields/chalice/chalice.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@

kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

col-gpios
Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/clog/clog.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-direct";
wakeup-source;

input-gpios
= <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
Expand Down
2 changes: 2 additions & 0 deletions app/boards/shields/contra/contra.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

col-gpios
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 @@ -47,6 +47,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

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
2 changes: 2 additions & 0 deletions app/boards/shields/cradio/cradio.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-direct";
wakeup-source;

input-gpios
= <&pro_micro 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
Expand Down
2 changes: 2 additions & 0 deletions app/boards/shields/crbn/crbn.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

col-gpios
Expand Down
2 changes: 2 additions & 0 deletions app/boards/shields/eek/eek.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

col-gpios
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 @@ -26,6 +26,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)

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";
row-gpios
Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/ergodash/ergodash.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,13) RC(4,12

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

Expand Down
1 change: 1 addition & 0 deletions app/boards/shields/eternal_keypad/eternal_keypad.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

diode-direction = "col2row";

Expand Down
Loading

0 comments on commit 2f600a7

Please sign in to comment.