MODSERIAL with support for more devices

Fork of MODSERIAL by Erik -

Revision:
24:9c456e647a8f
Parent:
23:5c45c21f36b7
Child:
25:ae0408ebdd68
--- a/MODSERIAL.cpp	Wed Jul 25 22:27:49 2012 +0000
+++ b/MODSERIAL.cpp	Thu Dec 06 13:06:10 2012 +0000
@@ -31,19 +31,19 @@
 
 namespace AjK {
 
-MODSERIAL::MODSERIAL( PinName tx, PinName rx, const char *name ) : Serial( tx, rx, name )
+MODSERIAL::MODSERIAL( PinName tx, PinName rx ) : Serial( tx, rx )
 {
-    init( MODSERIAL_DEFAULT_TX_BUFFER_SIZE, MODSERIAL_DEFAULT_RX_BUFFER_SIZE );
+    init( MODSERIAL_DEFAULT_TX_BUFFER_SIZE, MODSERIAL_DEFAULT_RX_BUFFER_SIZE, rx );
 }
 
-MODSERIAL::MODSERIAL( PinName tx, PinName rx, int bufferSize, const char *name ) : Serial( tx, rx, name )
+MODSERIAL::MODSERIAL( PinName tx, PinName rx, int bufferSize ) : Serial( tx, rx )
 {
-    init( bufferSize, bufferSize );
+    init( bufferSize, bufferSize, rx );
 }
 
-MODSERIAL::MODSERIAL( PinName tx, PinName rx, int txSize, int rxSize, const char *name ) : Serial( tx, rx, name )
+MODSERIAL::MODSERIAL( PinName tx, PinName rx, int txSize, int rxSize ) : Serial( tx, rx )
 {
-    init( txSize, rxSize );
+    init( txSize, rxSize, rx );
 }
 
 MODSERIAL::~MODSERIAL()
@@ -90,7 +90,7 @@
 #ifdef __LPC11UXX_H__
     NVIC_DisableIRQ( UART_IRQn );
 #else
-    switch(_uidx) {
+    switch( _serial.index ) {
         case 0:   NVIC_DisableIRQ( UART0_IRQn ); break;
         case 1:   NVIC_DisableIRQ( UART1_IRQn ); break;
         case 2:   NVIC_DisableIRQ( UART2_IRQn ); break;
@@ -105,7 +105,7 @@
 #ifdef __LPC11UXX_H__
     NVIC_EnableIRQ( UART_IRQn );
 #else
-    switch( _uidx ) {
+    switch( _serial.index ) {
         case 0:   NVIC_EnableIRQ( UART0_IRQn ); break;
         case 1:   NVIC_EnableIRQ( UART1_IRQn ); break;
         case 2:   NVIC_EnableIRQ( UART2_IRQn ); break;