tp-freeforall / prod

TinyOS (less academic, more industrial, rD, less filling), still a floor wax
BSD 3-Clause "New" or "Revised" License
82 stars 37 forks source link

BusyWait does not work #13

Closed andresv closed 12 years ago

andresv commented 12 years ago

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 knows inner details.

BusyMicroTestC.nc


#include "printfZ1.h"

module BusyMicroTestC @safe() {
    uses {
        interface Leds;
        interface Boot;
        interface Timer<TMilli>;
        interface BusyWait<TMicro, uint16_t>;
        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


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;

}