From 09e6ba667779aa050a6cd55ba16f4e607c265511 Mon Sep 17 00:00:00 2001 From: Mathieu Laurendeau Date: Sun, 10 Jun 2018 22:01:27 +0200 Subject: [PATCH] Rumble not working #569 --- core/config.c | 2 +- core/haptic/source/haptic_source_rumble.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/config.c b/core/config.c index bb0db39e..6fb5a37d 100644 --- a/core/config.c +++ b/core/config.c @@ -353,7 +353,7 @@ void cfg_process_rumble() if(joystick_rumble[i].active || active) { - GE_Event haptic = { .jrumble = { .type = GE_HAPTIC_RUMBLE, .which = i, .weak = weak, .strong = strong } }; + GE_Event haptic = { .jrumble = { .type = GE_JOYRUMBLE, .which = i, .weak = weak, .strong = strong } }; ginput_joystick_set_haptic(&haptic); } diff --git a/core/haptic/source/haptic_source_rumble.c b/core/haptic/source/haptic_source_rumble.c index fcd183f9..7ae88a5a 100644 --- a/core/haptic/source/haptic_source_rumble.c +++ b/core/haptic/source/haptic_source_rumble.c @@ -61,10 +61,11 @@ static void haptic_source_rumble_process(struct haptic_source_state * state, siz uint16_t weak = data[props[state->props_index].weak] * USHRT_MAX / UCHAR_MAX; uint16_t strong = data[props[state->props_index].strong] * USHRT_MAX / UCHAR_MAX; - if (weak != state->weak && strong != state->strong) { + if (weak != state->weak || strong != state->strong) { state->updated = 1; state->weak = weak; state->strong = strong; + dprintf("> RUMBLE, weak=%hu, strong=%hu\n", weak, strong); } }