From: R. Steve McKown Date: Mon, 19 Apr 2010 22:13:15 +0000 (-0600) Subject: Fix startup in SoftwareInit.init overwriting changes to StateC's. X-Git-Tag: debian/2.1.0-4-1tmi~1^2~3 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=20150f888460e06a59b649ff19da9682768ab3b7 Fix startup in SoftwareInit.init overwriting changes to StateC's. If a component wires its Init.init() via SoftwareInit and ncc calls StateImplP.Init.init() after the component's Init.init(), any change to its StateC, such as call State.forceState(), is undone. The easy fix is to remove the extra initiation of state[] in StateImplP.Init.init(), since state[] is a static and is guaranteed to have members with value zero (S_IDLE). --- diff --git a/tos/system/StateImplP.nc b/tos/system/StateImplP.nc index 3883ac15..edcde832 100644 --- a/tos/system/StateImplP.nc +++ b/tos/system/StateImplP.nc @@ -79,10 +79,6 @@ implementation { /***************** Init Commands ****************/ command error_t Init.init() { - int i; - for(i = 0; i < uniqueCount(UQ_STATE); i++) { - state[i] = S_IDLE; - } return SUCCESS; }