From: liang_mike Date: Wed, 9 Jul 2008 05:16:16 +0000 (+0000) Subject: Make sure that Printf was the one that started serial before running the code inside... X-Git-Tag: release_tinyos_2_1_0_0~100 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=6db82e84ac9545d9337a3d54e5815c102b1816bb Make sure that Printf was the one that started serial before running the code inside SerialControl.startDone --- diff --git a/tos/lib/printf/PrintfP.nc b/tos/lib/printf/PrintfP.nc index c9a99d43..0ea9b512 100644 --- a/tos/lib/printf/PrintfP.nc +++ b/tos/lib/printf/PrintfP.nc @@ -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) {