BufferedSerial for NUCLEO-F446RE forked from Veysel KARADAG and Sam Grove

Dependencies:   Buffer

Dependents:   Lab05_buffered_serial Lab05_Xbee_receive

Revision:
7:6fa214b41d73
Parent:
6:8287e83943f0
Child:
8:506247a040bc
diff -r 8287e83943f0 -r 6fa214b41d73 BufferedSerial.h
--- a/BufferedSerial.h	Tue Sep 09 20:20:38 2014 +0000
+++ b/BufferedSerial.h	Fri Jan 02 03:47:26 2015 +0000
@@ -27,8 +27,12 @@
 #include "mbed.h"
 #include "Buffer.h"
 
+// Base Class
 #define SERIAL_BASE  RawSerial
 
+// Internal buffer size
+#define BUFFEREDSERIAL_MAX_BUFFER_SIZE   512
+
 /** A serial port (UART) for communication with other serial devices
  *
  * Can be used for Full Duplex communication, or Simplex by specifying
@@ -75,6 +79,7 @@
 private:
     Buffer <char> _rxbuf;
     Buffer <char> _txbuf;
+    char          _buffer[BUFFEREDSERIAL_MAX_BUFFER_SIZE+1];
  
     void rxIrq(void);
     void txIrq(void);
@@ -84,6 +89,7 @@
     /** Create a BufferedSerial port, connected to the specified transmit and receive pins
      *  @param tx Transmit pin
      *  @param rx Receive pin
+     *  @param name optional name
      *  @note Either tx or rx may be specified as NC if unused
      */
     BufferedSerial(PinName tx, PinName rx, const char* name=NULL);