|
@@ -106,10 +106,10 @@ void mainLoop()
|
|
|
s2s_configPoll();
|
|
s2s_configPoll();
|
|
|
|
|
|
|
|
#ifdef S2S_USB_FS
|
|
#ifdef S2S_USB_FS
|
|
|
- s2s_usbDevicePoll(&hUsbDeviceFS);
|
|
|
|
|
|
|
+ int usbBusy = s2s_usbDevicePoll(&hUsbDeviceFS);
|
|
|
#endif
|
|
#endif
|
|
|
#ifdef S2S_USB_HS
|
|
#ifdef S2S_USB_HS
|
|
|
- s2s_usbDevicePoll(&hUsbDeviceHS);
|
|
|
|
|
|
|
+ int usbBusy = s2s_usbDevicePoll(&hUsbDeviceHS);
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
#if 0
|
|
#if 0
|
|
@@ -117,7 +117,7 @@ void mainLoop()
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
// TODO test if USB transfer is in progress
|
|
// TODO test if USB transfer is in progress
|
|
|
- if (unlikely(scsiDev.phase == BUS_FREE))
|
|
|
|
|
|
|
+ if (unlikely(scsiDev.phase == BUS_FREE) && !usbBusy)
|
|
|
{
|
|
{
|
|
|
if (unlikely(s2s_elapsedTime_ms(lastSDPoll) > 200))
|
|
if (unlikely(s2s_elapsedTime_ms(lastSDPoll) > 200))
|
|
|
{
|
|
{
|
|
@@ -128,19 +128,23 @@ void mainLoop()
|
|
|
scsiPhyConfig();
|
|
scsiPhyConfig();
|
|
|
scsiInit();
|
|
scsiInit();
|
|
|
|
|
|
|
|
-/* TODO DEAL WITH THIS
|
|
|
|
|
if (isUsbStarted)
|
|
if (isUsbStarted)
|
|
|
{
|
|
{
|
|
|
|
|
+#ifdef S2S_USB_FS
|
|
|
USBD_Stop(&hUsbDeviceFS);
|
|
USBD_Stop(&hUsbDeviceFS);
|
|
|
s2s_delay_ms(128);
|
|
s2s_delay_ms(128);
|
|
|
USBD_Start(&hUsbDeviceFS);
|
|
USBD_Start(&hUsbDeviceFS);
|
|
|
|
|
+#endif
|
|
|
|
|
+#ifdef S2S_USB_HS
|
|
|
|
|
+ USBD_Stop(&hUsbDeviceHS);
|
|
|
|
|
+ s2s_delay_ms(128);
|
|
|
|
|
+ USBD_Start(&hUsbDeviceHS);
|
|
|
|
|
+#endif
|
|
|
}
|
|
}
|
|
|
-*/
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- else if ((scsiDev.phase >= 0) && (blockDev.state & DISK_PRESENT))
|
|
|
|
|
|
|
+ else if (usbBusy || ((scsiDev.phase >= 0) && (blockDev.state & DISK_PRESENT)))
|
|
|
{
|
|
{
|
|
|
// don't waste time scanning SD cards while we're doing disk IO
|
|
// don't waste time scanning SD cards while we're doing disk IO
|
|
|
lastSDPoll = s2s_getTime_ms();
|
|
lastSDPoll = s2s_getTime_ms();
|