| 343 | } |
| 344 | |
| 345 | void XInputController::setJoystickDirect(XInputControl joy, int16_t x, int16_t y) { |
| 346 | const XInputMap_Joystick * joyData = getJoyFromEnum(joy); |
| 347 | if (joyData == nullptr) return; // Not a joystick |
| 348 | |
| 349 | if (getJoystickX(joy) != x) { |
| 350 | tx[joyData->x_low] = lowByte(x); |
| 351 | tx[joyData->x_high] = highByte(x); |
| 352 | newData = true; |
| 353 | } |
| 354 | |
| 355 | if (getJoystickY(joy) != y) { |
| 356 | tx[joyData->y_low] = lowByte(y); |
| 357 | tx[joyData->y_high] = highByte(y); |
| 358 | newData = true; |
| 359 | } |
| 360 | |
| 361 | autosend(); |
| 362 | } |
| 363 | |
| 364 | void XInputController::releaseAll() { |
| 365 | const uint8_t offset = 2; // Skip message type and packet size |
nothing calls this directly
no test coverage detected