Skip to content

Commit

Permalink
Change xbox rumble behaviour
Browse files Browse the repository at this point in the history
Closes #12, closes #41
  • Loading branch information
GaryOderNichts committed Apr 5, 2022
1 parent b8d3eaf commit 73361f5
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions source/ios_pad/source/controllers/xbox_one_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,18 @@ void controllerData_xbox_one(Controller_t* controller, uint8_t* buf, uint16_t le

void controllerRumble_xbox_one(Controller_t* controller, uint8_t rumble)
{
if (rumble) {
uint8_t data[9];
data[0] = 0x03;
data[1] = RUMBLE_MOTOR_RIGHT | RUMBLE_MOTOR_LEFT; // motors
data[2] = 0; // left trigger force
data[3] = 0; // right trigger force
data[4] = 35; // left force
data[5] = 35; // right force
data[6] = 1; // duration
data[7] = 0; // delay
data[8] = 0; // loop

sendOutputData(controller->handle, data, sizeof(data));
}
uint8_t data[9];
data[0] = 0x03;
data[1] = RUMBLE_MOTOR_RIGHT | RUMBLE_MOTOR_LEFT; // motors
data[2] = 0; // left trigger force
data[3] = 0; // right trigger force
data[4] = rumble ? 35 : 0; // left force
data[5] = rumble ? 35 : 0; // right force
data[6] = 1; // duration
data[7] = 0; // delay
data[8] = 0; // loop

sendOutputData(controller->handle, data, sizeof(data));
}

void controllerDeinit_xbox_one(Controller_t* controller)
Expand Down

0 comments on commit 73361f5

Please sign in to comment.