Test for SWO viewer library.
See here for more information.
Revision 0:de9d7358fcd0, committed 2014-12-20
- Comitter:
- wim
- Date:
- Sat Dec 20 22:33:52 2014 +0000
- Child:
- 1:3308ab077592
- Commit message:
- Test for SWO viewer library
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SWO.lib Sat Dec 20 22:33:52 2014 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/wim/code/SWO/#bae4cff278f6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sat Dec 20 22:33:52 2014 +0000
@@ -0,0 +1,40 @@
+
+#include "mbed.h"
+#include "SWO.h"
+
+//Single Wire Output(SWO) Test
+//Hook up to Host PC software ST-LINK Utility or Segger J-Link SWO viewer
+//
+#define D_SWO 1
+
+DigitalOut myled(LED1);
+
+Serial pc(SERIAL_TX, SERIAL_RX);
+
+int main() {
+ pc.printf("Hello World\n\r");
+// pc.printf("\r\nMy Program - build " MBED_BUILD_TIMESTAMP "\r\n");
+ pc.printf("\r\nMy Program - (partial) build " __DATE__ " " __TIME__ "\r\n");
+ pc.printf("CPU SystemCoreClock is %d Hz\r\n", SystemCoreClock);
+
+#if (D_SWO == 1)
+ SWO_PrintString("\r\nHello World from SWO\r\n");
+ char message[64];
+ sprintf(message, "CPU SystemCoreClock is %d Hz\r\n", SystemCoreClock);
+ SWO_PrintString(message);
+#endif
+
+ while(1) {
+ myled = 1; // LED is ON
+ wait(0.2); // 200 ms
+ myled = 0; // LED is OFF
+ wait(1.0); // 1 sec
+
+#if (D_SWO == 1)
+// SWO_PrintString("#");
+ SWO_PrintChar('+');
+#endif
+
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat Dec 20 22:33:52 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5 \ No newline at end of file
SWO viewer