diff --git a/logic.c b/logic.c index 583d86d..458d3c0 100644 --- a/logic.c +++ b/logic.c @@ -22,8 +22,8 @@ int logic_create(logic_t *const logic) { logic->gamepad.option = 0; logic->gamepad.share = 0; logic->gamepad.center = 0; - logic->gamepad.rfn = 0; - logic->gamepad.lfn = 0; + logic->gamepad.r4 = 0; + logic->gamepad.l4 = 0; logic->gamepad.rumble_events_count = 0; memset(logic->gamepad.gyro, 0, sizeof(logic->gamepad.gyro)); memset(logic->gamepad.accel, 0, sizeof(logic->gamepad.accel)); diff --git a/logic.h b/logic.h index f89c8e5..8789a76 100644 --- a/logic.h +++ b/logic.h @@ -36,8 +36,9 @@ typedef struct gamepad_status { uint8_t share; uint8_t center; - uint8_t rfn; - uint8_t lfn; + uint8_t l4; + uint8_t r4; + struct timeval last_gyro_motion_time; struct timeval last_accel_motion_time; diff --git a/output_dev.c b/output_dev.c index 6135420..8da4394 100644 --- a/output_dev.c +++ b/output_dev.c @@ -725,7 +725,7 @@ static void update_gs_from_ev(gamepad_status_t *const gs, message_t *const msg, (msg->data.event.ev[1].type == EV_KEY) && (msg->data.event.ev[1].code == KEY_F17) ) { - gs->rfn = msg->data.event.ev[1].value; + gs->l4 = msg->data.event.ev[1].value; } else if ( (msg->data.event.ev_count == 2) && (msg->data.event.ev[0].type == EV_MSC) && @@ -734,7 +734,7 @@ static void update_gs_from_ev(gamepad_status_t *const gs, message_t *const msg, (msg->data.event.ev[1].type == EV_KEY) && (msg->data.event.ev[1].code == KEY_F18) ) { - gs->lfn = msg->data.event.ev[1].value; + gs->r4 = msg->data.event.ev[1].value; } for (uint32_t i = 0; i < msg->data.event.ev_count; ++i) { diff --git a/virt_ds5.c b/virt_ds5.c index 21cd78b..07dbece 100644 --- a/virt_ds5.c +++ b/virt_ds5.c @@ -400,7 +400,7 @@ static int send_data(int fd, logic_t *const logic) { (gs.l3 ? 0x40 : 0x00) | (gs.r3 ? 0x80 : 0x00); - buf[10] = (gs.lfn ? 0x10 : 0x00) | (gs.rfn ? 0x20 : 0x00) | (gs.center ? 0x01 : 0x00); + buf[10] = (gs.l4 ? 0x10 : 0x00) | (gs.r4 ? 0x20 : 0x00) | (gs.center ? 0x01 : 0x00); //buf[11] = ; //buf[12] = 0x20; // [12] battery level | this is called sensor_temparature in the kernel driver but is never used...