aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJoel Spadin <[email protected]>2020-10-28 18:10:47 -0500
committerJoel Spadin <[email protected]>2020-10-28 18:15:05 -0500
commit440d09fd45fa59de481837825d27635819ad1c37 (patch)
tree8b535a61367dcf5a5db019180d1ea8545a8c9307
parent2fe1fbb526d9190e478999f36adbcfcf4a8847b2 (diff)
downloadzmk-440d09fd45fa59de481837825d27635819ad1c37.tar.gz
zmk-440d09fd45fa59de481837825d27635819ad1c37.zip
feat(endpoints): simplify behavior constants
-rw-r--r--app/include/dt-bindings/zmk/outputs.h10
-rw-r--r--app/src/behaviors/behavior_outputs.c6
2 files changed, 6 insertions, 10 deletions
diff --git a/app/include/dt-bindings/zmk/outputs.h b/app/include/dt-bindings/zmk/outputs.h
index c9a34ae084..f24380f7e1 100644
--- a/app/include/dt-bindings/zmk/outputs.h
+++ b/app/include/dt-bindings/zmk/outputs.h
@@ -4,10 +4,6 @@
* SPDX-License-Identifier: MIT
*/
-#define OUTPUT_TOGGLE_CMD 0
-#define OUTPUT_USB_CMD 1
-#define OUTPUT_BLE_CMD 2
-
-#define OUT_TOG OUTPUT_TOGGLE_CMD
-#define OUT_USB OUTPUT_USB_CMD
-#define OUT_BLE OUTPUT_BLE_CMD \ No newline at end of file
+#define OUT_TOG 0
+#define OUT_USB 1
+#define OUT_BLE 2 \ No newline at end of file
diff --git a/app/src/behaviors/behavior_outputs.c b/app/src/behaviors/behavior_outputs.c
index 0e7ac490c9..e5182bd4f4 100644
--- a/app/src/behaviors/behavior_outputs.c
+++ b/app/src/behaviors/behavior_outputs.c
@@ -21,11 +21,11 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
static int on_keymap_binding_pressed(struct zmk_behavior_binding *binding,
struct zmk_behavior_binding_event event) {
switch (binding->param1) {
- case OUTPUT_TOGGLE_CMD:
+ case OUT_TOG:
return zmk_endpoints_toggle();
- case OUTPUT_USB_CMD:
+ case OUT_USB:
return zmk_endpoints_select(ZMK_ENDPOINT_USB);
- case OUTPUT_BLE_CMD:
+ case OUT_BLE:
return zmk_endpoints_select(ZMK_ENDPOINT_BLE);
default:
LOG_ERR("Unknown output command: %d", binding->param1);