Some classes and macros to enable quick single line trace and watch facilities. Three macros DBUG_INIT, TRACE & WATCH are used to implement all functions. DBUG_INIT is used to allocate the maximum number of watch items that are to be displayed at any time. The remainder of the VT100 emulation screen will be dedicated to the scrolling trace function. The use of macros means that they will be ignored by the compiler when the debug declaration is removed. To assist in formatting the string output I have implemented a caret field that is interpreted as a screen attribute eg ^R reverse video on ^r reverse video off. Look at the VT100 class for further details. This was completed for a rush project about 10 minutes ago so expect a few issues to become apparent.

Dependencies:   mbed

Revision:
0:0c4137d26c2e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jan 04 23:25:20 2010 +0000
@@ -0,0 +1,45 @@
+
+#include "Config.h"
+#include "mbed.h"
+#include "RemoteFunc.h"
+
+//Set Up Debug Environment
+IMPLEMENT_DBUG;
+
+Ticker tkInterrupt;
+
+DigitalOut Led1(LED1);
+DigitalOut Led2(LED2);
+DigitalOut Led3(LED3);
+DigitalOut Led4(LED4);
+
+const float fWait(1.0);
+
+long nIntegrand(0);
+
+int main()
+{
+  DBUG_INIT(8);
+
+  while(true)
+  {
+    TRACE("Beginning of Loop\n\r");
+    WATCH("Integrand     %6ld", nIntegrand++);
+
+    if (nIntegrand % 3)
+      RemoteFunction(nIntegrand);
+      
+    // Display Diagnostics LEDs
+    Led1 = (nIntegrand % 2 == 0);
+    Led2 = (nIntegrand % 3 == 0);
+    Led3 = (nIntegrand % 4 == 0);
+    Led4 = (nIntegrand % 5 == 0);
+    WATCH("%s", Led1 ? "^RLED 1^r" : "LED 1");
+    WATCH("%s", Led2 ? "^RLED 2^r" : "LED 2");
+    WATCH("%s", Led3 ? "^RLED 3^r" : "LED 3");
+    WATCH("%s", Led4 ? "^RLED 4^r" : "LED 4");
+    TRACE("Waiting for %2.1f Seconds\n\r", fWait);
+    wait(fWait);
+    TRACE("End Of Loop\n\r");
+  }
+}
\ No newline at end of file