mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Revision:
160:d5399cc887bb
Parent:
149:156823d33999
Child:
174:b96e65c34a4d
--- a/drivers/SerialBase.cpp	Tue Feb 28 17:13:35 2017 +0000
+++ b/drivers/SerialBase.cpp	Tue Mar 14 16:40:56 2017 +0000
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 #include "drivers/SerialBase.h"
-#include "platform/wait_api.h"
-#include "platform/critical.h"
+#include "platform/mbed_wait_api.h"
+#include "platform/mbed_critical.h"
 
 #if DEVICE_SERIAL
 
@@ -32,7 +32,7 @@
     // No lock needed in the constructor
 
     for (size_t i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
-        _irq[i].attach(donothing);
+        _irq[i] = donothing;
     }
 
     serial_init(&_serial, tx, rx);
@@ -73,10 +73,10 @@
     // Disable interrupts when attaching interrupt handler
     core_util_critical_section_enter();
     if (func) {
-        _irq[type].attach(func);
+        _irq[type] = func;
         serial_irq_set(&_serial, (SerialIrq)type, 1);
     } else {
-        _irq[type].attach(donothing);
+        _irq[type] = donothing;
         serial_irq_set(&_serial, (SerialIrq)type, 0);
     }
     core_util_critical_section_exit();
@@ -85,7 +85,7 @@
 
 void SerialBase::_irq_handler(uint32_t id, SerialIrq irq_type) {
     SerialBase *handler = (SerialBase*)id;
-    handler->_irq[irq_type].call();
+    handler->_irq[irq_type]();
 }
 
 int SerialBase::_base_getc() {