From b72d05a41e10df710f6c5fce3ae209c51dce070b Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Tue, 28 May 2024 21:14:52 -0400 Subject: [PATCH] Correct Base32 representation of serial number Bump USB API to 1.1 Fix #69 --- firmware/src/mcu/samd11/usb_descriptors.c | 2 +- firmware/src/vendor.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/src/mcu/samd11/usb_descriptors.c b/firmware/src/mcu/samd11/usb_descriptors.c index 19d0e0c..ab4f515 100644 --- a/firmware/src/mcu/samd11/usb_descriptors.c +++ b/firmware/src/mcu/samd11/usb_descriptors.c @@ -161,7 +161,7 @@ static uint16_t *get_serial_number_string_descriptor(void) } bits_left -= 5; int index = (buffer >> bits_left) & 0x1f; - _desc_str[count++] = index + (index < 26 ? 'A' : '2'); // RFC 4648 Base32 + _desc_str[count++] = index + (index < 26 ? 'A' : '2' - 26); // RFC 4648 Base32 } return _desc_str; diff --git a/firmware/src/vendor.c b/firmware/src/vendor.c index bcec95a..655171b 100644 --- a/firmware/src/vendor.c +++ b/firmware/src/vendor.c @@ -23,7 +23,7 @@ #include "fpga_adv.h" #define USB_API_MAJOR 1 -#define USB_API_MINOR 0 +#define USB_API_MINOR 1 // Supported vendor requests.