diff options
author | Nick <nick.win999@gmail.com> | 2020-09-15 14:41:59 -0500 |
---|---|---|
committer | Nick <nick.win999@gmail.com> | 2020-09-15 14:41:59 -0500 |
commit | 18d21b0362c5c09902836ed4791bd13e1efd9a9a (patch) | |
tree | 3f78a0ef43fc23e93195e1205a31f77154af7e76 /app/src/behaviors/behavior_momentary_layer.c | |
parent | 81bc157f539235ad032fde78b6f6cec7a16d2c39 (diff) | |
parent | c0806d27f1d048db335ecc854eab61b59e23ea7a (diff) |
Merge remote-tracking branch 'upstream/main' into underglow/state-persistence
Diffstat (limited to 'app/src/behaviors/behavior_momentary_layer.c')
-rw-r--r-- | app/src/behaviors/behavior_momentary_layer.c | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/app/src/behaviors/behavior_momentary_layer.c b/app/src/behaviors/behavior_momentary_layer.c index 8a8584a..80b7165 100644 --- a/app/src/behaviors/behavior_momentary_layer.c +++ b/app/src/behaviors/behavior_momentary_layer.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Peter Johanson <peter@peterjohanson.com> + * Copyright (c) 2020 The ZMK Contributors * * SPDX-License-Identifier: MIT */ @@ -14,41 +14,30 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); -struct behavior_mo_config { }; -struct behavior_mo_data { }; +struct behavior_mo_config {}; +struct behavior_mo_data {}; -static int behavior_mo_init(struct device *dev) -{ - return 0; -}; +static int behavior_mo_init(struct device *dev) { return 0; }; +static int mo_keymap_binding_pressed(struct device *dev, u32_t position, u32_t layer, u32_t _) { + LOG_DBG("position %d layer %d", position, layer); -static int mo_keymap_binding_pressed(struct device *dev, u32_t position, u32_t layer, u32_t _) -{ - LOG_DBG("position %d layer %d", position, layer); - - return zmk_keymap_layer_activate(layer); + return zmk_keymap_layer_activate(layer); } -static int mo_keymap_binding_released(struct device *dev, u32_t position, u32_t layer, u32_t _) -{ - LOG_DBG("position %d layer %d", position, layer); +static int mo_keymap_binding_released(struct device *dev, u32_t position, u32_t layer, u32_t _) { + LOG_DBG("position %d layer %d", position, layer); - return zmk_keymap_layer_deactivate(layer); + return zmk_keymap_layer_deactivate(layer); } static const struct behavior_driver_api behavior_mo_driver_api = { - .binding_pressed = mo_keymap_binding_pressed, - .binding_released = mo_keymap_binding_released -}; - + .binding_pressed = mo_keymap_binding_pressed, .binding_released = mo_keymap_binding_released}; static const struct behavior_mo_config behavior_mo_config = {}; static struct behavior_mo_data behavior_mo_data; -DEVICE_AND_API_INIT(behavior_mo, DT_INST_LABEL(0), behavior_mo_init, - &behavior_mo_data, - &behavior_mo_config, - APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, +DEVICE_AND_API_INIT(behavior_mo, DT_INST_LABEL(0), behavior_mo_init, &behavior_mo_data, + &behavior_mo_config, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &behavior_mo_driver_api); |