]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Make sure that Printf was the one that started serial before running the code inside...
authorliang_mike <liang_mike>
Wed, 9 Jul 2008 05:16:16 +0000 (05:16 +0000)
committerliang_mike <liang_mike>
Wed, 9 Jul 2008 05:16:16 +0000 (05:16 +0000)
tos/lib/printf/PrintfP.nc

index c9a99d4397fd2f84a4896ab25f7fdbec0f1d4bd9..0ea9b512861ef2d1d128494f97124f7c5d2457e9 100644 (file)
@@ -111,11 +111,13 @@ implementation {
   }
 
   event void SerialControl.startDone(error_t error) {
+    if (state == S_STOPPED) {
 #ifdef _H_atmega128hardware_H
-    stdout = &atm128_stdout;
+      stdout = &atm128_stdout;
 #endif
-    atomic state = S_STARTED;
-    signal Boot.booted();
+      atomic state = S_STARTED;
+      signal Boot.booted();
+    }
   }
 
   event void SerialControl.stopDone(error_t error) {