From 39e8bca2f54630e1215101608f6fd1539c79e0a6 Mon Sep 17 00:00:00 2001 From: Kan-Ru Chen Date: Sat, 24 Jun 2023 10:43:54 +0900 Subject: [PATCH 1/6] build: zephyr 3.2 update --- .github/workflows/build.yml | 7 +------ config/boards/shields/hhkb/hhkb.keymap | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a245022..87ff72a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: zmkfirmware/zmk-build-arm:3.0 + image: zmkfirmware/zmk-build-arm:stable needs: matrix name: Build strategy: @@ -71,11 +71,6 @@ jobs: - name: West Build (${{ steps.variables.outputs.display-name }}) run: | west build -s zmk/app -b ${{ matrix.board }} -- -DZEPHYR_EXTRA_MODULES=${GITHUB_WORKSPACE}/config/drivers -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }} - - 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: cat build/zephyr/.config | grep -v "^#" | grep -v "^$" - name: Rename artifacts diff --git a/config/boards/shields/hhkb/hhkb.keymap b/config/boards/shields/hhkb/hhkb.keymap index e155602..e785814 100644 --- a/config/boards/shields/hhkb/hhkb.keymap +++ b/config/boards/shields/hhkb/hhkb.keymap @@ -23,7 +23,7 @@ fn_layer { bindings = < &kp K_POWER &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 INS &kp DEL -&kp CAPS &trans &trans &trans &reset &trans &trans &bootloader &kp PSCRN &kp SLCK &kp PAUSE_BREAK &kp UP &trans &kp BSPC +&kp CAPS &trans &trans &trans &sys_reset &trans &trans &bootloader &kp PSCRN &kp SLCK &kp PAUSE_BREAK &kp UP &trans &kp BSPC &trans &kp K_VOL_DN &kp K_VOL_UP &kp K_MUTE &kp K_EJECT &trans &kp KP_MULTIPLY &kp KP_DIVIDE &kp HOME &kp PG_UP &kp LEFT &kp RIGHT &trans &trans &trans &trans &trans &trans &to BT &kp KP_PLUS &kp KP_MINUS &kp END &kp PG_DN &kp DOWN &trans &trans &trans &trans &trans &trans &trans @@ -40,4 +40,4 @@ >; }; }; -}; \ No newline at end of file +}; From 632d1b32a62e9fb6743d16fc26db0585392263b0 Mon Sep 17 00:00:00 2001 From: Kan-Ru Chen Date: Sat, 24 Jun 2023 11:01:32 +0900 Subject: [PATCH 2/6] build: remove direct drivers dependency for zephyr 3.2 update --- config/drivers/zephyr/module.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/drivers/zephyr/module.yml b/config/drivers/zephyr/module.yml index 58b6e26..02a1f8f 100644 --- a/config/drivers/zephyr/module.yml +++ b/config/drivers/zephyr/module.yml @@ -1,6 +1,4 @@ name: hhkb_drivers build: - depends: - - drivers cmake: . kconfig: Kconfig From f3235e4c6b017dfa81695ba9866123c64e2be8b7 Mon Sep 17 00:00:00 2001 From: Kan-Ru Chen Date: Sat, 24 Jun 2023 11:23:13 +0900 Subject: [PATCH 3/6] build: rename module to hhkb_drivers and add back drivers dependency for zephyr 3.2 update --- .github/workflows/build.yml | 2 +- README.md | 2 +- config/{drivers => hhkb_drivers}/CMakeLists.txt | 0 config/{drivers => hhkb_drivers}/Kconfig | 0 config/{drivers => hhkb_drivers}/kscan/CMakeLists.txt | 2 +- config/{drivers => hhkb_drivers}/kscan/Kconfig | 0 config/{drivers => hhkb_drivers}/kscan/kscan_gpio_topre.c | 0 config/{drivers => hhkb_drivers}/pm/CMakeLists.txt | 2 +- config/{drivers => hhkb_drivers}/pm/Kconfig | 0 config/{drivers => hhkb_drivers}/pm/pm_wake_sensor.c | 0 config/{drivers => hhkb_drivers}/zephyr/module.yml | 2 ++ 11 files changed, 6 insertions(+), 4 deletions(-) rename config/{drivers => hhkb_drivers}/CMakeLists.txt (100%) rename config/{drivers => hhkb_drivers}/Kconfig (100%) rename config/{drivers => hhkb_drivers}/kscan/CMakeLists.txt (76%) rename config/{drivers => hhkb_drivers}/kscan/Kconfig (100%) rename config/{drivers => hhkb_drivers}/kscan/kscan_gpio_topre.c (100%) rename config/{drivers => hhkb_drivers}/pm/CMakeLists.txt (75%) rename config/{drivers => hhkb_drivers}/pm/Kconfig (100%) rename config/{drivers => hhkb_drivers}/pm/pm_wake_sensor.c (100%) rename config/{drivers => hhkb_drivers}/zephyr/module.yml (69%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87ff72a..43fcf8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: run: west zephyr-export - name: West Build (${{ steps.variables.outputs.display-name }}) run: | - west build -s zmk/app -b ${{ matrix.board }} -- -DZEPHYR_EXTRA_MODULES=${GITHUB_WORKSPACE}/config/drivers -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }} + west build -s zmk/app -b ${{ matrix.board }} -- -DZEPHYR_EXTRA_MODULES=${GITHUB_WORKSPACE}/config/hhkb_drivers -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }} - name: ${{ steps.variables.outputs.display-name }} Kconfig file run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$" - name: Rename artifacts diff --git a/README.md b/README.md index 491e1ac..92a47fa 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Add the extra kscan module: ```sh west build -b nice_nano_v2 -- \ - -DSHIELD=hhkb -DZEPHYR_EXTRA_MODULES=$WORKSPACE_PATH/config/drivers/ \ + -DSHIELD=hhkb -DZEPHYR_EXTRA_MODULES=$WORKSPACE_PATH/config/hhkb_drivers/ \ -DZMK_CONFIG=$WORKSPACE_PATH/config ``` diff --git a/config/drivers/CMakeLists.txt b/config/hhkb_drivers/CMakeLists.txt similarity index 100% rename from config/drivers/CMakeLists.txt rename to config/hhkb_drivers/CMakeLists.txt diff --git a/config/drivers/Kconfig b/config/hhkb_drivers/Kconfig similarity index 100% rename from config/drivers/Kconfig rename to config/hhkb_drivers/Kconfig diff --git a/config/drivers/kscan/CMakeLists.txt b/config/hhkb_drivers/kscan/CMakeLists.txt similarity index 76% rename from config/drivers/kscan/CMakeLists.txt rename to config/hhkb_drivers/kscan/CMakeLists.txt index 7b14685..8d7f154 100644 --- a/config/drivers/kscan/CMakeLists.txt +++ b/config/hhkb_drivers/kscan/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2022 Kan-Ru Chen # SPDX-License-Identifier: MIT -zephyr_library_named(zmk__drivers__kscan_topre) +zephyr_library_named(zmk__hhkb_drivers__kscan_topre) zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/include) zephyr_library_sources(kscan_gpio_topre.c) diff --git a/config/drivers/kscan/Kconfig b/config/hhkb_drivers/kscan/Kconfig similarity index 100% rename from config/drivers/kscan/Kconfig rename to config/hhkb_drivers/kscan/Kconfig diff --git a/config/drivers/kscan/kscan_gpio_topre.c b/config/hhkb_drivers/kscan/kscan_gpio_topre.c similarity index 100% rename from config/drivers/kscan/kscan_gpio_topre.c rename to config/hhkb_drivers/kscan/kscan_gpio_topre.c diff --git a/config/drivers/pm/CMakeLists.txt b/config/hhkb_drivers/pm/CMakeLists.txt similarity index 75% rename from config/drivers/pm/CMakeLists.txt rename to config/hhkb_drivers/pm/CMakeLists.txt index 06ab5cd..49c4847 100644 --- a/config/drivers/pm/CMakeLists.txt +++ b/config/hhkb_drivers/pm/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2023 Kan-Ru Chen # SPDX-License-Identifier: MIT -zephyr_library_named(zmk__drivers__pm_wake_sensor) +zephyr_library_named(zmk__hhkb_drivers__pm_wake_sensor) zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/include) zephyr_library_sources(pm_wake_sensor.c) diff --git a/config/drivers/pm/Kconfig b/config/hhkb_drivers/pm/Kconfig similarity index 100% rename from config/drivers/pm/Kconfig rename to config/hhkb_drivers/pm/Kconfig diff --git a/config/drivers/pm/pm_wake_sensor.c b/config/hhkb_drivers/pm/pm_wake_sensor.c similarity index 100% rename from config/drivers/pm/pm_wake_sensor.c rename to config/hhkb_drivers/pm/pm_wake_sensor.c diff --git a/config/drivers/zephyr/module.yml b/config/hhkb_drivers/zephyr/module.yml similarity index 69% rename from config/drivers/zephyr/module.yml rename to config/hhkb_drivers/zephyr/module.yml index 02a1f8f..63729da 100644 --- a/config/drivers/zephyr/module.yml +++ b/config/hhkb_drivers/zephyr/module.yml @@ -1,4 +1,6 @@ name: hhkb_drivers build: + depends: + - drivers cmake: . kconfig: Kconfig From 13c510f05928d131c1cb8be8a9501f5dfced9c5f Mon Sep 17 00:00:00 2001 From: Kan-Ru Chen Date: Sat, 24 Jun 2023 14:06:15 +0900 Subject: [PATCH 4/6] build: add zmk drivers to extra modules list --- .github/workflows/build.yml | 2 +- README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 43fcf8f..083aac6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: run: west zephyr-export - name: West Build (${{ steps.variables.outputs.display-name }}) run: | - west build -s zmk/app -b ${{ matrix.board }} -- -DZEPHYR_EXTRA_MODULES=${GITHUB_WORKSPACE}/config/hhkb_drivers -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }} + west build -s zmk/app -b ${{ matrix.board }} -- -DZEPHYR_EXTRA_MODULES=zmk/app/drivers;${GITHUB_WORKSPACE}/config/hhkb_drivers -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }} - name: ${{ steps.variables.outputs.display-name }} Kconfig file run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$" - name: Rename artifacts diff --git a/README.md b/README.md index 92a47fa..7780edf 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@ Add the extra kscan module: ```sh west build -b nice_nano_v2 -- \ - -DSHIELD=hhkb -DZEPHYR_EXTRA_MODULES=$WORKSPACE_PATH/config/hhkb_drivers/ \ + -DSHIELD=hhkb \ + -DZEPHYR_EXTRA_MODULES=$ZMK_PATH/app/drivers/;$WORKSPACE_PATH/config/hhkb_drivers/ \ -DZMK_CONFIG=$WORKSPACE_PATH/config ``` From 3095ef2423b5e067812050a765521400d5f547c7 Mon Sep 17 00:00:00 2001 From: Kan-Ru Chen Date: Sat, 24 Jun 2023 14:06:43 +0900 Subject: [PATCH 5/6] fix: new zephyr import path --- config/hhkb_drivers/kscan/kscan_gpio_topre.c | 10 +++++----- config/hhkb_drivers/pm/pm_wake_sensor.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/hhkb_drivers/kscan/kscan_gpio_topre.c b/config/hhkb_drivers/kscan/kscan_gpio_topre.c index 94308cb..876c093 100644 --- a/config/hhkb_drivers/kscan/kscan_gpio_topre.c +++ b/config/hhkb_drivers/kscan/kscan_gpio_topre.c @@ -6,10 +6,10 @@ #define DT_DRV_COMPAT zmk_kscan_gpio_topre -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -249,4 +249,4 @@ static const struct kscan_driver_api kscan_gpio_topre_api = { CONFIG_APPLICATION_INIT_PRIORITY, \ &kscan_gpio_topre_api); -DT_INST_FOREACH_STATUS_OKAY(CREATE_KSCAN_GPIO_TOPRE) \ No newline at end of file +DT_INST_FOREACH_STATUS_OKAY(CREATE_KSCAN_GPIO_TOPRE) diff --git a/config/hhkb_drivers/pm/pm_wake_sensor.c b/config/hhkb_drivers/pm/pm_wake_sensor.c index b553016..cbda91c 100644 --- a/config/hhkb_drivers/pm/pm_wake_sensor.c +++ b/config/hhkb_drivers/pm/pm_wake_sensor.c @@ -6,8 +6,8 @@ #define DT_DRV_COMPAT zmk_pm_wake_sensor -#include -#include +#include +#include struct pm_wake_sensor_config { @@ -39,4 +39,4 @@ pm_wake_sensor_init(const struct device *dev) APPLICATION, 99, \ NULL); -DT_INST_FOREACH_STATUS_OKAY(CREATE_PM_WAKE_SENSOR) \ No newline at end of file +DT_INST_FOREACH_STATUS_OKAY(CREATE_PM_WAKE_SENSOR) From b225d12e2e277fe6f5239873e8d9893b77d5ebdc Mon Sep 17 00:00:00 2001 From: Kan-Ru Chen Date: Sun, 25 Jun 2023 07:49:59 +0900 Subject: [PATCH 6/6] fix: new zephyr import path --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 083aac6..30e216e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,7 +70,7 @@ jobs: run: west zephyr-export - name: West Build (${{ steps.variables.outputs.display-name }}) run: | - west build -s zmk/app -b ${{ matrix.board }} -- -DZEPHYR_EXTRA_MODULES=zmk/app/drivers;${GITHUB_WORKSPACE}/config/hhkb_drivers -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }} + west build -s zmk/app -b ${{ matrix.board }} -- -DZEPHYR_EXTRA_MODULES="$PWD/zmk/app/drivers;${GITHUB_WORKSPACE}/config/hhkb_drivers" -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }} - name: ${{ steps.variables.outputs.display-name }} Kconfig file run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$" - name: Rename artifacts