Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4ec49e commit 728f42eCopy full SHA for 728f42e
1 file changed
app/src/hid_listener.c
@@ -115,7 +115,9 @@ void mouse_timer_ref() {
115
}
116
117
void mouse_timer_unref() {
118
- mouse_timer_ref_count -= 1;
+ if (mouse_timer_ref_count > 0) {
119
+ mouse_timer_ref_count -= 1;
120
+ }
121
if (mouse_timer_ref_count == 0) {
122
k_timer_stop(&mouse_timer);
123
@@ -139,6 +141,7 @@ static int hid_listener_mouse_released(const struct zmk_mouse_state_changed *ev)
139
141
err = zmk_hid_mouse_movement_release(ev->x, ev->y);
140
142
if (err) {
143
LOG_ERR("Unable to release button");
144
+ mouse_timer_unref();
145
return err;
146
147
mouse_timer_unref();
0 commit comments