summaryrefslogtreecommitdiff
path: root/supervisor
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2021-02-21 21:24:49 -0600
committerJeff Epler <jepler@gmail.com>2021-02-21 21:24:49 -0600
commit144acfcb988479d6e5802bfa600a62be39d39be7 (patch)
tree2c6280c4777ae44aaac10ad29cc5ba1873be81eb /supervisor
parent2830984aef2208abe911e1a6143e084293e3fc9c (diff)
USB descriptors: Save flash storage for serial number
This saves about 60 bytes (Feather M4 went from 45040 -> 45100 bytes free) 66 bytes of data eliminated, but 6 bytes paid back to initialize the length field.
Diffstat (limited to 'supervisor')
-rw-r--r--supervisor/shared/usb/usb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c
index 5b020b8a0..3c777c505 100644
--- a/supervisor/shared/usb/usb.c
+++ b/supervisor/shared/usb/usb.c
@@ -62,6 +62,7 @@ void load_serial_number(void) {
uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH];
common_hal_mcu_processor_get_uid(raw_id);
+ usb_serial_number[0] = 0x300 | MP_ARRAY_SIZE(usb_serial_number);
for (int i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) {
for (int j = 0; j < 2; j++) {
uint8_t nibble = (raw_id[i] >> (j * 4)) & 0xf;