Skip to content

Commit 429190f

Browse files
committed
chore: tmp
1 parent 6f353a5 commit 429190f

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/scenes/mtp/usb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ enum UsbDevDescStr {
1212
UsbDevManuf = 1,
1313
UsbDevProduct = 2,
1414
UsbDevSerial = 3,
15+
UsbDevHighSpeed = 4,
16+
UsbDevLowSpeed = 5,
1517
};
1618
/* === END furi_hal_usb_i.h === */
1719

src/scenes/mtp/usb_desc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const struct usb_device_descriptor usb_mtp_dev_descr = {
1212
.bDescriptorType = USB_DTYPE_DEVICE,
1313
.bcdUSB = VERSION_BCD(2, 0, 0),
1414
.bDeviceClass = USB_CLASS_STILL_IMAGE, // MTP falls under Still Image class
15-
.bDeviceSubClass = 1, // Subclass for MTP
16-
.bDeviceProtocol = 1, // Protocol for MTP
17-
.bMaxPacketSize0 = USB_EP0_SIZE,
15+
.bDeviceSubClass = USB_SUBCLASS_MTP, // Subclass for MTP
16+
.bDeviceProtocol = USB_PROTO_MTP, // Protocol for MTP
17+
.bMaxPacketSize0 = MTP_MAX_PACKET_SIZE,
1818
.idVendor = 0x0483, // STMicroelectronics
1919
.idProduct = 0x5741, // Custom Product ID
2020
.bcdDevice = VERSION_BCD(1, 0, 0),
@@ -31,8 +31,8 @@ const struct MtpDescriptor usb_mtp_cfg_descr = {
3131
.bDescriptorType = USB_DTYPE_CONFIGURATION,
3232
.wTotalLength = sizeof(struct MtpDescriptor),
3333
.bNumInterfaces = 1,
34-
.bConfigurationValue = 1,
35-
.iConfiguration = NO_DESCRIPTOR,
34+
.bConfigurationValue = USB_CONF_VAL_MTP,
35+
.iConfiguration = UsbDevHighSpeed,
3636
.bmAttributes = USB_CFG_ATTR_RESERVED | USB_CFG_ATTR_SELFPOWERED,
3737
.bMaxPower = USB_CFG_POWER_MA(100),
3838
},

src/scenes/mtp/usb_desc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
#include <furi_hal.h>
44
#include <furi_hal_usb.h>
55

6+
#define USB_SUBCLASS_MTP 0x01
7+
#define USB_PROTO_MTP 0x01
8+
#define USB_CONF_VAL_MTP 1
9+
10+
#define MTP_MAX_PACKET_SIZE 512
11+
612
struct MtpDescriptor {
713
struct usb_config_descriptor config;
814
struct usb_interface_descriptor intf;

0 commit comments

Comments
 (0)