Mirror with some correction
Dependencies: mbed FastIO FastPWM USBDevice
Diff: USBJoystick/USBJoystick.cpp
- Revision:
- 113:7330439f2ffc
- Parent:
- 108:bd5d4bd4383b
--- a/USBJoystick/USBJoystick.cpp Thu Apr 29 19:56:49 2021 +0000 +++ b/USBJoystick/USBJoystick.cpp Wed Jun 02 02:14:27 2021 +0000 @@ -251,6 +251,28 @@ return sendTO(&report, 100); } +bool USBJoystick::sendPlungerStatusVCNL4010(int filteredProxCount, int rawProxCount) +{ + HID_REPORT report; + memset(report.data, 0, sizeof(report.data)); + + // set the status bits to indicate that it's an extended + // status report for quadrature sensors + put(0, 0x87FF); + int ofs = 2; + + // write the report subtype (4) + report.data[ofs++] = 4; + + // write the filtered and raw proximity count from the sensor + put(ofs, static_cast<uint16_t>(filteredProxCount)); + put(ofs + 2, static_cast<uint16_t>(rawProxCount)); + + // send the report + report.length = reportLen; + return sendTO(&report, 100); +} + bool USBJoystick::sendPlungerPix(int &idx, int npix, const uint8_t *pix) {