diff --git a/README.md b/README.md index 4ebb080..c8fe69a 100644 --- a/README.md +++ b/README.md @@ -139,9 +139,10 @@ The following constants define the default values for the constructor parameters - `JOYSTICK_DEFAULT_BUTTON_COUNT` is set to `32` - `JOYSTICK_DEFAULT_HATSWITCH_COUNT` is set to `2` -### Joystick.begin(bool initAutoSendState) +### Joystick.begin(bool initAutoSendState, uint8_t timeout_ms = 2) Starts emulating a game controller connected to a computer. By default, all methods update the game controller state immediately. If `initAutoSendState` is set to `false`, the `Joystick.sendState` method must be called to update the game controller state. +The timeout_ms defines the timeout for the USB communication. ### Joystick.end() diff --git a/library.properties b/library.properties index 3cbf23e..2463cea 100644 --- a/library.properties +++ b/library.properties @@ -1,7 +1,7 @@ name=Joystick_ESP32S2 -version=0.9.4 +version=0.9.5 author=Schnoog feat. Matthew Heironimus -maintainer=Matthew Heironimus +maintainer=Schnoog sentence=Allows an ESP32S2/S3 board with USB capabilities to appear as a Joystick or Gamepad. paragraph=This library is built on the espressif/arduino-esp32 library. It can be used with or without other HID-based libraries (Mouse, Keyboard, etc.). category=Device Control diff --git a/src/Joystick_ESP32S2.cpp b/src/Joystick_ESP32S2.cpp index a2d695e..c7d737f 100644 --- a/src/Joystick_ESP32S2.cpp +++ b/src/Joystick_ESP32S2.cpp @@ -486,10 +486,10 @@ Joystick_::Joystick_( } -void Joystick_::begin(bool initAutoSendState, uint8_t intervalMs) +void Joystick_::begin(bool initAutoSendState, uint8_t timeout_ms) { HID.begin(); - _timeout_ms = intervalMs; + _timeout_ms = timeout_ms; _autoSendState = initAutoSendState; sendState(); } diff --git a/src/Joystick_ESP32S2.h b/src/Joystick_ESP32S2.h index d750253..1f89a44 100644 --- a/src/Joystick_ESP32S2.h +++ b/src/Joystick_ESP32S2.h @@ -128,7 +128,7 @@ class Joystick_: public USBHIDDevice bool includeBrake = true, bool includeSteering = true); - void begin(bool initAutoSendState = true, uint8_t interval_ms = 2); + void begin(bool initAutoSendState = true, uint8_t timeout_ms = 2); void end();