Fork of the MODSERIAL library by Erik Olieman.

Dependents:   trs_master

Fork of MODSERIAL by Erik -

Files at this revision

API Documentation at this revision

Comitter:
Sissors
Date:
Mon Nov 26 09:24:07 2012 +0000
Parent:
25:aa4d92532e46
Child:
27:5f402fed53e2
Commit message:
mbed v45 compatibility

Changed in this revision

INIT.cpp Show annotated file Show diff for this revision Revisions of this file
ISR_TX.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/INIT.cpp	Thu Nov 22 10:43:21 2012 +0000
+++ b/INIT.cpp	Mon Nov 26 09:24:07 2012 +0000
@@ -58,7 +58,7 @@
         buffer_out[RxIrq]      = 0;
         buffer_count[RxIrq]    = 0;
         buffer_overflow[RxIrq] = 0;
-        Serial::attach(this, &MODSERIAL::isr_rx, (SerialIrq)1);        
+        Serial::attach(this, &MODSERIAL::isr_rx, (SerialIrq)RxIrq);        
         
         buffer_size[TxIrq]     = txSize;
         buffer[TxIrq]          = txSize > 0 ? (char *)malloc(buffer_size[TxIrq]) : (char *)NULL;
@@ -66,7 +66,7 @@
         buffer_out[TxIrq]      = 0;
         buffer_count[TxIrq]    = 0;
         buffer_overflow[TxIrq] = 0;
-        Serial::attach(this, &MODSERIAL::isr_tx, (SerialIrq)(0));
+        Serial::attach(this, &MODSERIAL::isr_tx, (SerialIrq)TxIrq);
     }
     else {
         error("MODSERIAL must have a defined UART to function.");
--- a/ISR_TX.cpp	Thu Nov 22 10:43:21 2012 +0000
+++ b/ISR_TX.cpp	Mon Nov 26 09:24:07 2012 +0000
@@ -28,12 +28,13 @@
 void 
 MODSERIAL::isr_tx(bool doCallback)
 {
+
     if (! _base || buffer_size[TxIrq] == 0 || buffer[TxIrq] == (char *)NULL) {
         _isr[TxIrq].call(&this->callbackInfo); 
         return;
     }
-    
-    while (! MODSERIAL_TX_BUFFER_EMPTY && MODSERIAL_THR_HAS_SPACE ) {
+
+    while (! MODSERIAL_TX_BUFFER_EMPTY && MODSERIAL_THR_HAS_SPACE ) {       
         _THR = txc = (uint8_t)(buffer[TxIrq][buffer_out[TxIrq]]);
         buffer_count[TxIrq]--;   
         buffer_out[TxIrq]++;