From: aleph Date: Fri, 21 Jan 2005 20:13:15 +0000 (+0000) Subject: Fix drain at ser_close() X-Git-Tag: 1.0.0~898 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=a85763c42e05e3f30052343dbd0f539d54d42f48;p=bertos.git Fix drain at ser_close() git-svn-id: https://src.develer.com/svnoss/bertos/trunk@343 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/drv/ser.c b/drv/ser.c index 268e739b..dbde1aa0 100755 --- a/drv/ser.c +++ b/drv/ser.c @@ -28,6 +28,9 @@ /*#* *#* $Log$ + *#* Revision 1.24 2005/01/21 20:13:15 aleph + *#* Fix drain at ser_close() + *#* *#* Revision 1.23 2005/01/14 00:47:07 aleph *#* ser_drain(): Wait for hw transmission complete. *#* @@ -507,8 +510,13 @@ void ser_close(struct Serial *port) // Wait until we finish sending everything ser_drain(port); - ser_purge(port); port->hw->table->cleanup(port->hw); DB(port->hw = NULL;) + + /* + * We purge the FIFO buffer only after the low-level cleanup, so that + * we are sure that there are no more interrupts. + */ + ser_purge(port); }