From 2df225fc1c534879dadce4e0880b2cccded23c7e Mon Sep 17 00:00:00 2001 From: Gerald Schnabel Date: Sun, 17 Mar 2019 00:22:33 +0100 Subject: [PATCH] Update current joystick status in OSD USB status screen --- usb/hid.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/usb/hid.c b/usb/hid.c index f95378a..e778ac9 100644 --- a/usb/hid.c +++ b/usb/hid.c @@ -464,6 +464,8 @@ static uint8_t usb_hid_release(usb_device_t *dev) { hid_debugf("decreasing jindex of dev #%d from %d to %d", j, dev[j].hid_info.iface[k].jindex, dev[j].hid_info.iface[k].jindex-1); dev[j].hid_info.iface[k].jindex--; + StateUsbIdSet( dev[j].hid_info.iface[k].conf.vid, dev[j].hid_info.iface[k].conf.pid, dev[j].hid_info.iface[k].conf.joystick_mouse.button_count, dev[j].hid_info.iface[k].jindex); + } } } @@ -472,6 +474,10 @@ static uint8_t usb_hid_release(usb_device_t *dev) { // one less joystick in the system ... joysticks--; StateNumJoysticksSet(joysticks); + if (joysticks < 2) + StateUsbIdSet(0, 0, 0, 1); + if (joysticks < 1) + StateUsbIdSet(0, 0, 0, 0); } }