Skip to content

Commit

Permalink
Avoid timers cross-referencing
Browse files Browse the repository at this point in the history
  • Loading branch information
NeroReflex committed Jan 15, 2024
1 parent 75c19ea commit 288a1bc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions rog_ally.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,8 +1166,11 @@ static void rc71l_timer_xbox360(
uint64_t expired,
void* user_data
) {
rc71l_xbox360_user_data_t *const xbox360_data = (rc71l_xbox360_user_data_t*)user_data;

if (strcmp(timer_name, "RC71L_timer") != 0) {
return;
}

rc71l_xbox360_user_data_t *const xbox360_data = (rc71l_xbox360_user_data_t*)user_data;

if (conf->rumble_on_mode_switch) {
if (xbox360_data->accounted_mode_switches != xbox360_data->mode_switched) {
Expand Down Expand Up @@ -1336,7 +1339,10 @@ static void rc71l_hidraw_timer(
uint64_t expired,
void* user_data
) {
// one tick is 60ms
// one tick is 60ms, avoid all other timers
if (strcmp(timer_name, "RC71L_timer") != 0) {
return;
}

rc71l_asus_hidraw_user_data_t *const hidraw_data = (rc71l_asus_hidraw_user_data_t*)user_data;
if (hidraw_data == NULL) {
Expand Down Expand Up @@ -2016,6 +2022,7 @@ input_dev_t timer_dev = {
.timer = {
.name = "RC71L_timer",
.ticktime_ms = 60,
.ticktime_ns = 0,
}
},
.user_data = &timer_user_data,
Expand Down

0 comments on commit 288a1bc

Please sign in to comment.