We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd8cb46 commit 537c47fCopy full SHA for 537c47f
hardware/arduino/avr/cores/arduino/USBCore.cpp
@@ -425,13 +425,24 @@ static bool USB_SendStringDescriptor(const u8*string_P, u8 string_len, uint8_t f
425
}
426
427
// Does not timeout or cross fifo boundaries
428
-// Will only work for transfers <= 64 bytes
429
-// TODO
430
int USB_RecvControl(void* d, int len)
431
{
432
- WaitOUT();
433
- Recv((u8*)d,len);
434
- ClearOUT();
+ auto length = len;
+ while(length)
+ {
+ // Dont receive more than the USB Control EP has to offer
+ // Use fixed 64 because control EP always have 64 bytes even on 16u2.
435
+ auto recvLength = length;
436
+ if(recvLength > 64){
437
+ recvLength = 64;
438
+ }
439
+ length -= recvLength;
440
+
441
+ // Write data to fit to the end (not the beginning) of the array
442
+ WaitOUT();
443
+ Recv((u8*)d + length, recvLength);
444
+ ClearOUT();
445
446
return len;
447
448
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments