forked from kofal.net/zmk
refactor(hold-tap): improve switch statements
This commit is contained in:
committed by
Pete Johanson
parent
9c4c266b17
commit
62ae157c0b
@@ -278,9 +278,10 @@ static inline const char *flavor_str(enum flavor flavor) {
|
|||||||
return "balanced";
|
return "balanced";
|
||||||
case FLAVOR_TAP_PREFERRED:
|
case FLAVOR_TAP_PREFERRED:
|
||||||
return "tap-preferred";
|
return "tap-preferred";
|
||||||
}
|
default:
|
||||||
return "UNKNOWN FLAVOR";
|
return "UNKNOWN FLAVOR";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline const char *status_str(enum status status) {
|
static inline const char *status_str(enum status status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
@@ -292,9 +293,10 @@ static inline const char *status_str(enum status status) {
|
|||||||
return "hold-interrupt";
|
return "hold-interrupt";
|
||||||
case STATUS_TAP:
|
case STATUS_TAP:
|
||||||
return "tap";
|
return "tap";
|
||||||
}
|
default:
|
||||||
return "UNKNOWN STATUS";
|
return "UNKNOWN STATUS";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline const char *decision_moment_str(enum decision_moment decision_moment) {
|
static inline const char *decision_moment_str(enum decision_moment decision_moment) {
|
||||||
switch (decision_moment) {
|
switch (decision_moment) {
|
||||||
@@ -308,9 +310,10 @@ static inline const char *decision_moment_str(enum decision_moment decision_mome
|
|||||||
return "quick-tap";
|
return "quick-tap";
|
||||||
case HT_TIMER_EVENT:
|
case HT_TIMER_EVENT:
|
||||||
return "timer";
|
return "timer";
|
||||||
}
|
default:
|
||||||
return "UNKNOWN STATUS";
|
return "UNKNOWN STATUS";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int press_binding(struct active_hold_tap *hold_tap) {
|
static int press_binding(struct active_hold_tap *hold_tap) {
|
||||||
struct zmk_behavior_binding_event event = {
|
struct zmk_behavior_binding_event event = {
|
||||||
|
|||||||
Reference in New Issue
Block a user