Add true 10- and 16-bit joystick modes (#2276)

Fixes #2275

Adds `Joystick.use10bit` and `Joystick.use16bit` methods.  10-bit is
unsigned from 0...1023 while 16-bit is signed -32767..32767.
Defines a new HID descriptor to support the increased resolution.
This commit was merged in pull request #2276.
This commit is contained in:
Earle F. Philhower, III
2024-07-18 16:07:29 -07:00
committed by GitHub
parent 372fef06e1
commit bd902a93f5
8 changed files with 78 additions and 12 deletions
+2 -2
View File
@@ -68,10 +68,10 @@ void KeyboardBLE_::sendReport(KeyReport* keys) {
memcpy(data.keycode, keys->keys, sizeof(data.keycode));
//stitch in report id
static uint8_t report[sizeof(hid_keyboard_report_t) +1];
static uint8_t report[sizeof(hid_keyboard_report_t) + 1];
report[0] = __BLEGetKeyboardReportID();
memcpy(&report[1], (uint8_t*)&data, sizeof(hid_keyboard_report_t));
PicoBluetoothBLEHID.send(&report, sizeof(hid_keyboard_report_t) +1);
PicoBluetoothBLEHID.send(&report, sizeof(hid_keyboard_report_t) + 1);
}
void KeyboardBLE_::sendConsumerReport(uint16_t key) {