Don't vanely call kdebug.h.
[bertos.git] / drv / ser.h
index 3af458d426a76db6bf8b4aa01bd01d917c81304d..a41084a75e1be9ae937eae7e81c95a7d94fe943c 100755 (executable)
--- a/drv/ser.h
+++ b/drv/ser.h
  * \author Bernardo Innocenti <bernie@develer.com>
  */
 
-/*
- * $Log$
- * Revision 1.9  2004/08/15 05:32:22  bernie
- * ser_resync(): New function.
- *
- * Revision 1.8  2004/08/02 20:20:29  aleph
- * Merge from project_ks
- *
- * Revision 1.7  2004/07/30 14:15:53  rasky
- * Nuovo supporto unificato per detect della CPU
- *
- * Revision 1.6  2004/07/29 22:57:09  bernie
- * ser_drain(): New function; Make Serial::is_open a debug-only feature; Switch to new-style CONFIG_* macros.
- *
- * Revision 1.5  2004/07/18 21:54:23  bernie
- * Add ATmega8 support.
- *
- * 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.
- *
- */
+/*#*
+ *#* $Log$
+ *#* Revision 1.13  2004/09/14 21:04:57  bernie
+ *#* Don't vanely call kdebug.h.
+ *#*
+ *#* Revision 1.12  2004/09/06 21:40:50  bernie
+ *#* Move buffer handling in chip-specific driver.
+ *#*
+ *#* Revision 1.11  2004/08/25 14:12:08  rasky
+ *#* Aggiornato il comment block dei log RCS
+ *#*
+ *#* Revision 1.10  2004/08/24 16:20:48  bernie
+ *#* ser_read(): Make buffer argument void *#* for consistency with ANSI C and ser_write()
+ *#*
+ *#* Revision 1.9  2004/08/15 05:32:22  bernie
+ *#* ser_resync(): New function.
+ *#*
+ *#* Revision 1.8  2004/08/02 20:20:29  aleph
+ *#* Merge from project_ks
+ *#*
+ *#* Revision 1.7  2004/07/30 14:15:53  rasky
+ *#* Nuovo supporto unificato per detect della CPU
+ *#*
+ *#* Revision 1.6  2004/07/29 22:57:09  bernie
+ *#* ser_drain(): New function; Make Serial::is_open a debug-only feature; Switch to new-style CONFIG_* macros.
+ *#*
+ *#* Revision 1.5  2004/07/18 21:54:23  bernie
+ *#* Add ATmega8 support.
+ *#*
+ *#* 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.
+ *#*
+ *#*/
 #ifndef DRV_SER_H
 #define DRV_SER_H
 
 #include <mware/fifobuf.h>
-#include <drv/kdebug.h>
 #include <compiler.h>
 #include <config.h>
 
@@ -130,10 +141,12 @@ struct Serial
        /*! Physical port number */
        unsigned int unit;
 
-       DB(bool is_open;)
+#ifdef _DEBUG
+       bool is_open;
+#endif
 
        /*!
-        * \name FIFO transmit and receive buffers.
+        * \name Transmit and receive FIFOs.
         *
         * Declared volatile because handled asinchronously by interrupts.
         *
@@ -141,8 +154,6 @@ struct Serial
         */
        FIFOBuffer txfifo;
        FIFOBuffer rxfifo;
-       unsigned char txbuffer[CONFIG_SER_TXBUFSIZE];
-       unsigned char rxbuffer[CONFIG_SER_RXBUFSIZE];
        /* \} */
 
 #if CONFIG_SER_RXTIMEOUT != -1
@@ -166,7 +177,7 @@ extern int ser_getchar(struct Serial *port);
 extern int ser_getchar_nowait(struct Serial *port);
 
 extern int ser_write(struct Serial *port, const void *buf, size_t len);
-extern int ser_read(struct Serial *port, char *buf, size_t size);
+extern int ser_read(struct Serial *port, void *buf, size_t size);
 
 extern int ser_print(struct Serial *port, const char *s);
 extern int ser_printf(struct Serial *port, const char *format, ...) FORMAT(__printf__, 2, 3);