X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=drv%2Fser.c;h=ec3d87b1e9dd9f7090e4dee8b075082f0953ac70;hb=357026e01c5b8305bfca0ab67193f25fbd49e5ee;hp=6d16b93c1b5dc685b4d0df0c9885e625efad42b1;hpb=7ee3b3c3da60b181d18336e892d8d0920166f5ae;p=bertos.git diff --git a/drv/ser.c b/drv/ser.c index 6d16b93c..ec3d87b1 100755 --- a/drv/ser.c +++ b/drv/ser.c @@ -3,7 +3,7 @@ * * * \brief Buffered serial I/O driver @@ -28,6 +28,15 @@ /* * $Log$ + * Revision 1.5 2004/06/06 16:41:44 bernie + * ser_putchar(): Use fifo_push_locked() to fix potential race on 8bit processors. + * + * Revision 1.4 2004/06/03 11:27:09 bernie + * Add dual-license information. + * + * Revision 1.3 2004/06/02 21:35:24 aleph + * Serial enhancements: interruptible receive handler and 8 bit serial status for AVR; remove volatile attribute to FIFOBuffer, useless for new fifobuf routens + * * Revision 1.2 2004/05/23 18:21:53 bernie * Trim CVS logs and cleanup header info. * @@ -90,7 +99,7 @@ int ser_putchar(int c, struct Serial *port) while (fifo_isfull_locked(&port->txfifo)); } - fifo_push(&port->txfifo, (unsigned char)c); + fifo_push_locked(&port->txfifo, (unsigned char)c); /* (re)trigger tx interrupt */ port->hw->table->enabletxirq(port->hw); @@ -346,5 +355,5 @@ void ser_close(struct Serial *port) port->is_open = false; port->hw->table->cleanup(port->hw); - port->hw = NULL; + port->hw = NULL; }