Skip to content

Commit

Permalink
Add more axes and buttons to XAC/Flex mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jfedor2 committed Oct 17, 2024
1 parent c9d16d0 commit 309ce8c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions firmware/src/our_descriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,15 @@ uint8_t const our_report_descriptor_xac_compat[] = {
0x09, 0x30, // Usage (X)
0x09, 0x31, // Usage (Y)
0x09, 0x32, // Usage (Z)
0x09, 0x33, // Usage (Rx)
0x09, 0x34, // Usage (Ry)
0x09, 0x35, // Usage (Rz)
0x09, 0x36, // Usage (Slider)
0x09, 0x37, // Usage (Dial)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8)
0x95, 0x04, // Report Count (4)
0x95, 0x08, // Report Count (8)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0x39, // Usage (Hat switch)
0x15, 0x00, // Logical Minimum (0)
Expand All @@ -512,11 +516,11 @@ uint8_t const our_report_descriptor_xac_compat[] = {
0x45, 0x00, // Physical Maximum (0)
0x05, 0x09, // Usage Page (Button)
0x19, 0x01, // Usage Minimum (0x01)
0x29, 0x0C, // Usage Maximum (0x0C)
0x29, 0x3C, // Usage Maximum (0x3C)
0x15, 0x00, // Logical Minimum (0)
0x25, 0x01, // Logical Maximum (1)
0x75, 0x01, // Report Size (1)
0x95, 0x0C, // Report Count (12)
0x95, 0x3C, // Report Count (60)
0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0, // End Collection
};
Expand Down Expand Up @@ -555,7 +559,7 @@ void stadia_clear_report(uint8_t* report, uint8_t report_id, uint16_t len) {
memcpy(report, stadia_neutral, sizeof(stadia_neutral));
}

static const uint8_t xac_compat_neutral[] = { 0x80, 0x80, 0x80, 0x80, 0x08, 0x00 };
static const uint8_t xac_compat_neutral[] = { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

void xac_compat_clear_report(uint8_t* report, uint8_t report_id, uint16_t len) {
memcpy(report, xac_compat_neutral, sizeof(xac_compat_neutral));
Expand Down

0 comments on commit 309ce8c

Please sign in to comment.