]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/IPBaseStation/Reset.h
Added support for BLIP on Mulle.
[tinyos-2.x.git] / apps / IPBaseStation / Reset.h
index 550d5c298885a646946449604e4c49dbb3377fb4..0cebfde42a742c41ea492d39a983f1d2111ff459 100644 (file)
@@ -50,8 +50,17 @@ void resetMote()
        while (1) { 
                __asm__ __volatile__("nop" "\n\t" ::);
        }
-#elif defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC)
+#elif defined(PLATFORM_TELOS) || defined(PLATFORM_TELOSB) || defined(PLATFORM_EPIC) || defined(PLATFORM_SHIMMER) || defined(PLATFORM_SHIMMER2) || defined(PLATFORM_SPAN)
         WDTCTL = 0;
+#elif defined(PLATFORM_MULLE)
+            PRCR.BIT.PRC0 = 1; // Turn off protection on CM registers.
+            PRCR.BIT.PRC1 = 1; // Turn off protection on PM registers.
+            CM0.BIT.CM0_6 = 1;  
+            PM1.BIT.PM1_2 = 1; // Reset on WDT underflow.
+            WDTS = 1; // Start watchdog timer.
+            PRCR.BIT.PRC0 = 0; // Turn on protection on CM registers.
+            PRCR.BIT.PRC1 = 0; // Turn on protection on PM registers.
+            while (1); // Wait for underflow in the watchdog timer.
 #else
 #error "Reset.h not defined/supported for your platform, aborting..."
 #endif