#include <string.h>
-#define I2S_DMAC_CH 3
+#define I2S_DMAC_CH 0
#define I2S_CACHED_CHUNK_SIZE 2
i2s_status |= I2S_STATUS_END_TX;
i2s_status &= ~I2S_STATUS_TX;
-
event_do(&data_ready);
}
remaing_size -= chunk_size;
next_idx += chunk_size;
- if (chunk_size >= remaing_size)
- break;
-
+ if (remaing_size <= 0)
+ {
+ remaing_size = transfer_size;
+ next_idx = 0;
+ }
}
dmac_setLLITransfer(I2S_DMAC_CH, prev, I2S_TX_DMAC_CFG);
remaing_size -= chunk_size;
next_idx += chunk_size;
- if (chunk_size >= remaing_size)
- break;
+ if (remaing_size <= 0)
+ {
+ remaing_size = transfer_size;
+ next_idx = 0;
+ }
}
dmac_setLLITransfer(I2S_DMAC_CH, prev, I2S_RX_DMAC_CFG);