MODSERIAL with support for more devices

Dependents:   1D-Pong BMT-K9_encoder BMT-K9-Regelaar programma_filter ... more

Check the cookbook page for more information: https://mbed.org/cookbook/MODSERIAL

Did you add a device? Please send a pull request so we can keep everything in one library instead of many copies. In that case also send a PM, since currently mbed does not inform of new pull requests. I will then also add you to the developers of this library so you can do other changes directly.

Files at this revision

API Documentation at this revision

Comitter:
Sissors
Date:
Sun May 07 16:26:36 2017 +0000
Parent:
43:8c8d13e1840b
Child:
45:da0788f0bd77
Commit message:
Used callback functions to attach to Serial, to remove compilation warnings

Changed in this revision

INIT.cpp Show annotated file Show diff for this revision Revisions of this file
MODSERIAL.h Show annotated file Show diff for this revision Revisions of this file
--- a/INIT.cpp	Wed Apr 26 06:50:40 2017 +0000
+++ b/INIT.cpp	Sun May 07 16:26:36 2017 +0000
@@ -50,7 +50,7 @@
         buffer_out[RxIrq]      = 0;
         buffer_count[RxIrq]    = 0;
         buffer_overflow[RxIrq] = 0;
-        Serial::attach( this, &MODSERIAL::isr_rx, Serial::RxIrq );        
+        Serial::attach( callback(this, &MODSERIAL::isr_rx), Serial::RxIrq );        
         
         buffer_size[TxIrq]     = txSize;
         buffer[TxIrq]          = txSize > 0 ? (char *)malloc(buffer_size[TxIrq]) : (char *)NULL;
@@ -58,7 +58,7 @@
         buffer_out[TxIrq]      = 0;
         buffer_count[TxIrq]    = 0;
         buffer_overflow[TxIrq] = 0;
-        Serial::attach( this, &MODSERIAL::isr_tx, Serial::TxIrq );
+        Serial::attach( callback(this, &MODSERIAL::isr_tx_true), Serial::TxIrq );
     }
     else {
         error("MODSERIAL must have a defined UART to function.");
--- a/MODSERIAL.h	Wed Apr 26 06:50:40 2017 +0000
+++ b/MODSERIAL.h	Sun May 07 16:26:36 2017 +0000
@@ -894,7 +894,7 @@
      * TX Interrupt Service Routine stub version.
      * @ingroup INTERNALS
      */ 
-    void isr_tx(void) { isr_tx(true); }
+    void isr_tx_true(void) { isr_tx(true); }
     
     
     /**