Bladeren bron

Merge pull request #254 from ZuluSCSI/dev_fix_v1_1_dma_timer

ZuluSCSI GD32 V1.1: Fix PhyMode=2 (DMA_TIMER) with AHA2940UW
Alex Perez 2 jaren geleden
bovenliggende
commit
d03f9a7af4
1 gewijzigde bestanden met toevoegingen van 11 en 0 verwijderingen
  1. 11 0
      lib/ZuluSCSI_platform_GD32F205/scsi_accel_dma.cpp

+ 11 - 0
lib/ZuluSCSI_platform_GD32F205/scsi_accel_dma.cpp

@@ -369,6 +369,17 @@ extern "C" void SCSI_TIMER_DMACHB_IRQ()
         }
         else
         {
+            // Wait for final ACK to go low, shouldn't take long.
+            int maxwait = 10000;
+            while (TIMER_CNT(SCSI_TIMER) < 1)
+            {
+                if (maxwait-- < 0)
+                {
+                    logmsg("SCSI_TIMER_DMACHB_IRQ: timeout waiting for final ACK");
+                    break;
+                }
+            }
+
             // No more data available
             stop_dma();
         }