Skip to content

Commit

Permalink
FFB OS translation: effect does not stop #449
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Laurendeau committed Apr 4, 2017
1 parent cf89a67 commit 1b5f438
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/haptic/ff_conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ static int ff_conv_lg_force(int device, unsigned int index, GE_Event * event) {

s_ff_lg_force * force = &ff_lg_device[device].slots[index].ff_lg_force;

memset(event, 0x00, sizeof(*event));

switch (force->type) {
case FF_LG_FTYPE_CONSTANT:
event->type = GE_JOYCONSTANTFORCE;
Expand Down Expand Up @@ -285,7 +287,7 @@ void ff_conv_process_report(int device, const unsigned char data[FF_LG_OUTPUT_RE
break;
}
} else {
unsigned short range = 0;
unsigned short range = 0;
switch(data[1]) {
case FF_LG_EXT_CMD_WHEEL_RANGE_200_DEGREES:
range = 200;
Expand Down Expand Up @@ -316,9 +318,9 @@ int ff_conv_get_event(int device, GE_Event * event) {
s_cmd cmd = fifo_peek(ff_lg_device[device].fifo);
if (cmd.cmd) {
unsigned char index = slot_index[cmd.cmd >> 4];
int ret = ff_conv_lg_force(device, index, &ff_lg_device[device].last_event);
int ret = ff_conv_lg_force(device, index, event);
if (ret == 1) {
*event = ff_lg_device[device].last_event;
ff_lg_device[device].last_event = *event;
return 0;
}
}
Expand Down

0 comments on commit 1b5f438

Please sign in to comment.