MODDMA GPDMA Controller New features: transfer pins to memory buffer under periodic timer control and send double buffers to DAC

Dependents:   FirstTest WaveSim IO-dma-memmem DACDMAfuncgenlib ... more

Revision:
6:40d38be4bb59
Parent:
0:c409efd8df78
Child:
8:cb4d323ce6fd
--- a/MODDMA.cpp	Tue Nov 23 16:04:32 2010 +0000
+++ b/MODDMA.cpp	Tue Nov 23 21:34:21 2010 +0000
@@ -97,9 +97,12 @@
                     // Not, we don't check Active here as it may block inside
                     // an ISR, we just shut it down immediately. If the user
                     // must wait for completion they should implement their
-                    // own ISR.
+                    // own ISR. But only disable if the LLI linked list register
+                    // is null otherwise we can crap out a series of transfers.
                     if (moddma_p->Enabled( (MODDMA::CHANNELS)channel_number )) {
-                        moddma_p->Disable( (MODDMA::CHANNELS)channel_number );
+                        if (moddma_p->lli(channel_number) == 0 ) {
+                            moddma_p->Disable( (MODDMA::CHANNELS)channel_number );
+                        }
                     }
                 }            
             }
@@ -120,9 +123,12 @@
                     // Not, we don't check Active here as it may block inside
                     // an ISR, we just shut it down immediately. If the user
                     // must wait for completion they should implement their
-                    // own ISR.
+                    // own ISR. But only disable if the LLI linked list register
+                    // is null otherwise we can crap out a series of transfers.
                     if (moddma_p->Enabled( (MODDMA::CHANNELS)channel_number )) {
-                        moddma_p->Disable( (MODDMA::CHANNELS)channel_number );
+                        if (moddma_p->lli(channel_number) == 0 ) {
+                            moddma_p->Disable( (MODDMA::CHANNELS)channel_number );
+                        }
                     }
                 }            
             }