I am using a DMA channel to transfer samples from a codec into memory. At the moment my software uses a polling loop to detect the end of the transfer, but I feel that this wasteful. I think that it would make more sense to use one of the IDLE procedures. However I have a few concerns:
- I think that the IDLE2 procedure is most appropriate. Table 1-31 in the system guide (sprufx5c) states that this allows an exit on any unmasked peripheral. However the IDLE2 procedure in 1.5.5.1 begins with "Wait for completion of all DMA transfers.", not a good sign for my application.
- What happens if the interrupt occurs before I execute the IDLE instruction? Does the CPU come straight out of IDLE or is this a lock-up condition?
I'd be grateful for any observations, in particular if this is an unwise thing to attempt.
Peter