From 46844347c4f4b5f8b50ea22dd06c7555a86fc94b Mon Sep 17 00:00:00 2001 From: Kasimir Pihlasviita Date: Mon, 3 Apr 2023 08:38:44 +0300 Subject: Fix OSMs getting stuck (#20034) --- quantum/action_util.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'quantum/action_util.c') diff --git a/quantum/action_util.c b/quantum/action_util.c index 7f7d32887b..034c2ecaae 100644 --- a/quantum/action_util.c +++ b/quantum/action_util.c @@ -46,6 +46,12 @@ static uint8_t oneshot_locked_mods = 0; uint8_t get_oneshot_locked_mods(void) { return oneshot_locked_mods; } +void add_oneshot_locked_mods(uint8_t mods) { + if ((oneshot_locked_mods & mods) != mods) { + oneshot_locked_mods |= mods; + oneshot_locked_mods_changed_kb(oneshot_locked_mods); + } +} void set_oneshot_locked_mods(uint8_t mods) { if (mods != oneshot_locked_mods) { oneshot_locked_mods = mods; @@ -58,6 +64,12 @@ void clear_oneshot_locked_mods(void) { oneshot_locked_mods_changed_kb(oneshot_locked_mods); } } +void del_oneshot_locked_mods(uint8_t mods) { + if (oneshot_locked_mods & mods) { + oneshot_locked_mods &= ~mods; + oneshot_locked_mods_changed_kb(oneshot_locked_mods); + } +} # if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0)) static uint16_t oneshot_time = 0; bool has_oneshot_mods_timed_out(void) { -- cgit v1.2.3 From 150219318198af40f7e10f375f7808a63bf5a2ee Mon Sep 17 00:00:00 2001 From: Manuel Ullmann Date: Wed, 12 Apr 2023 14:24:07 +0000 Subject: quantum/action_util.c: Use uint8_t for oneshot_layer_data (#20423) --- quantum/action_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'quantum/action_util.c') diff --git a/quantum/action_util.c b/quantum/action_util.c index 034c2ecaae..361f410d2d 100644 --- a/quantum/action_util.c +++ b/quantum/action_util.c @@ -90,7 +90,7 @@ bool has_oneshot_mods_timed_out(void) { * L => are layer bits * S => oneshot state bits */ -static int8_t oneshot_layer_data = 0; +static uint8_t oneshot_layer_data = 0; inline uint8_t get_oneshot_layer(void) { return oneshot_layer_data >> 3; -- cgit v1.2.3