From 05b0d185a8c8c4eb19f63968e54f859a0f3e6484 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Sat, 19 Dec 2020 17:32:40 +0000 Subject: [PATCH] refactor(app): replace zmk_mod with zmk_mod_t Aligns with typedef _t convention. PR: #531 --- app/include/zmk/hid.h | 4 ++-- app/include/zmk/keys.h | 2 +- app/src/hid.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/include/zmk/hid.h b/app/include/zmk/hid.h index c664082e..a2a4bf59 100644 --- a/app/include/zmk/hid.h +++ b/app/include/zmk/hid.h @@ -166,8 +166,8 @@ struct zmk_hid_consumer_report { struct zmk_hid_consumer_report_body body; } __packed; -int zmk_hid_register_mod(zmk_mod modifier); -int zmk_hid_unregister_mod(zmk_mod modifier); +int zmk_hid_register_mod(zmk_mod_t modifier); +int zmk_hid_unregister_mod(zmk_mod_t modifier); int zmk_hid_implicit_modifiers_press(zmk_mod_flags implicit_modifiers); int zmk_hid_implicit_modifiers_release(); int zmk_hid_keyboard_press(zmk_key_t key); diff --git a/app/include/zmk/keys.h b/app/include/zmk/keys.h index 330f0adb..8e372ff8 100644 --- a/app/include/zmk/keys.h +++ b/app/include/zmk/keys.h @@ -10,7 +10,7 @@ #include typedef uint32_t zmk_key_t; -typedef uint8_t zmk_mod; +typedef uint8_t zmk_mod_t; typedef uint8_t zmk_mod_flags; struct zmk_key_event { diff --git a/app/src/hid.c b/app/src/hid.c index 50166c43..de853d84 100644 --- a/app/src/hid.c +++ b/app/src/hid.c @@ -26,7 +26,7 @@ static zmk_mod_flags explicit_modifiers = 0; LOG_DBG("Modifiers set to 0x%02X", keyboard_report.body.modifiers); \ } -int zmk_hid_register_mod(zmk_mod modifier) { +int zmk_hid_register_mod(zmk_mod_t modifier) { explicit_modifier_counts[modifier]++; LOG_DBG("Modifier %d count %d", modifier, explicit_modifier_counts[modifier]); WRITE_BIT(explicit_modifiers, modifier, true); @@ -34,7 +34,7 @@ int zmk_hid_register_mod(zmk_mod modifier) { return 0; } -int zmk_hid_unregister_mod(zmk_mod modifier) { +int zmk_hid_unregister_mod(zmk_mod_t modifier) { if (explicit_modifier_counts[modifier] <= 0) { LOG_ERR("Tried to unregister modifier %d too often", modifier); return -EINVAL;