squeeze the usb identification code; manufacturer was being copied to product
This commit is contained in:
parent
daf415d9c7
commit
9aca092900
|
@ -348,7 +348,7 @@ STATIC mp_obj_t supervisor_set_usb_identification(size_t n_args, const mp_obj_t
|
|||
memcpy(identification->manufacturer_name, info.buf, info.len);
|
||||
identification->manufacturer_name[info.len] = 0;
|
||||
} else {
|
||||
memcpy(identification->manufacturer_name, USB_MANUFACTURER, sizeof(USB_MANUFACTURER));
|
||||
strcpy(identification->manufacturer_name, USB_MANUFACTURER);
|
||||
}
|
||||
|
||||
if (args.product.u_obj != mp_const_none) {
|
||||
|
@ -357,7 +357,7 @@ STATIC mp_obj_t supervisor_set_usb_identification(size_t n_args, const mp_obj_t
|
|||
memcpy(identification->product_name, info.buf, info.len);
|
||||
identification->product_name[info.len] = 0;
|
||||
} else {
|
||||
memcpy(identification->product_name, USB_MANUFACTURER, sizeof(USB_MANUFACTURER));
|
||||
strcpy(identification->product_name, USB_PRODUCT);
|
||||
}
|
||||
|
||||
return mp_const_none;
|
||||
|
|
|
@ -143,11 +143,12 @@ void usb_get_boot_py_data(uint8_t *temp_storage, size_t temp_storage_size) {
|
|||
if (usb_identification_allocation) {
|
||||
memcpy(temp_storage, usb_identification_allocation->ptr, sizeof(usb_identification_t));
|
||||
free_memory(usb_identification_allocation);
|
||||
}
|
||||
#else
|
||||
if (false) {
|
||||
// Nothing
|
||||
#endif
|
||||
} else {
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
usb_identification_t defaults;
|
||||
// This compiles to less code than using a struct initializer.
|
||||
defaults.vid = USB_VID;
|
||||
|
|
Loading…
Reference in New Issue