mbed official / mbed

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

Revision:
170:e95d10626187
Parent:
169:a7c7b631e539
Child:
171:3a7713b1edbc
diff -r a7c7b631e539 -r e95d10626187 drivers/SerialWireOutput.h
--- a/drivers/SerialWireOutput.h	Fri Jun 22 15:38:59 2018 +0100
+++ b/drivers/SerialWireOutput.h	Thu Sep 06 13:39:34 2018 +0100
@@ -20,7 +20,7 @@
 #include "platform/FileHandle.h"
 
 namespace mbed {
-  
+
 class SerialWireOutput : public FileHandle {
 
 public:
@@ -33,12 +33,8 @@
 
     virtual ssize_t write(const void *buffer, size_t size)
     {
-        const unsigned char *buf = static_cast<const unsigned char *>(buffer);
+        mbed_itm_send_block(ITM_PORT_SWO, buffer, size);
 
-        /* Send buffer one character at a time over the ITM SWO port */
-        for (size_t i = 0; i < size; i++) {
-            mbed_itm_send(ITM_PORT_SWO, buf[i]);
-        }
         return size;
     }
 
@@ -71,7 +67,7 @@
         return 0;
     }
 };
- 
+
 } // namespace mbed
 
 #endif