]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/tmicore/MoteClockP.nc
Volatile keyword tricks GCC into not optimizing out busy wait loop.
[tinyos-2.x.git] / tos / platforms / tmicore / MoteClockP.nc
index 68dcdd06e0ec42ddf417ff22ef16846f2106b60a..a9a976845eedbcf3838f14c2b3d5d9023d6a3f98 100644 (file)
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
  /**
  * @author R. Steve McKown <rsmckown@gmail.com>
  */
+
 #include "Msp430Timer.h"
 
 module MoteClockP {
@@ -41,7 +41,7 @@ module MoteClockP {
 implementation {
   command error_t Init.init()
   {
-    uint16_t i;
+    volatile uint16_t i;
 
 #if defined (CALDCO_8MHZ_) && !defined(__DisableCalData)
     if (CALBC1_8MHZ != 0xff || CALDCO_8MHZ != 0xff) {