Closed juan518munoz closed 5 months ago
your sketch is incomplete... how are you printing idx
?
also, you should check return value... if it idx < 0
it is an error
Sorry, I was working with two code editors side by side and passed the wrong one, it's now updated.
I never got a -1
signaling an error.
again, your sketch is incomplete. I strongly suggest that you paste a complete sketch... something that compiles and reproduce the error. don't just copy & paste parts of it.
for example, I don't know what get_connected_device_idx()
is.
Sent the wrong snipped again, sorry, It was late and instead of focusing on what I was doing, I wanted to get it done. I've updated the sketch. Please let me know if something else is needed.
thanks. ouch... that was a nasty bug.
fixed.
What happened?
Running example program, inside
static void my_platform_on_controller_data(uni_hid_device_t* d, uni_controller_t* ctl)
I've set a variable to get the index of each connected gamepad, all report to zero.Bluepad32 Version
Latest
Bluepad32 version custom
Develop branch
Bluepad32 Platform
Other
Platform version
Pico W
Controller
Joycons, Xbox Series controller
ESP32 chip
None, Raspberry Pi pico W
OS
Linux
Relevant log output
Relevant sketch
develop branch
.static void my_platform_on_controller_data(uni_hid_device_t* d, uni_controller_t* ctl)
, add the following two lines at the beginning:0
.