]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/debug/DebugC.nc
Add debug library; use with tmimsp platforms
[tinyos-2.x.git] / tos / lib / debug / DebugC.nc
diff --git a/tos/lib/debug/DebugC.nc b/tos/lib/debug/DebugC.nc
new file mode 100644 (file)
index 0000000..4e83774
--- /dev/null
@@ -0,0 +1,37 @@
+/* Copyright (c) 2006-2009 by Sporian Microsystems, Inc.
+ * All Rights Reserved.
+ *
+ * This document is the proprietary and confidential property of Sporian
+ * Microsystems, Inc.  All use, distribution, reproduction or re-distribution
+ * is disallowed without the prior express written consent of Sporian
+ * Microsystems, Inc.
+ */
+
+/* A simple debug component.  The best use would be to have a PlatformDebugC
+ * component that either wires to this component or one called NoDebugC
+ * depending upon compilation options.
+ */
+
+configuration DebugC {
+  provides interface Debug;
+}
+implementation
+{
+#ifdef SERIAL_DEBUG
+#warning "SERIAL DEBUG ON"
+
+  components DebugP;
+  Debug = DebugP;
+
+  components MainC;
+  MainC.SoftwareInit -> DebugP;
+
+  components DebugUartC;
+  DebugP.UartResource -> DebugUartC;
+  DebugP.UartByte -> DebugUartC;
+#else
+
+  components NoDebugP;
+  Debug = NoDebugP;
+#endif
+}