altos: When sharing radio DMA for AES, use it for in instead of out
authorKeith Packard <keithp@keithp.com>
Wed, 29 Aug 2012 01:05:10 +0000 (18:05 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 29 Aug 2012 06:00:22 +0000 (23:00 -0700)
We look at the out_done value, but not the in_done value; if we use
the radio DMA for out, we would have to use ao_radio_dma_done to check
for completion. This way, we can ignore that value and use the
existing ao_aes_dma_out_done value.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/cc1111/ao_aes.c

index 0e32abf61cc33fcc6182f0770465d140baa9c9a1..b1f305eca2ddee9279dff315c3ea1f4b2ee3d256 100644 (file)
@@ -135,12 +135,12 @@ ao_aes_run(__xdata uint8_t *in,
 void
 ao_aes_init(void)
 {
-       ao_aes_dma_in = ao_dma_alloc(&ao_aes_dma_in_done);
 #if DMA_SHARE_AES_RADIO
-       ao_aes_dma_out = ao_radio_dma;
+       ao_aes_dma_in = ao_radio_dma;
 #else
-       ao_aes_dma_out = ao_dma_alloc(&ao_aes_dma_out_done);
+       ao_aes_dma_in = ao_dma_alloc(&ao_aes_dma_in_done);
 #endif
+       ao_aes_dma_out = ao_dma_alloc(&ao_aes_dma_out_done);
        S0CON = 0;
        ENCIE = 1;
 }