Resets class back to initial values
| 558 | |
| 559 | // Resets class back to initial values |
| 560 | void XInputController::reset() { |
| 561 | // Reset control data (tx) |
| 562 | releaseAll(); // Clear TX buffer |
| 563 | tx[0] = 0x00; // Set tx message type |
| 564 | tx[1] = 0x14; // Set tx packet size (20) |
| 565 | |
| 566 | // Reset received data (rx) |
| 567 | player = 0; // Not connected, no player |
| 568 | memset((void*) rumble, 0x00, sizeof(rumble)); // Clear rumble values |
| 569 | ledPattern = XInputLEDPattern::Off; // No LEDs on |
| 570 | |
| 571 | // Reset rescale ranges |
| 572 | setTriggerRange(XInputMap_Trigger::range.min, XInputMap_Trigger::range.max); |
| 573 | setJoystickRange(XInputMap_Joystick::range.min, XInputMap_Joystick::range.max); |
| 574 | |
| 575 | // Clear user-set options |
| 576 | recvCallback = nullptr; |
| 577 | autoSendOption = true; |
| 578 | } |
| 579 | |
| 580 | static void fillBuffer(char* buff, const char fill) { |
| 581 | uint8_t i = 0; |
nothing calls this directly
no outgoing calls
no test coverage detected