MCPcopy Create free account
hub / github.com/dmadison/ArduinoXInput / reset

Method reset

src/XInput.cpp:560–578  ·  view source on GitHub ↗

Resets class back to initial values

Source from the content-addressed store, hash-verified

558
559// Resets class back to initial values
560void 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
580static void fillBuffer(char* buff, const char fill) {
581 uint8_t i = 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected