Skip to content

Commit

Permalink
Merge pull request #29 from zmkfirmware/main
Browse files Browse the repository at this point in the history
Update with upstream changes
  • Loading branch information
rafaelromao authored Oct 6, 2023
2 parents 664bb47 + fd05478 commit 0889feb
Show file tree
Hide file tree
Showing 279 changed files with 6,458 additions and 920 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
[![Build](https://github.com/zmkfirmware/zmk/workflows/Build/badge.svg)](https://github.com/zmkfirmware/zmk/actions)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)

[ZMK Firmware](https://zmk.dev/) is an open source (MIT) keyboard firmware built on the [Zephyr™ Project](https://www.zephyrproject.org/) Real Time Operating System (RTOS). ZMK's goal is to provide a modern, wireless, and powerful firmware free of licensing issues.
[ZMK Firmware](https://zmk.dev/) is an open source ([MIT](LICENSE)) keyboard firmware built on the [Zephyr™ Project](https://www.zephyrproject.org/) Real Time Operating System (RTOS). ZMK's goal is to provide a modern, wireless, and powerful firmware free of licensing issues.

Check out the website to learn more: https://zmk.dev/
Check out the website to learn more: https://zmk.dev/.

You can also come join our [ZMK Discord Server](https://zmk.dev/community/discord/invite)
You can also come join our [ZMK Discord Server](https://zmk.dev/community/discord/invite).

To review features, check out the [feature overview](https://zmk.dev/docs/). ZMK is under active development, and new features are listed with the [enhancement label](https://github.com/zmkfirmware/zmk/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement) in GitHub. Please feel free to add 👍 to the issue description of any requests to upvote the feature.
5 changes: 3 additions & 2 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ list(APPEND DTS_ROOT ${CMAKE_SOURCE_DIR}/drivers/zephyr)
set(ZephyrBuildConfiguration_ROOT ${CMAKE_SOURCE_DIR}/cmake)

list(APPEND ZEPHYR_EXTRA_MODULES
${CMAKE_CURRENT_SOURCE_DIR}/drivers
${CMAKE_CURRENT_SOURCE_DIR}/module
)

# Find Zephyr. This also loads Zephyr's build system.
Expand Down Expand Up @@ -59,7 +59,7 @@ if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
target_sources(app PRIVATE src/behavior_queue.c)
target_sources(app PRIVATE src/conditional_layer.c)
target_sources(app PRIVATE src/endpoints.c)
target_sources(app PRIVATE src/events/endpoint_selection_changed.c)
target_sources(app PRIVATE src/events/endpoint_changed.c)
target_sources(app PRIVATE src/hid_listener.c)
target_sources(app PRIVATE src/keymap.c)
target_sources(app PRIVATE src/events/layer_state_changed.c)
Expand Down Expand Up @@ -87,6 +87,7 @@ target_sources_ifdef(CONFIG_USB_DEVICE_STACK app PRIVATE src/usb.c)
target_sources_ifdef(CONFIG_ZMK_USB app PRIVATE src/usb_hid.c)
target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow.c)
target_sources_ifdef(CONFIG_ZMK_BACKLIGHT app PRIVATE src/backlight.c)
target_sources(app PRIVATE src/workqueue.c)
target_sources(app PRIVATE src/main.c)

add_subdirectory(src/display/)
Expand Down
20 changes: 16 additions & 4 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,18 @@ endif
#Initialization Priorities
endmenu

menu "KSCAN Settings"
menuconfig ZMK_KSCAN
bool "ZMK KScan Integration"
default y
select KSCAN

if ZMK_KSCAN

config ZMK_KSCAN_EVENT_QUEUE_SIZE
int "Size of the event queue for KSCAN events to buffer events"
default 4

#KSCAN Settings
endmenu
endif # ZMK_KSCAN

menu "Logging"

Expand Down Expand Up @@ -500,10 +504,18 @@ config ZMK_SETTINGS_SAVE_DEBOUNCE
endif

config ZMK_BATTERY_REPORT_INTERVAL
depends on ZMK_BLE
depends on ZMK_BATTERY_REPORTING
int "Battery level report interval in seconds"
default 60

config ZMK_LOW_PRIORITY_THREAD_STACK_SIZE
int "Low priority thread stack size"
default 768

config ZMK_LOW_PRIORITY_THREAD_PRIORITY
int "Low priority thread priority"
default 10

#Advanced
endmenu

Expand Down
35 changes: 15 additions & 20 deletions app/boards/arm/corneish_zen/widgets/output_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <zmk/display.h>
#include "output_status.h"
#include <zmk/event_manager.h>
#include <zmk/events/usb_conn_state_changed.h>
#include <zmk/events/ble_active_profile_changed.h>
#include <zmk/events/endpoint_selection_changed.h>
#include <zmk/events/endpoint_changed.h>
#include <zmk/usb.h>
#include <zmk/ble.h>
#include <zmk/endpoints.h>
Expand All @@ -39,31 +38,29 @@ LV_IMG_DECLARE(USB_connected);
static sys_slist_t widgets = SYS_SLIST_STATIC_INIT(&widgets);

struct output_status_state {
enum zmk_endpoint selected_endpoint;
struct zmk_endpoint_instance selected_endpoint;
bool active_profile_connected;
bool active_profile_bonded;
uint8_t active_profile_index;
};

static struct output_status_state get_state(const zmk_event_t *_eh) {
return (struct output_status_state){.selected_endpoint = zmk_endpoints_selected(),
.active_profile_connected =
zmk_ble_active_profile_is_connected(),
.active_profile_bonded = !zmk_ble_active_profile_is_open(),
.active_profile_index = zmk_ble_active_profile_index()};
;
return (struct output_status_state){
.selected_endpoint = zmk_endpoints_selected(),
.active_profile_connected = zmk_ble_active_profile_is_connected(),
.active_profile_bonded = !zmk_ble_active_profile_is_open(),
};
}

static void set_status_symbol(lv_obj_t *icon, struct output_status_state state) {
switch (state.selected_endpoint) {
case ZMK_ENDPOINT_USB:
switch (state.selected_endpoint.transport) {
case ZMK_TRANSPORT_USB:
lv_img_set_src(icon, &USB_connected);
break;
case ZMK_ENDPOINT_BLE:
case ZMK_TRANSPORT_BLE:
if (state.active_profile_bonded) {
if (state.active_profile_connected) {
// sprintf(text, LV_SYMBOL_BLUETOOTH "%i " LV_SYMBOL_OK, active_profile_index);
switch (state.active_profile_index) {
switch (state.selected_endpoint.ble.profile_index) {
case 0:
lv_img_set_src(icon, &bluetooth_connected_1);
break;
Expand All @@ -84,7 +81,7 @@ static void set_status_symbol(lv_obj_t *icon, struct output_status_state state)
lv_img_set_src(icon, &bluetooth_disconnected_right);
}
} else {
switch (state.active_profile_index) {
switch (state.selected_endpoint.ble.profile_index) {
case 0:
lv_img_set_src(icon, &bluetooth_advertising_1);
break;
Expand Down Expand Up @@ -113,11 +110,9 @@ static void output_status_update_cb(struct output_status_state state) {

ZMK_DISPLAY_WIDGET_LISTENER(widget_output_status, struct output_status_state,
output_status_update_cb, get_state)
ZMK_SUBSCRIPTION(widget_output_status, zmk_endpoint_selection_changed);

#if IS_ENABLED(CONFIG_USB_DEVICE_STACK)
ZMK_SUBSCRIPTION(widget_output_status, zmk_usb_conn_state_changed);
#endif
ZMK_SUBSCRIPTION(widget_output_status, zmk_endpoint_changed);
// We don't get an endpoint changed event when the active profile connects/disconnects
// but there wasn't another endpoint to switch from/to, so update on BLE events too.
#if defined(CONFIG_ZMK_BLE)
ZMK_SUBSCRIPTION(widget_output_status, zmk_ble_active_profile_changed);
#endif
Expand Down
3 changes: 3 additions & 0 deletions app/boards/seeeduino_xiao_ble.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@
};
};

&qspi {
status = "disabled";
};
2 changes: 1 addition & 1 deletion app/boards/shields/cradio/cradio.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
flavor = "tap-preferred";
tapping-term-ms = <220>;
quick-tap-ms = <150>;
global-quick-tap;
require-prior-idle-ms = <100>;
bindings = <&kp>, <&kp>;
};
};
Expand Down
20 changes: 18 additions & 2 deletions app/boards/shields/kyria/kyria.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>

/ {
Expand All @@ -15,15 +16,30 @@
// ---------------------------------------------------------------------------------------------------------------------------------
// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ |
// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' |
// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL |
// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | LAYER 1 | L SHIFT | N | M | , | . | / | CTRL |
// | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT |
bindings = <
&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
&kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LSHFT &kp LSHFT &kp LSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LSHFT &mo 1 &kp LSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL
&kp LGUI &kp DEL &kp RET &kp SPACE &kp ESC &kp RET &kp SPACE &kp TAB &kp BSPC &kp RALT
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
};
function_layer {
// ---------------------------------------------------------------------------------------------------------------------------------
// | | |BT_CLR|BTSEL0|BTSEL1|BTSEL2| | | | | | | |
// | | | |BTSEL3|BTSEL4| | | | | | | | |
// | | | | | | | | | | | | | | | | | | |
// | | | | | | | | | | | | |
bindings = <
&trans &trans &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &trans &trans &trans &trans &trans &trans
&trans &trans &trans &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
};
};
Expand Down
20 changes: 18 additions & 2 deletions app/boards/shields/kyria/kyria_rev2.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>

/ {
Expand All @@ -15,15 +16,30 @@
// ---------------------------------------------------------------------------------------------------------------------------------
// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ |
// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' |
// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL |
// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | LAYER 1 | L SHIFT | N | M | , | . | / | CTRL |
// | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT |
bindings = <
&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
&kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LSHFT &kp LSHFT &kp LSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LSHFT &mo 1 &kp LSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL
&kp LGUI &kp DEL &kp RET &kp SPACE &kp ESC &kp RET &kp SPACE &kp TAB &kp BSPC &kp RALT
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
};
function_layer {
// ---------------------------------------------------------------------------------------------------------------------------------
// | | |BT_CLR|BTSEL0|BTSEL1|BTSEL2| | | | | | | |
// | | | |BTSEL3|BTSEL4| | | | | | | | |
// | | | | | | | | | | | | | | | | | | |
// | | | | | | | | | | | | |
bindings = <
&trans &trans &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &trans &trans &trans &trans &trans &trans
&trans &trans &trans &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
};
};
Expand Down
26 changes: 21 additions & 5 deletions app/boards/shields/kyria/kyria_rev3.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>

/* Uncomment this block if using RGB
Expand All @@ -23,13 +24,28 @@
// ---------------------------------------------------------------------------------------------------------------------------------
// | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ |
// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' |
// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | L SHIFT | L SHIFT | N | M | , | . | / | CTRL |
// | SHIFT | Z | X | C | V | B | L SHIFT | L SHIFT | | LAYER 1 | L SHIFT | N | M | , | . | / | CTRL |
// | GUI | DEL | RET | SPACE | ESC | | RET | SPACE | TAB | BSPC | R-ALT |
bindings = <
&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
&kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LSHFT &kp LSHFT &kp LSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL
&kp LGUI &kp DEL &kp RET &kp SPACE &kp ESC &kp RET &kp SPACE &kp TAB &kp BSPC &kp RALT
&kp ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH
&kp TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp LSHFT &kp LSHFT &mo 1 &kp LSHFT &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RCTRL
&kp LGUI &kp DEL &kp RET &kp SPACE &kp ESC &kp RET &kp SPACE &kp TAB &kp BSPC &kp RALT
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
};
function_layer {
// ---------------------------------------------------------------------------------------------------------------------------------
// | | |BT_CLR|BTSEL0|BTSEL1|BTSEL2| | | | | | | |
// | | | |BTSEL3|BTSEL4| | | | | | | | |
// | | | | | | | | | | | | | | | | | | |
// | | | | | | | | | | | | |
bindings = <
&trans &trans &bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &trans &trans &trans &trans &trans &trans
&trans &trans &trans &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>;
Expand Down
15 changes: 12 additions & 3 deletions app/boards/shields/leeloo/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Copyright (c) 2022 The ZMK Contributors
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT

if SHIELD_LEELOO_REV2_LEFT

config ZMK_KEYBOARD_NAME
default "Leeloo v2"

config ZMK_SPLIT_ROLE_CENTRAL
default y

endif

if SHIELD_LEELOO_LEFT

config ZMK_KEYBOARD_NAME
Expand All @@ -11,7 +21,7 @@ config ZMK_SPLIT_ROLE_CENTRAL

endif

if SHIELD_LEELOO_LEFT || SHIELD_LEELOO_RIGHT
if SHIELD_LEELOO

config ZMK_SPLIT
default y
Expand All @@ -31,7 +41,6 @@ endif # ZMK_DISPLAY

if LVGL


config LV_Z_VDB_SIZE
default 64

Expand Down
15 changes: 14 additions & 1 deletion app/boards/shields/leeloo/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# Copyright (c) 2022 The ZMK Contributors
# Copyright (c) 2023 The ZMK Contributors
# SPDX-License-Identifier: MIT

config SHIELD_LEELOO
bool

config SHIELD_LEELOO_LEFT
def_bool $(shields_list_contains,leeloo_left)
select SHIELD_LEELOO

config SHIELD_LEELOO_RIGHT
def_bool $(shields_list_contains,leeloo_right)
select SHIELD_LEELOO

config SHIELD_LEELOO_REV2_LEFT
def_bool $(shields_list_contains,leeloo_rev2_left)
select SHIELD_LEELOO

config SHIELD_LEELOO_REV2_RIGHT
def_bool $(shields_list_contains,leeloo_rev2_right)
select SHIELD_LEELOO
Loading

0 comments on commit 0889feb

Please sign in to comment.