The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Revision:
122:f9eeca106725
Parent:
65:5798e58a58b1
--- a/PortOut.h	Wed May 25 16:44:06 2016 +0100
+++ b/PortOut.h	Thu Jul 07 14:34:11 2016 +0100
@@ -21,10 +21,13 @@
 #if DEVICE_PORTOUT
 
 #include "port_api.h"
+#include "critical.h"
 
 namespace mbed {
 /** A multiple pin digital out
  *
+ * @Note Synchronization level: Interrupt safe
+ *
  * Example:
  * @code
  * // Toggle all four LEDs
@@ -55,7 +58,9 @@
      *  @param mask A bitmask to identify which bits in the port should be included (0 - ignore)
      */
     PortOut(PortName port, int mask = 0xFFFFFFFF) {
+        core_util_critical_section_enter();
         port_init(&_port, port, mask, PIN_OUTPUT);
+        core_util_critical_section_exit();
     }
 
     /** Write the value to the output port