Commit graph

55 commits

Author SHA1 Message Date
David Madison
2120adf283 Refactor button index function names
It's not really fair to refer to the main index function as "legacy" if it's actively being used. All controller-specific 'get' filtering functions are now appended with the name of the controller rather than having it in the middle.
2021-03-27 08:44:20 -04:00
David Madison
57afaefd2c Check direct enum comparisons by index
To not break support for users who used the "wrong" control enumeration for that controller, but had their program work because the "wrong" enum used the same ID.
2021-03-27 07:31:37 -04:00
David Madison
26c66f455e Remove shared identifiers in ButtonEnum
Move shared button identifiers from enum to an inline function, so formerly shared identifiers can be separately filtered and processed on a class-by-class basis.

Fixes #611.
2021-03-27 06:51:01 -04:00
Andrew J. Kroll
f948ffccba clean up annoying bogus warnings 2017-12-01 10:43:31 -05:00
Kristian Sloth Lauszus
42948831ce Explicit cast millis() and micros() to uint32_t, as it is uint64_t on the Arduino 101 2017-02-12 16:58:14 +01:00
Kristian Sloth Lauszus
6fb48f48e4 Fix millis() and micros() rollover bug
Also replace long with int32_t, so it is not architecture dependent
2017-02-12 15:10:07 +01:00
Matt Sieren
51cb078fa0 Exclude specific enum defines and cast
The unscoped Enum for the Controller LEDs is colliding
with changes in the recent RedBearLab nRF51288 SDK, specifically
the PinName enum in the mbed.h header file.
As a simple RBL/mBed specific work-around we are now casting
the LED enums into the USBH LEDEnum enum.

This will potentially break support for controllers on RBL,
but restore the ability to compile the project.
2016-03-18 22:42:23 +01:00
Kristian Sloth Lauszus
fb723fcbb0 Don't set epAttribs to 0, as this will set bmNakPower to 0 as well. Instead set bmSndToggle and bmRcvToggle explicit to 0.
Fixes: #184
2015-11-18 00:11:33 +01:00
Kristian Lauszus
bde11036a9 Endpoints types where already defined in usb_ch9.h, so no need to redefine them 2014-09-02 00:16:48 -07:00
Kristian Lauszus
e986282fa5 Forgot to call setLedRaw with the controller as the second argument in setLedOn 2014-04-28 22:01:38 +02:00
Kristian Lauszus
257c96f5c1 Can now turn LED off by calling setLedOn(OFF) for all controllers
Also renamed all enums, so they does not conflict with user code that easily
2014-01-04 13:43:49 +01:00
Kristian Lauszus
ec38c78799 Added support for Joytech controller in XBOXRECV and Madcatz controllers in XBOXUSB 2013-12-30 16:48:15 +01:00
Andrew J. Kroll
f1af9b08ec Janitorial, whitespace fixes. No new code. 2013-12-25 05:09:57 -05:00
Kristian Lauszus
35e8bb2dbf Removed unused code 2013-12-21 13:39:47 +01:00
Andrew J. Kroll
5785115cdb Type fixes, new debug macro, debug bug fixes. 2013-12-18 15:18:28 -05:00
Kristian Lauszus
4f738d3ef9 Removed some unused code 2013-12-06 22:59:12 +01:00
Kristian Lauszus
16f124d596 Removed unused code 2013-12-05 07:40:07 +01:00
Andrew J. Kroll
6d927d8cd3 Remove unused vasriable and setting 2013-12-04 22:41:13 -05:00
Andrew J. Kroll
95d133b919 Merge 2013-12-04 18:51:06 -05:00
Andrew J. Kroll
e18eb57752 fix all warnings for ARM, fix a few small bugs 2013-12-04 18:40:23 -05:00
Kristian Lauszus
764e74c94c Can now disconnect a wireless controller 2013-11-11 00:43:18 +01:00
Kristian Lauszus
52858d502b Added delay before bus reset and renamed some variables and cleanup example 2013-11-11 00:38:56 +01:00
Kristian Lauszus
859c9d0f80 Implemented ConfigureDevice, so receiver can be plugged in and out without problems 2013-11-11 00:10:39 +01:00
Kristian Sloth Lauszus
6039f1af4b Xbox libraries doesn't collide anymore
PIDs for original Xbox controller is from: acdb37c361/drivers/input/joystick/xpad.c (L119)
2013-07-18 18:21:44 +02:00
Kristian Sloth Lauszus
2ce56b0968 Merge branch 'master' into xxxajk
Conflicts:
	PS3USB.cpp
2013-07-16 17:07:25 +02:00
Kristian Sloth Lauszus
b957f5f4dc Added delay after setting address 2013-07-15 19:34:56 +02:00
Kristian Sloth Lauszus
8c3424cf28 Forgot else if 2013-07-14 16:44:53 +02:00
Kristian Sloth Lauszus
2dc817f84a Added attachOnInit
This will allow the user to call a function when the controller is initialized
2013-07-14 00:43:35 +02:00
Andrew J. Kroll
e01df49bf3 refactor entire library for hex printing 2013-06-17 15:37:09 -04:00
Oleg Mazurov
261e5f1bd2 commit 2013-06-11 21:11:43 -06:00
Oleg Mazurov
7d981b4361 Merge branch 'xxxajk' into premerge 2013-06-06 17:19:26 -06:00
Kristian Sloth Lauszus
cd30acf362 Forgot to update calls to setLedRaw 2013-05-17 00:37:59 +02:00
Andrew J. Kroll
f1e01dbaab merge with head 2013-05-16 17:03:44 -04:00
Andrew J. Kroll
814c2baf55 debugging macro fixes 2013-05-16 16:43:51 -04:00
Kristian Sloth Lauszus
216fce8d95 Controller is default 0
This will ensure compatible with the other controllers
2013-05-16 22:41:52 +02:00
Kristian Sloth Lauszus
48b3ed93f5 Removed all direct calls to serial.print 2013-04-26 23:50:39 +02:00
Kristian Sloth Lauszus
78cb524bcf Fixed bug in getButtonPress 2013-04-15 18:37:24 +02:00
Kristian Sloth Lauszus
d20d360695 Fixed indent 2013-04-01 03:05:37 +02:00
Kristian Sloth Lauszus
7e8564867a Don't return battery level in percentage 2013-03-30 16:25:28 +01:00
Andrew J. Kroll
5ec8889fa3 Unify a bunch of debug fail messages to a single point. More needed. 2013-03-30 10:29:16 -04:00
Andrew J. Kroll
904f2ff25a Clean up code formatting to industry standards. 2013-03-28 04:46:43 -04:00
Andrew J. Kroll
9b224b9899 port debugging of new files, need to eliminate all serial.print yet. 2013-03-28 04:37:09 -04:00
Kristian Sloth Lauszus
34de3a4315 Fixed conflict with PS3Enums.h 2013-02-17 18:12:05 +01:00
Kristian Sloth Lauszus
8ca3ab8fd1 Updated XBOXUSB library so it doesn't conflict with the other libraries 2013-02-17 01:03:32 +01:00
Kristian Sloth Lauszus
355ca892eb Added support for Wii U Pro Controller 2013-02-02 22:14:01 +01:00
Kristian Sloth Lauszus
a96c3c4633 Now the XBOXRECV doesn't conflict as well
Also hci_handle is reset when you disconnect
2013-01-28 00:55:01 +01:00
Kristian Sloth Lauszus
6598bca58a Added #ifdef several places 2013-01-19 15:43:28 +01:00
Kristian Sloth Lauszus
4c2a97e424 Added buttonChanged 2013-01-08 08:16:01 +01:00
Kristian Sloth Lauszus
15d8cf1660 getBatteryLevel and some other improvement by timstamp.co.uk 2013-01-06 03:43:03 +01:00
Kristian Sloth Lauszus
1798f9b338 Another fix for multiple controllers 2013-01-04 00:19:07 +01:00