diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 5092deff..fe97dad3 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -76,7 +76,7 @@ target_sources_ifdef(CONFIG_ZMK_RGB_UNDERGLOW app PRIVATE src/rgb_underglow.c) target_sources(app PRIVATE src/endpoints.c) target_sources(app PRIVATE src/hid_listener.c) target_sources(app PRIVATE src/main.c) - +target_sources_ifdef(CONFIG_IS31FL3733 app PRIVATE src/led_perkey.c) add_subdirectory(src/display/) zephyr_cc_option(-Wfatal-errors) diff --git a/app/drivers/gpio/CMakeLists.txt b/app/drivers/gpio/CMakeLists.txt new file mode 100644 index 00000000..280f33e4 --- /dev/null +++ b/app/drivers/gpio/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +zephyr_library_named(zmk__drivers__gpio) +zephyr_library_include_directories(${CMAKE_SOURCE_DIR}/include) + +zephyr_library_sources_ifdef(CONFIG_GPIO_MCP23017 gpio_mcp23017.c) +zephyr_library_sources_ifndef(CONFIG_GPIO_MCP23017 ${ZEPHYR_BASE}/misc/empty_file.c) \ No newline at end of file diff --git a/app/drivers/led/CMakeLists.txt b/app/drivers/led/CMakeLists.txt index 136fb02a..474aad02 100644 --- a/app/drivers/led/CMakeLists.txt +++ b/app/drivers/led/CMakeLists.txt @@ -1,16 +1,8 @@ + # Copyright (c) 2020 The ZMK Contributors # SPDX-License-Identifier: MIT -<<<<<<< Updated upstream -<<<<<<< Updated upstream -======= -#zephyr_library() +zephyr_library() -#zephyr_library_sources(led.c) ->>>>>>> Stashed changes -======= -#zephyr_library() - -#zephyr_library_sources(led.c) ->>>>>>> Stashed changes -add_subdirectory_ifdef(CONFIG_IS31FL3733 is31fl3733) +zephyr_library_sources(led.c) +add_subdirectory_ifdef(CONFIG_IS31FL3733 is31fl3733) \ No newline at end of file diff --git a/app/drivers/led/led.c b/app/drivers/led/led.c new file mode 100644 index 00000000..e69de29b diff --git a/app/include/zmk/led_perkey.h b/app/include/zmk/led_perkey.h new file mode 100644 index 00000000..28b1e235 --- /dev/null +++ b/app/include/zmk/led_perkey.h @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +int led_perkey_init(char *name); \ No newline at end of file diff --git a/app/src/led_perkey.c b/app/src/led_perkey.c index 4e5ee225..85811646 100644 --- a/app/src/led_perkey.c +++ b/app/src/led_perkey.c @@ -80,11 +80,8 @@ void zmk_kscan_process_msgxq(struct k_work *item) { else{ set_led_rgb(led_lookup_matrix[position], led_base_color); } - pos_evx = new_position_state_changed(); - pos_evx->state = pressed; - pos_evx->position = position; - pos_evx->timestamp = k_uptime_get(); - ZMK_EVENT_RAISE(pos_evx); + ZMK_EVENT_RAISE(new_zmk_position_state_changed((struct zmk_position_state_changed){ + .state = pressed, .position = position, .timestamp = k_uptime_get()})); } } void set_all_on(const struct device *dev){ diff --git a/app/src/main.c b/app/src/main.c index ae604a7b..2245c626 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -16,6 +16,7 @@ LOG_MODULE_REGISTER(zmk, CONFIG_ZMK_LOG_LEVEL); #include #include #include +#include #define ZMK_KSCAN_DEV DT_LABEL(ZMK_MATRIX_NODE_ID) @@ -25,7 +26,9 @@ void main(void) { if (zmk_kscan_init(ZMK_KSCAN_DEV) != 0) { return; } - +#ifdef CONFIG_IS31FL3733 + led_perkey_init(ZMK_KSCAN_DEV); +#endif /* CONFIG_IS31fl3733 */ #ifdef CONFIG_ZMK_DISPLAY zmk_display_init(); #endif /* CONFIG_ZMK_DISPLAY */