Parcourir la source

add invoke callback after serial DMA transmit complete in serial.c

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2387 bbd45198-f89e-11dd-88c7-29a3b14d5316
dzzxzz@gmail.com il y a 12 ans
Parent
commit
d0cba80c07
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      components/drivers/serial/serial.c

+ 6 - 0
components/drivers/serial/serial.c

@@ -439,4 +439,10 @@ void rt_hw_serial_dma_tx_isr(struct rt_serial_device *serial)
     {
     {
         serial->dma_flag = RT_FALSE;
         serial->dma_flag = RT_FALSE;
     }
     }
+
+    /* invoke callback */
+    if (serial->parent.tx_complete != RT_NULL)
+    {
+        serial->parent.tx_complete(&serial->parent, RT_NULL);
+    }
 }
 }