We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4b763f commit d635a06Copy full SHA for d635a06
src/joystick/hidapi/SDL_hidapi_switch2.c
@@ -425,6 +425,15 @@ static bool HIDAPI_DriverSwitch2_InitUSB(SDL_HIDAPI_Device *device)
425
426
unsigned char calibration_data[0x40] = {0};
427
428
+ res = ReadFlashBlock(ctx, 0x13000, calibration_data);
429
+ if (res < 0) {
430
+ SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, "Couldn't read serial number: %d", res);
431
+ } else {
432
+ char serial[0x11] = {0};
433
+ SDL_strlcpy(serial, (char*)&calibration_data[2], sizeof(serial));
434
+ HIDAPI_SetDeviceSerial(device, serial);
435
+ }
436
+
437
res = ReadFlashBlock(ctx, 0x13080, calibration_data);
438
if (res < 0) {
439
SDL_LogWarn(SDL_LOG_CATEGORY_INPUT, "Couldn't read factory calibration data: %d", res);
0 commit comments