tp-freeforall/prod — Issue #13: BusyWait does not work
Author: andresv
Created: 2011-12-13 20:04:41+00:00
State: open

I did a little test with BusyWait and MSP430F2418. Basically platform definition is copied from Z1.
It seems that BusyWait never returns.
I analyzed the output with logic analyzer and it did not toggled within at least 10 seconds.

However similar code worked with Sownet tinyos toolchain with old mspgcc 3.2.3. Unfortunately as far as I know this repository is not public.
Not sure, but perhaps [mkonstapel](https://github.com/mkonstapel) knows inner details.

**BusyMicroTestC.nc**

```c

#include "printfZ1.h"

module BusyMicroTestC @safe() {
uses {
interface Leds;
interface Boot;
interface Timer;
interface BusyWait;
interface GeneralIO as SCLK;

}
}
implementation {
event void Boot.booted() {
printfz1_init();
//call Timer.startPeriodic(4096);
call Leds.led1Toggle();

printfz1("booted\n");

call SCLK.makeOutput();
while (1) {
call Leds.led2Toggle();
call SCLK.toggle();
call BusyWait.wait(1);
}
}

event void Timer.fired() {
}
}

```

**BusyMicroTestAppC.nc**

```c

configuration BusyMicroTestAppC {}
implementation {

components MainC, BusyMicroTestC as App, LedsC;
App.Boot -> MainC.Boot;
App.Leds -> LedsC;

components new TimerMilliC() as Timer;
App.Timer -> Timer;

components BusyWaitMicroC;
App.BusyWait -> BusyWaitMicroC;

components HplMsp430GeneralIOC as GeneralIOC;
components new Msp430GpioC() as SCLKM;
SCLKM -> GeneralIOC.Port26;
App.SCLK -> SCLKM;

}
```