diff options
author | Okke Formsma <okke@formsma.nl> | 2021-02-09 21:02:38 +0100 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2021-02-24 07:24:27 -0500 |
commit | 6b7026cdd1ed472941339c9e5a69a17d541e6661 (patch) | |
tree | 0af6d9483f6b4535d12010f29703303241ac6c2c | |
parent | 57661362ea3deee3cd2c4cc7e25b8e4cd4b49f1d (diff) |
refactor(hold-tap): simplify flavor enum
-rw-r--r-- | app/src/behaviors/behavior_hold_tap.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/src/behaviors/behavior_hold_tap.c b/app/src/behaviors/behavior_hold_tap.c index ab25c3c..ad604e7 100644 --- a/app/src/behaviors/behavior_hold_tap.c +++ b/app/src/behaviors/behavior_hold_tap.c @@ -31,9 +31,9 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #define ZMK_BHV_HOLD_TAP_POSITION_NOT_USED 9999 enum flavor { - ZMK_BHV_HOLD_TAP_FLAVOR_HOLD_PREFERRED = 0, - ZMK_BHV_HOLD_TAP_FLAVOR_BALANCED = 1, - ZMK_BHV_HOLD_TAP_FLAVOR_TAP_PREFERRED = 2, + FLAVOR_HOLD_PREFERRED, + FLAVOR_BALANCED, + FLAVOR_TAP_PREFERRED, }; struct behavior_hold_tap_config { @@ -273,11 +273,11 @@ static void decide_hold_preferred(struct active_hold_tap *hold_tap, enum decisio static inline char *flavor_str(enum flavor flavor) { switch (flavor) { - case ZMK_BHV_HOLD_TAP_FLAVOR_HOLD_PREFERRED: + case FLAVOR_HOLD_PREFERRED: return "hold-preferred"; - case ZMK_BHV_HOLD_TAP_FLAVOR_BALANCED: + case FLAVOR_BALANCED: return "balanced"; - case ZMK_BHV_HOLD_TAP_FLAVOR_TAP_PREFERRED: + case FLAVOR_TAP_PREFERRED: return "tap-preferred"; } return "UNKNOWN FLAVOR"; @@ -294,11 +294,11 @@ static void decide_hold_tap(struct active_hold_tap *hold_tap, enum decision_mome } switch (hold_tap->config->flavor) { - case ZMK_BHV_HOLD_TAP_FLAVOR_HOLD_PREFERRED: + case FLAVOR_HOLD_PREFERRED: decide_hold_preferred(hold_tap, event_type); - case ZMK_BHV_HOLD_TAP_FLAVOR_BALANCED: + case FLAVOR_BALANCED: decide_balanced(hold_tap, event_type); - case ZMK_BHV_HOLD_TAP_FLAVOR_TAP_PREFERRED: + case FLAVOR_TAP_PREFERRED: decide_tap_preferred(hold_tap, event_type); } |