]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/mac/tkn154/DebugP.nc
Fixed an issue with indirect transmissions in nonbeacon-enabled mode: DispatchUnslott...
[tinyos-2.x.git] / tos / lib / mac / tkn154 / DebugP.nc
index 8cad827c15de6f69a52cdc75385e01224743d803..954e516cff28b5b56c8d3c6eecefd2839800c630 100644 (file)
 #else
 #include <varargs.h>
 #endif
+#if defined(PLATFORM_TELOSB)
+#include <UserButton.h>
+#endif
 
 module DebugP {
-  uses interface Leds;
+  uses {
+    interface Boot;
+    interface Leds;
+#if defined(PLATFORM_TELOSB)
+    interface Notify<button_state_t> as ButtonPressed;
+#endif
+  }
 }
 implementation {
 
@@ -70,6 +79,19 @@ implementation {
   norace char m_assertFilename[MAX_LEN_FILENAME];
   norace char m_assertFunction[MAX_LEN_FUNNAME];
 
+  event void Boot.booted() {
+#if defined(PLATFORM_TELOSB)
+    call ButtonPressed.enable();
+#endif
+  }
+
+#if defined(PLATFORM_TELOSB)
+  event void ButtonPressed.notify( button_state_t val )
+  {
+    dbg_serial_flush();
+  }
+#endif
+
   task void assertFailTask()
   {
     if (m_assertCounter == 0) {