aboutsummaryrefslogtreecommitdiff
path: root/bootloaders/nuevo_diskloader/src/USBCore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bootloaders/nuevo_diskloader/src/USBCore.cpp')
-rw-r--r--bootloaders/nuevo_diskloader/src/USBCore.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/bootloaders/nuevo_diskloader/src/USBCore.cpp b/bootloaders/nuevo_diskloader/src/USBCore.cpp
index cfcef73..fffe6f7 100644
--- a/bootloaders/nuevo_diskloader/src/USBCore.cpp
+++ b/bootloaders/nuevo_diskloader/src/USBCore.cpp
@@ -217,6 +217,19 @@ u8 USB_Available(u8 ep)
return FifoByteCount();
}
+void USB_Recv_block(u8 ep, u8* dst, int len)
+{
+ SetEP(ep);
+ while (len--)
+ {
+ while (!ReadWriteAllowed())
+ ;
+ *dst++ = Recv8();
+ if (!ReadWriteAllowed()) // release empty buffer
+ ReleaseRX();
+ }
+}
+
// Non Blocking receive
// Return number of bytes read
int USB_Recv(u8 ep, void* d, int len)