mirror of
https://github.com/apache/nuttx.git
synced 2026-05-18 00:34:10 +08:00
samv7/sam_serial.c: reset all DMA pointers on DMA setup
This small fix ensures all DMA pointers are correctly reseted during DMA setup (when the driver is opened). Without this there could be rare occurrence of driver pointer to incorrect (invalidate) DMA buffer and thus saving incorrect characters to upper layer. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
committed by
Petro Karashchenko
parent
49f153abb1
commit
d470c3f268
@@ -1228,6 +1228,8 @@ static int sam_dma_setup(struct uart_dev_s *dev)
|
||||
*/
|
||||
|
||||
priv->rxdmanext = 0;
|
||||
priv->nextcache = 0;
|
||||
priv->buf_idx = 0;
|
||||
priv->rxenable = true;
|
||||
priv->odd = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user