1
0
Fork 0

Works with returning 12 bit as expected

Signed-off-by: fly <merspieler@alwaysdata.com>
This commit is contained in:
fly 2024-04-11 03:20:55 +02:00
parent 7bdc627898
commit 0bdb9ab4ec
2 changed files with 29 additions and 29 deletions

View file

@ -16,33 +16,33 @@ use usbd_human_interface_device::{
// Generated using Waratah
#[rustfmt::skip]
pub const CUSTOM_DESCRIPTOR: &[u8] = &[
0x05, 0x01, // UsagePage(Generic Desktop[0x0001])
0x09, 0x04, // UsageId(Joystick[0x0004])
0xA1, 0x01, // Collection(Application)
0x09, 0x01, // UsageId(Pointer[0x0001])
0xA1, 0x00, // Collection(Physical)
0x09, 0x30, // UsageId(X[0x0030])
0x09, 0x32, // UsageId(Z[0x0032])
0x15, 0x00, // LogicalMinimum(0)
0x27, 0xFF, 0xFF, 0x00, 0x00, // LogicalMaximum(65,535)
0x95, 0x02, // ReportCount(2)
0x75, 0x10, // ReportSize(16)
0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField)
0xC0, // EndCollection()
0x05, 0x09, // UsagePage(Button[0x0009])
0x19, 0x01, // UsageIdMin(Button 1[0x0001])
0x29, 0x10, // UsageIdMax(Button 16[0x0010])
0x25, 0x01, // LogicalMaximum(1)
0x95, 0x10, // ReportCount(16)
0x75, 0x01, // ReportSize(1)
0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField)
0x05, 0x0E, // UsagePage(Haptics[0x000E])
0x09, 0x21, // UsageId(Manual Trigger[0x0021])
0x26, 0xFF, 0x00, // LogicalMaximum(255)
0x95, 0x01, // ReportCount(1)
0x75, 0x08, // ReportSize(8)
0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField)
0xC0, // EndCollection()
0x05, 0x01, // UsagePage(Generic Desktop[0x0001])
0x09, 0x04, // UsageId(Joystick[0x0004])
0xA1, 0x01, // Collection(Application)
0x09, 0x01, // UsageId(Pointer[0x0001])
0xA1, 0x00, // Collection(Physical)
0x09, 0x30, // UsageId(X[0x0030])
0x09, 0x32, // UsageId(Z[0x0032])
0x15, 0x00, // LogicalMinimum(0)
0x26, 0xFF, 0x0F, // LogicalMaximum(4,095)
0x95, 0x02, // ReportCount(2)
0x75, 0x10, // ReportSize(16)
0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField)
0xC0, // EndCollection()
0x05, 0x09, // UsagePage(Button[0x0009])
0x19, 0x01, // UsageIdMin(Button 1[0x0001])
0x29, 0x10, // UsageIdMax(Button 16[0x0010])
0x25, 0x01, // LogicalMaximum(1)
0x95, 0x10, // ReportCount(16)
0x75, 0x01, // ReportSize(1)
0x81, 0x02, // Input(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, BitField)
0x05, 0x0E, // UsagePage(Haptics[0x000E])
0x09, 0x21, // UsageId(Manual Trigger[0x0021])
0x26, 0xFF, 0x00, // LogicalMaximum(255)
0x95, 0x01, // ReportCount(1)
0x75, 0x08, // ReportSize(8)
0x91, 0x02, // Output(Data, Variable, Absolute, NoWrap, Linear, PreferredState, NoNullPosition, NonVolatile, BitField)
0xC0, // EndCollection()
];
#[derive(Clone, Copy, Debug, Eq, PartialEq, Default, PackedStruct)]

View file

@ -137,8 +137,8 @@ fn get_report(pins: &mut MyPins, adc1: &mut adc::Adc<pac::ADC1>) -> CustomInputR
CustomInputReport {
x: retX.into(),
y: retY.into(),
x: integLT.into(),
y: floodLT.into(),
buttons,
}
}