]> 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 59951ef3da739e95f66337177852517a69e56bee..0cebfde42a742c41ea492d39a983f1d2111ff459 100644 (file)
 
 void resetMote()
 {
-#if defined(PLATFORM_MICA) || defined(PLATFORM_MICA2) || defined(PLATFORM_MICA2DOT) || defined(PLATFORM_MICAZ)
+#if defined(PLATFORM_MICA) || defined(PLATFORM_MICA2) || defined(PLATFORM_MICA2DOT) || defined(PLATFORM_MICAZ) || defined(PLATFORM_IRIS)
        cli(); 
        wdt_enable(0); 
        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