1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-23 20:33:45 +02:00

ubb-la/ubb-la.c (xfers): revert to "safe" end-of-command synchronization

This seems to be the best compromise between stability and performance.
This commit is contained in:
Werner Almesberger 2013-01-30 01:51:12 -03:00
parent 3b007ebaf1
commit 760e8a893a

View File

@ -191,21 +191,12 @@ static void xfers(unsigned long *bufs, int n_bufs, int nibbles,
dma_setup(bufs[0], nibbles);
while (1) {
int j;
MSC_STRPCL = MSC_STRPCRL_START_OP;
MSC_CLKRT = fast_clk->clkrt;
MSCCDR = 0;
/*
* Experimental value for 12 MSa/s with speedup to 84 MSa/s:
* hangs often with 29 cycles, hangs never (so far) with 30.
*/
for (j = 0; j != 30; j++) asm volatile ("");
// while (MSC_STAT & MSC_STAT_DATA_FIFO_EMPTY);
// while (!(MSC_STAT & MSC_STAT_END_CMD_RES));
while (!(MSC_STAT & MSC_STAT_END_CMD_RES));
IN(UBB_CMD);