Browse Source

Fix CMSIS / USB-FD name conflicts (#18327)

ellensp 4 years ago
parent
commit
1c13428d84
No account linked to committer's email address

+ 6
- 6
Marlin/src/sd/usb_flashdrive/lib-uhs2/Usb.cpp View File

@@ -428,7 +428,7 @@ void USB::Task() { //USB state machine
428 428
   uint8_t rcode;
429 429
   uint8_t tmpdata;
430 430
   static uint32_t delay = 0;
431
-  //USB_DEVICE_DESCRIPTOR buf;
431
+  //USB_FD_DEVICE_DESCRIPTOR buf;
432 432
   bool lowspeed = false;
433 433
 
434 434
   MAX3421E::Task();
@@ -647,8 +647,8 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) {
647 647
   //printf("Configuring: parent = %i, port = %i\r\n", parent, port);
648 648
   uint8_t devConfigIndex;
649 649
   uint8_t rcode = 0;
650
-  uint8_t buf[sizeof (USB_DEVICE_DESCRIPTOR)];
651
-  USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR *>(buf);
650
+  uint8_t buf[sizeof (USB_FD_DEVICE_DESCRIPTOR)];
651
+  USB_FD_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_FD_DEVICE_DESCRIPTOR *>(buf);
652 652
   UsbDevice *p = nullptr;
653 653
   EpInfo *oldep_ptr = nullptr;
654 654
   EpInfo epInfo;
@@ -678,13 +678,13 @@ uint8_t USB::Configuring(uint8_t parent, uint8_t port, bool lowspeed) {
678 678
 
679 679
   p->lowspeed = lowspeed;
680 680
   // Get device descriptor
681
-  rcode = getDevDescr(0, 0, sizeof (USB_DEVICE_DESCRIPTOR), (uint8_t*)buf);
681
+  rcode = getDevDescr(0, 0, sizeof (USB_FD_DEVICE_DESCRIPTOR), (uint8_t*)buf);
682 682
 
683 683
   // Restore p->epinfo
684 684
   p->epinfo = oldep_ptr;
685 685
 
686 686
   if (rcode) {
687
-    //printf("Configuring error: Can't get USB_DEVICE_DESCRIPTOR\r\n");
687
+    //printf("Configuring error: Can't get USB_FD_DEVICE_DESCRIPTOR\r\n");
688 688
     return rcode;
689 689
   }
690 690
 
@@ -762,7 +762,7 @@ uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t con
762 762
 uint8_t USB::getConfDescr(uint8_t addr, uint8_t ep, uint8_t conf, USBReadParser *p) {
763 763
   const uint8_t bufSize = 64;
764 764
   uint8_t buf[bufSize];
765
-  USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_CONFIGURATION_DESCRIPTOR *>(buf);
765
+  USB_FD_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_FD_CONFIGURATION_DESCRIPTOR *>(buf);
766 766
 
767 767
   uint8_t ret = getConfDescr(addr, ep, 9, conf, buf);
768 768
   if (ret) return ret;

+ 7
- 7
Marlin/src/sd/usb_flashdrive/lib-uhs2/confdescparser.h View File

@@ -30,10 +30,10 @@
30 30
 
31 31
 class UsbConfigXtracter {
32 32
 public:
33
-  //virtual void ConfigXtract(const USB_CONFIGURATION_DESCRIPTOR *conf) = 0;
34
-  //virtual void InterfaceXtract(uint8_t conf, const USB_INTERFACE_DESCRIPTOR *iface) = 0;
33
+  //virtual void ConfigXtract(const USB_FD_CONFIGURATION_DESCRIPTOR *conf) = 0;
34
+  //virtual void InterfaceXtract(uint8_t conf, const USB_FD_INTERFACE_DESCRIPTOR *iface) = 0;
35 35
 
36
-  virtual void EndpointXtract(uint8_t conf __attribute__((unused)), uint8_t iface __attribute__((unused)), uint8_t alt __attribute__((unused)), uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR *ep __attribute__((unused))) {
36
+  virtual void EndpointXtract(uint8_t conf __attribute__((unused)), uint8_t iface __attribute__((unused)), uint8_t alt __attribute__((unused)), uint8_t proto __attribute__((unused)), const USB_FD_ENDPOINT_DESCRIPTOR *ep __attribute__((unused))) {
37 37
   }
38 38
 };
39 39
 
@@ -50,7 +50,7 @@ class ConfigDescParser : public USBReadParser {
50 50
   MultiValueBuffer theBuffer;
51 51
   MultiByteValueParser valParser;
52 52
   ByteSkipper theSkipper;
53
-  uint8_t varBuffer[16 /*sizeof(USB_CONFIGURATION_DESCRIPTOR)*/];
53
+  uint8_t varBuffer[16 /*sizeof(USB_FD_CONFIGURATION_DESCRIPTOR)*/];
54 54
 
55 55
   uint8_t stateParseDescr; // ParseDescriptor state
56 56
 
@@ -97,8 +97,8 @@ void ConfigDescParser<CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK>::Parse(const uin
97 97
   compare masks for them. When the match is found, calls EndpointXtract passing buffer containing endpoint descriptor */
98 98
 template <const uint8_t CLASS_ID, const uint8_t SUBCLASS_ID, const uint8_t PROTOCOL_ID, const uint8_t MASK>
99 99
 bool ConfigDescParser<CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK>::ParseDescriptor(uint8_t **pp, uint16_t *pcntdn) {
100
-  USB_CONFIGURATION_DESCRIPTOR* ucd = reinterpret_cast<USB_CONFIGURATION_DESCRIPTOR*>(varBuffer);
101
-  USB_INTERFACE_DESCRIPTOR* uid = reinterpret_cast<USB_INTERFACE_DESCRIPTOR*>(varBuffer);
100
+  USB_FD_CONFIGURATION_DESCRIPTOR* ucd = reinterpret_cast<USB_FD_CONFIGURATION_DESCRIPTOR*>(varBuffer);
101
+  USB_FD_INTERFACE_DESCRIPTOR* uid = reinterpret_cast<USB_FD_INTERFACE_DESCRIPTOR*>(varBuffer);
102 102
   switch (stateParseDescr) {
103 103
     case 0:
104 104
       theBuffer.valueSize = 2;
@@ -155,7 +155,7 @@ bool ConfigDescParser<CLASS_ID, SUBCLASS_ID, PROTOCOL_ID, MASK>::ParseDescriptor
155 155
         case USB_DESCRIPTOR_ENDPOINT:
156 156
           if (!valParser.Parse(pp, pcntdn)) return false;
157 157
           if (isGoodInterface && theXtractor)
158
-            theXtractor->EndpointXtract(confValue, ifaceNumber, ifaceAltSet, protoValue, (USB_ENDPOINT_DESCRIPTOR*)varBuffer);
158
+            theXtractor->EndpointXtract(confValue, ifaceNumber, ifaceAltSet, protoValue, (USB_FD_ENDPOINT_DESCRIPTOR*)varBuffer);
159 159
           break;
160 160
           //case HID_DESCRIPTOR_HID:
161 161
           //  if (!valParser.Parse(pp, pcntdn)) return false;

+ 4
- 4
Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.cpp View File

@@ -250,10 +250,10 @@ bLastUsbError(0) {
250 250
  */
251 251
 uint8_t BulkOnly::ConfigureDevice(uint8_t parent, uint8_t port, bool lowspeed) {
252 252
 
253
-  const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR);
253
+  const uint8_t constBufSize = sizeof (USB_FD_DEVICE_DESCRIPTOR);
254 254
 
255 255
   uint8_t buf[constBufSize];
256
-  USB_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
256
+  USB_FD_DEVICE_DESCRIPTOR * udd = reinterpret_cast<USB_FD_DEVICE_DESCRIPTOR*>(buf);
257 257
   uint8_t rcode;
258 258
   UsbDevice *p = nullptr;
259 259
   EpInfo *oldep_ptr = nullptr;
@@ -529,7 +529,7 @@ uint8_t BulkOnly::Init(uint8_t parent __attribute__((unused)), uint8_t port __at
529 529
  * @param proto
530 530
  * @param pep
531 531
  */
532
-void BulkOnly::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto __attribute__((unused)), const USB_ENDPOINT_DESCRIPTOR * pep) {
532
+void BulkOnly::EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto __attribute__((unused)), const USB_FD_ENDPOINT_DESCRIPTOR * pep) {
533 533
   ErrorMessage<uint8_t> (PSTR("Conf.Val"), conf);
534 534
   ErrorMessage<uint8_t> (PSTR("Iface Num"), iface);
535 535
   ErrorMessage<uint8_t> (PSTR("Alt.Set"), alt);
@@ -1166,7 +1166,7 @@ uint8_t BulkOnly::HandleSCSIError(uint8_t status) {
1166 1166
  *
1167 1167
  * @param ep_ptr
1168 1168
  */
1169
-void BulkOnly::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR * ep_ptr) {
1169
+void BulkOnly::PrintEndpointDescriptor(const USB_FD_ENDPOINT_DESCRIPTOR * ep_ptr) {
1170 1170
   Notify(PSTR("Endpoint descriptor:"), 0x80);
1171 1171
   Notify(PSTR("\r\nLength:\t\t"), 0x80);
1172 1172
   D_PrintHex<uint8_t> (ep_ptr->bLength, 0x80);

+ 2
- 2
Marlin/src/sd/usb_flashdrive/lib-uhs2/masstorage.h View File

@@ -491,7 +491,7 @@ protected:
491 491
   uint16_t CurrentSectorSize[MASS_MAX_SUPPORTED_LUN]; // Sector size, clipped to 16 bits
492 492
   bool LUNOk[MASS_MAX_SUPPORTED_LUN]; // use this to check for media changes.
493 493
   bool WriteOk[MASS_MAX_SUPPORTED_LUN];
494
-  void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
494
+  void PrintEndpointDescriptor(const USB_FD_ENDPOINT_DESCRIPTOR* ep_ptr);
495 495
 
496 496
   // Additional Initialization Method for Subclasses
497 497
 
@@ -526,7 +526,7 @@ public:
526 526
   virtual uint8_t GetAddress() { return bAddress; }
527 527
 
528 528
   // UsbConfigXtracter implementation
529
-  void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
529
+  void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_FD_ENDPOINT_DESCRIPTOR *ep);
530 530
 
531 531
   virtual bool DEVCLASSOK(uint8_t klass) { return klass == USB_CLASS_MASS_STORAGE; }
532 532
 

+ 1
- 1
Marlin/src/sd/usb_flashdrive/lib-uhs2/message.cpp View File

@@ -37,7 +37,7 @@ int UsbDEBUGlvl = 0x80;
37 37
 void E_Notifyc(char c, int lvl) {
38 38
   if (UsbDEBUGlvl < lvl) return;
39 39
   USB_HOST_SERIAL.print(c
40
-    #if !defined(ARDUINO) || ARDUINO < 100
40
+    #if !defined(ARDUINO) && !defined(ARDUINO_ARCH_LPC176X)
41 41
       , BYTE
42 42
     #endif
43 43
   );

+ 4
- 4
Marlin/src/sd/usb_flashdrive/lib-uhs2/usb_ch9.h View File

@@ -116,7 +116,7 @@ typedef struct {
116 116
         uint8_t iProduct; // Index of String Descriptor describing the product.
117 117
         uint8_t iSerialNumber; // Index of String Descriptor with the device's serial number.
118 118
         uint8_t bNumConfigurations; // Number of possible configurations.
119
-} __attribute__((packed)) USB_DEVICE_DESCRIPTOR;
119
+} __attribute__((packed)) USB_FD_DEVICE_DESCRIPTOR;
120 120
 
121 121
 /* Configuration descriptor structure */
122 122
 typedef struct {
@@ -128,7 +128,7 @@ typedef struct {
128 128
         uint8_t iConfiguration; // Index of String Descriptor describing the configuration.
129 129
         uint8_t bmAttributes; // Configuration characteristics.
130 130
         uint8_t bMaxPower; // Maximum power consumed by this configuration.
131
-} __attribute__((packed)) USB_CONFIGURATION_DESCRIPTOR;
131
+} __attribute__((packed)) USB_FD_CONFIGURATION_DESCRIPTOR;
132 132
 
133 133
 /* Interface descriptor structure */
134 134
 typedef struct {
@@ -141,7 +141,7 @@ typedef struct {
141 141
         uint8_t bInterfaceSubClass; // Subclass code (assigned by the USB-IF).
142 142
         uint8_t bInterfaceProtocol; // Protocol code (assigned by the USB-IF).  0xFF-Vendor specific.
143 143
         uint8_t iInterface; // Index of String Descriptor describing the interface.
144
-} __attribute__((packed)) USB_INTERFACE_DESCRIPTOR;
144
+} __attribute__((packed)) USB_FD_INTERFACE_DESCRIPTOR;
145 145
 
146 146
 /* Endpoint descriptor structure */
147 147
 typedef struct {
@@ -151,7 +151,7 @@ typedef struct {
151 151
         uint8_t bmAttributes; // Endpoint transfer type.
152 152
         uint16_t wMaxPacketSize; // Maximum packet size.
153 153
         uint8_t bInterval; // Polling interval in frames.
154
-} __attribute__((packed)) USB_ENDPOINT_DESCRIPTOR;
154
+} __attribute__((packed)) USB_FD_ENDPOINT_DESCRIPTOR;
155 155
 
156 156
 /* HID descriptor */
157 157
 typedef struct {

+ 1
- 1
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE.h View File

@@ -174,7 +174,7 @@ protected:
174 174
         volatile uint16_t CurrentSectorSize[MASS_MAX_SUPPORTED_LUN]; // Sector size, clipped to 16 bits
175 175
         volatile bool LUNOk[MASS_MAX_SUPPORTED_LUN]; // use this to check for media changes.
176 176
         volatile bool WriteOk[MASS_MAX_SUPPORTED_LUN];
177
-        void PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR* ep_ptr);
177
+        void PrintEndpointDescriptor(const USB_FD_ENDPOINT_DESCRIPTOR* ep_ptr);
178 178
 
179 179
 public:
180 180
         UHS_Bulk_Storage(UHS_USB_HOST_BASE *p);

+ 1
- 1
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_BULK_STORAGE/UHS_BULK_STORAGE_INLINE.h View File

@@ -1188,7 +1188,7 @@ uint8_t UHS_NI UHS_Bulk_Storage::HandleSCSIError(uint8_t status) {
1188 1188
  *
1189 1189
  * @param ep_ptr
1190 1190
  */
1191
-void UHS_NI UHS_Bulk_Storage::PrintEndpointDescriptor(const USB_ENDPOINT_DESCRIPTOR * ep_ptr) {
1191
+void UHS_NI UHS_Bulk_Storage::PrintEndpointDescriptor(const USB_FD_ENDPOINT_DESCRIPTOR * ep_ptr) {
1192 1192
         Notify(PSTR("Endpoint descriptor:"), 0x80);
1193 1193
         Notify(PSTR("\r\nLength:\t\t"), 0x80);
1194 1194
         D_PrintHex<uint8_t > (ep_ptr->bLength, 0x80);

+ 15
- 15
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_host_INLINE.h View File

@@ -239,12 +239,12 @@ uint8_t UHS_USB_HOST_BASE::Configuring(uint8_t parent, uint8_t port, uint8_t spe
239 239
         // wrap in {} to throw away the 64 byte buffer when we are done with it
240 240
         {
241 241
                 uint8_t buf[biggest];
242
-                USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR *>(buf);
242
+                USB_FD_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_FD_DEVICE_DESCRIPTOR *>(buf);
243 243
 #else
244 244
         const uint8_t biggest = 18;
245 245
         uint8_t buf[biggest];
246
-        USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR *>(buf);
247
-        USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_CONFIGURATION_DESCRIPTOR *>(buf);
246
+        USB_FD_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_FD_DEVICE_DESCRIPTOR *>(buf);
247
+        USB_FD_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_FD_CONFIGURATION_DESCRIPTOR *>(buf);
248 248
 #endif
249 249
 
250 250
                 //for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) {
@@ -309,7 +309,7 @@ again:
309 309
                                 sof_delay(200);
310 310
                                 goto again;
311 311
                         }
312
-                        HOST_DEBUG("Configuring error: 0x%2.2x Can't get USB_DEVICE_DESCRIPTOR\r\n", rcode);
312
+                        HOST_DEBUG("Configuring error: 0x%2.2x Can't get USB_FD_DEVICE_DESCRIPTOR\r\n", rcode);
313 313
                         return rcode;
314 314
                 }
315 315
 
@@ -378,7 +378,7 @@ again:
378 378
         } // unwrapped, old large buf now invalid and discarded.
379 379
 
380 380
         uint8_t buf[18];
381
-        USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_CONFIGURATION_DESCRIPTOR *>(buf);
381
+        USB_FD_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_FD_CONFIGURATION_DESCRIPTOR *>(buf);
382 382
 #endif
383 383
 
384 384
         ei.address = addrPool.AllocAddress(parent, IsHub(ei.klass), port);
@@ -415,9 +415,9 @@ again:
415 415
                 HOST_DEBUG("configs: %i\r\n", configs);
416 416
                 for(uint8_t conf = 0; (!rcode) && (conf < configs); conf++) {
417 417
                         // read the config descriptor into a buffer.
418
-                        rcode = getConfDescr(ei.address, sizeof (USB_CONFIGURATION_DESCRIPTOR), conf, buf);
418
+                        rcode = getConfDescr(ei.address, sizeof (USB_FD_CONFIGURATION_DESCRIPTOR), conf, buf);
419 419
                         if(rcode) {
420
-                                HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR\r\n", rcode);
420
+                                HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR\r\n", rcode);
421 421
                                 rcode = UHS_HOST_ERROR_FailGetConfDescr;
422 422
                                 continue;
423 423
                         }
@@ -438,7 +438,7 @@ again:
438 438
                         uint8_t offset;
439 439
                         rcode = initDescrStream(&ei, ucd, pep, data, &left, &read, &offset);
440 440
                         if(rcode) {
441
-                                HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
441
+                                HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
442 442
                                 break;
443 443
                         }
444 444
                         for(; (numinf) && (!rcode); inf++) {
@@ -451,7 +451,7 @@ again:
451 451
                                         break;
452 452
                                 }
453 453
                                 if(rcode) {
454
-                                        HOST_DEBUG("Configuring error: %2.2x Can't close USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
454
+                                        HOST_DEBUG("Configuring error: %2.2x Can't close USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
455 455
                                         continue;
456 456
                                 }
457 457
                                 rcode = TestInterface(&ei);
@@ -471,9 +471,9 @@ again:
471 471
                 if(!bestsuccess) rcode = UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED;
472 472
         }
473 473
         if(!rcode) {
474
-                rcode = getConfDescr(ei.address, sizeof (USB_CONFIGURATION_DESCRIPTOR), bestconf, buf);
474
+                rcode = getConfDescr(ei.address, sizeof (USB_FD_CONFIGURATION_DESCRIPTOR), bestconf, buf);
475 475
                 if(rcode) {
476
-                        HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR\r\n", rcode);
476
+                        HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR\r\n", rcode);
477 477
                         rcode = UHS_HOST_ERROR_FailGetConfDescr;
478 478
                 }
479 479
         }
@@ -497,7 +497,7 @@ again:
497 497
                                 uint8_t offset;
498 498
                                 rcode = initDescrStream(&ei, ucd, pep, data, &left, &read, &offset);
499 499
                                 if(rcode) {
500
-                                        HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
500
+                                        HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
501 501
                                 } else {
502 502
                                         for(; (numinf) && (!rcode); inf++) {
503 503
                                                 // iterate for each interface on this config
@@ -508,7 +508,7 @@ again:
508 508
                                                         break;
509 509
                                                 }
510 510
                                                 if(rcode) {
511
-                                                        HOST_DEBUG("Configuring error: %2.2x Can't close USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
511
+                                                        HOST_DEBUG("Configuring error: %2.2x Can't close USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
512 512
                                                         continue;
513 513
                                                 }
514 514
 
@@ -721,7 +721,7 @@ uint8_t UHS_USB_HOST_BASE::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytes
721 721
  * @param offset
722 722
  * @return zero for success or error code
723 723
  */
724
-uint8_t UHS_USB_HOST_BASE::initDescrStream(ENUMERATION_INFO *ei, USB_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset) {
724
+uint8_t UHS_USB_HOST_BASE::initDescrStream(ENUMERATION_INFO *ei, USB_FD_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset) {
725 725
         if(!ei || !ucd) return UHS_HOST_ERROR_BAD_ARGUMENT;
726 726
         if(!pep) return UHS_HOST_ERROR_NULL_EPINFO;
727 727
         *left = ucd->wTotalLength;
@@ -837,7 +837,7 @@ uint8_t UHS_USB_HOST_BASE::getNextInterface(ENUMERATION_INFO *ei, UHS_EpInfo *pe
837 837
         return rcode;
838 838
 }
839 839
 
840
-uint8_t UHS_USB_HOST_BASE::seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_CONFIGURATION_DESCRIPTOR *ucd) {
840
+uint8_t UHS_USB_HOST_BASE::seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_FD_CONFIGURATION_DESCRIPTOR *ucd) {
841 841
         if(!ei || !ucd) return UHS_HOST_ERROR_BAD_ARGUMENT;
842 842
         uint8_t data[ei->bMaxPacketSize0];
843 843
         UHS_EpInfo *pep;

+ 4
- 4
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usb_ch9.h View File

@@ -164,7 +164,7 @@ typedef struct {
164 164
         uint8_t iProduct; // Index of String Descriptor describing the product.
165 165
         uint8_t iSerialNumber; // Index of String Descriptor with the device's serial number.
166 166
         uint8_t bNumConfigurations; // Number of possible configurations.
167
-} __attribute__((packed)) USB_DEVICE_DESCRIPTOR;
167
+} __attribute__((packed)) USB_FD_DEVICE_DESCRIPTOR;
168 168
 
169 169
 /* Configuration descriptor structure */
170 170
 typedef struct {
@@ -176,7 +176,7 @@ typedef struct {
176 176
         uint8_t iConfiguration; // Index of String Descriptor describing the configuration.
177 177
         uint8_t bmAttributes; // Configuration characteristics.
178 178
         uint8_t bMaxPower; // Maximum power consumed by this configuration.
179
-} __attribute__((packed)) USB_CONFIGURATION_DESCRIPTOR;
179
+} __attribute__((packed)) USB_FD_CONFIGURATION_DESCRIPTOR;
180 180
 
181 181
 /* Interface descriptor structure */
182 182
 typedef struct {
@@ -189,7 +189,7 @@ typedef struct {
189 189
         uint8_t bInterfaceSubClass; // Subclass code (assigned by the USB-IF).
190 190
         uint8_t bInterfaceProtocol; // Protocol code (assigned by the USB-IF).  0xFF-Vendor specific.
191 191
         uint8_t iInterface; // Index of String Descriptor describing the interface.
192
-} __attribute__((packed)) USB_INTERFACE_DESCRIPTOR;
192
+} __attribute__((packed)) USB_FD_INTERFACE_DESCRIPTOR;
193 193
 
194 194
 /* Endpoint descriptor structure */
195 195
 typedef struct {
@@ -199,7 +199,7 @@ typedef struct {
199 199
         uint8_t bmAttributes; // Endpoint transfer type.
200 200
         uint16_t wMaxPacketSize; // Maximum packet size.
201 201
         uint8_t bInterval; // Polling interval in frames.
202
-} __attribute__((packed)) USB_ENDPOINT_DESCRIPTOR;
202
+} __attribute__((packed)) USB_FD_ENDPOINT_DESCRIPTOR;
203 203
 
204 204
 /* HID descriptor */
205 205
 /*

+ 2
- 2
Marlin/src/sd/usb_flashdrive/lib-uhs3/UHS_host/UHS_usbhost.h View File

@@ -207,7 +207,7 @@ public:
207 207
                 interrupts();
208 208
         }
209 209
 
210
-        uint8_t UHS_NI seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_CONFIGURATION_DESCRIPTOR *ucd);
210
+        uint8_t UHS_NI seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_FD_CONFIGURATION_DESCRIPTOR *ucd);
211 211
 
212 212
         uint8_t UHS_NI setEpInfoEntry(uint8_t addr, uint8_t iface, uint8_t epcount, volatile UHS_EpInfo* eprecord_ptr);
213 213
 
@@ -261,7 +261,7 @@ public:
261 261
         uint8_t TestInterface(ENUMERATION_INFO *ei);
262 262
         uint8_t enumerateInterface(ENUMERATION_INFO *ei);
263 263
         uint8_t getNextInterface(ENUMERATION_INFO *ei, UHS_EpInfo *pep, uint8_t data[], uint16_t *left, uint16_t *read, uint8_t *offset);
264
-        uint8_t initDescrStream(ENUMERATION_INFO *ei, USB_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset);
264
+        uint8_t initDescrStream(ENUMERATION_INFO *ei, USB_FD_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset);
265 265
         uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data);
266 266
         uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data);
267 267
         uint8_t doSoftReset(uint8_t parent, uint8_t port, uint8_t address);

Loading…
Cancel
Save