X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fser.c;h=dbde1aa0f63eafbe7d48d0a8329ef5d73734845d;hb=cdf3e45aaa38fc701dceeb57e6ceedd6ca68f408;hp=268e739b73a1ab90067e34eacf05ddc5e7e0f9a1;hpb=29b60d46e5a1c0c092fde92816a20d831f54fbfd;p=bertos.git 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); }