From: janhauer Date: Thu, 11 Mar 2010 09:42:25 +0000 (+0000) Subject: bugfix (by Roman Lim): reference voltage was turned off immediately when RefVolt_XXXV... X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=6703739faea94aa117cab4c4aeb89973e9be20e6 bugfix (by Roman Lim): reference voltage was turned off immediately when RefVolt_XXXV.stop() was called, but there should be a small delay; also, the internal state of the component did not get back to GENERATOR_OFF --- diff --git a/tos/chips/msp430/adc12/Msp430RefVoltGeneratorP.nc b/tos/chips/msp430/adc12/Msp430RefVoltGeneratorP.nc index 267e214e..fe9ac285 100644 --- a/tos/chips/msp430/adc12/Msp430RefVoltGeneratorP.nc +++ b/tos/chips/msp430/adc12/Msp430RefVoltGeneratorP.nc @@ -129,10 +129,9 @@ implementation { if (m_state == GENERATOR_OFF) result = EALREADY; else if (m_state == REFERENCE_1_5V_STABLE || m_state == REFERENCE_2_5V_STABLE) { - if ((result = switchOff()) == SUCCESS) { - m_state = nextState; // m_state becomes a "XXX_OFF_PENDING" state - call SwitchOffTimer.startOneShot(SWITCHOFF_INTERVAL); - } + result = SUCCESS; + m_state = nextState; // m_state becomes a "XXX_OFF_PENDING" state + call SwitchOffTimer.startOneShot(SWITCHOFF_INTERVAL); } else if (m_state == REFERENCE_1_5V_ON_PENDING || m_state == REFERENCE_2_5V_ON_PENDING) { if ((result = switchOff()) == SUCCESS) { // there is a pending start() call @@ -184,7 +183,7 @@ implementation { event void SwitchOffTimer.fired() { switch (m_state) { - case REFERENCE_1_5V_STABLE: + case REFERENCE_1_5V_OFF_PENDING: if (switchOff() == SUCCESS){ m_state = GENERATOR_OFF; signal RefVolt_1_5V.stopDone(SUCCESS); @@ -194,7 +193,7 @@ implementation { } break; - case REFERENCE_2_5V_STABLE: + case REFERENCE_2_5V_OFF_PENDING: if (switchOff() == SUCCESS) { m_state = GENERATOR_OFF; signal RefVolt_2_5V.stopDone(SUCCESS);