//sirq_printf("isfr3: %08x\r\n", PORTD->ISFR);\r
}\r
\r
-void tdma_stop(tdma_t *port)\r
+void tdma_stop(tdma_t *port, int wait)\r
{\r
if (!port)\r
return;\r
\r
//sirq_printf("isfr0: %08x\r\n", PORTD->ISFR);\r
\r
+ for (int i = 0; port->dma->dsr & DMA_DSR_BCR_BCR_MASK; i++)\r
+ if (i > wait)\r
+ return;\r
+\r
// Disable DMA Mux\r
port->mux->cfg &= DMAMUX_CHCFG_ENBL_MASK;\r
\r
| ((uint64_t)~tml) << 0;\r
\r
// Convert to nanoseconds\r
- return clocks * 1000 / 24;\r
+ return clocks * 125 / 3;\r
}\r
\r
void tdma_debug(tdma_t *port)\r