From 6db82e84ac9545d9337a3d54e5815c102b1816bb Mon Sep 17 00:00:00 2001 From: liang_mike Date: Wed, 9 Jul 2008 05:16:16 +0000 Subject: [PATCH] Make sure that Printf was the one that started serial before running the code inside SerialControl.startDone --- tos/lib/printf/PrintfP.nc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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) { -- 2.39.2