Skip to content

Commit 08dfe4a

Browse files
committed
Fix second slider
1 parent 4a44259 commit 08dfe4a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

radio/src/targets/common/arm/stm32/usb_driver.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,16 @@ void usbJoystickUpdate()
180180
if (USBD_HID_SendReport(&USB_OTG_dev, 0, 0) == USBD_OK) {
181181
#endif
182182

183-
// 8 analog values
183+
// 4 axes
184184
for (int i = 0; i < 8; ++i) {
185185
int16_t value = channelOutputs[i] + 1024;
186186
if ( value > 2047 ) value = 2047;
187187
else if ( value < 0 ) value = 0;
188188
HID_Buffer[i*2 + 0] = uint8_t(value);
189189
HID_Buffer[i*2 + 1] = uint8_t(value >> 8);
190190
}
191+
// 2 sliders
192+
// 4 switches
191193

192194
// buttons
193195
HID_Buffer[8*2+1] = 0;

radio/src/targets/common/arm/stm32/usbd_hid_joystick.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ __ALIGN_BEGIN static const uint8_t HID_JOYSTICK_ReportDesc[] __ALIGN_END =
122122
0x09, 0x34, // USAGE (Ry)
123123
0x09, 0x35, // USAGE (Rz)
124124
0x09, 0x36, // USAGE (Slider)
125-
0x09, 0x36, // USAGE (Slider)
125+
0x09, 0x37, // USAGE (Slider)
126126
0x16, 0x00, 0x00, // LOGICAL_MINIMUM (0)
127127
0x26, 0xFF, 0x07, // LOGICAL_MAXIMUM (2047)
128128
0x75, 0x10, // REPORT_SIZE (16)

0 commit comments

Comments
 (0)