diff options
author | innovaker <66737976+innovaker@users.noreply.github.com> | 2020-12-02 16:41:57 +0000 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-12-14 12:41:25 -0500 |
commit | bac1f17cf6ce225876dc7b6b2a809bcd98010391 (patch) | |
tree | 9783743b31fdadd66d1b3c9e5a3e14dc661ec313 /app/src/behaviors/behavior_hold_tap.c | |
parent | a4652fa25da83ae036613157fb566eb1ce1426fe (diff) |
refactor(app): replace Zephyr integer types with C99 integer types
u8_t → uint8_t
u16_t → uint16_t
u32_t → uint32_t
u64_t → uint64_t
s8_t → int8_t
s16_t → int16_t
s32_t → int32_t
s64_t → int64_t
Prerequisite for #223
See: https://github.com/zephyrproject-rtos/zephyr/releases/tag/zephyr-v2.4.0
PR: #467
Diffstat (limited to 'app/src/behaviors/behavior_hold_tap.c')
-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 1dc665d..50a9606 100644 --- a/app/src/behaviors/behavior_hold_tap.c +++ b/app/src/behaviors/behavior_hold_tap.c @@ -49,11 +49,11 @@ struct behavior_hold_tap_config { // this data is specific for each hold-tap struct active_hold_tap { - s32_t position; + int32_t position; // todo: move these params into the config->behaviors->tap and - u32_t param_hold; - u32_t param_tap; - s64_t timestamp; + uint32_t param_hold; + uint32_t param_tap; + int64_t timestamp; bool is_decided; bool is_hold; const struct behavior_hold_tap_config *config; @@ -81,7 +81,7 @@ static int capture_event(const struct zmk_event_header *event) { return -ENOMEM; } -static struct position_state_changed *find_captured_keydown_event(u32_t position) { +static struct position_state_changed *find_captured_keydown_event(uint32_t position) { struct position_state_changed *last_match = NULL; for (int i = 0; i < ZMK_BHV_HOLD_TAP_MAX_CAPTURED_EVENTS; i++) { const struct zmk_event_header *eh = captured_events[i]; @@ -155,7 +155,7 @@ static void release_captured_events() { } } -static struct active_hold_tap *find_hold_tap(u32_t position) { +static struct active_hold_tap *find_hold_tap(uint32_t position) { for (int i = 0; i < ZMK_BHV_HOLD_TAP_MAX_HELD; i++) { if (active_hold_taps[i].position == position) { return &active_hold_taps[i]; @@ -164,8 +164,8 @@ static struct active_hold_tap *find_hold_tap(u32_t position) { return NULL; } -static struct active_hold_tap *store_hold_tap(u32_t position, u32_t param_hold, u32_t param_tap, - s64_t timestamp, +static struct active_hold_tap *store_hold_tap(uint32_t position, uint32_t param_hold, + uint32_t param_tap, int64_t timestamp, const struct behavior_hold_tap_config *config) { for (int i = 0; i < ZMK_BHV_HOLD_TAP_MAX_HELD; i++) { if (active_hold_taps[i].position != ZMK_BHV_HOLD_TAP_POSITION_NOT_USED) { @@ -326,7 +326,7 @@ static int on_hold_tap_binding_pressed(struct zmk_behavior_binding *binding, // if this behavior was queued we have to adjust the timer to only // wait for the remaining time. - s32_t tapping_term_ms_left = (hold_tap->timestamp + cfg->tapping_term_ms) - k_uptime_get(); + int32_t tapping_term_ms_left = (hold_tap->timestamp + cfg->tapping_term_ms) - k_uptime_get(); if (tapping_term_ms_left > 0) { k_delayed_work_submit(&hold_tap->work, K_MSEC(tapping_term_ms_left)); } |