[Tinyos-help] about nescc

Kecheng kecheng at cecs.pdx.edu
Wed Dec 12 14:42:59 PST 2007


Hi 

I wrote a simple pragrom, I modify the blink example, 
I define the clock interrupt function SIG_OUTPUT_COMPARE0(); then in the Realmain I will want to call this function.  I suppose that when I call this function in the RealMain, then the Clock.fire will be signaled.
Then I use nescc to convert the nesc file into c file, but I found the code
  SIG_OUTPUT_COMPARE0() {
    signal Clock.fire();
  }
was deleted by the compiler for optimization. Can anybody give me some help? or how can I close the nescc's optimization. Thanks

HPLClock:

module HPLClock {
  provides interface Clock;
}
implementation
{
 ........
**************************************************************
  default event result_t Clock.fire() { return SUCCESS; }
  SIG_OUTPUT_COMPARE0() {
    signal Clock.fire();
  }
**************************************************************
}

RealMain:
module RealMain {
}
implementation
{
 int main() __attribute__ ((C, spontaneous)) {
  SIG_OUTPUT_COMPARE0();
  }
 }
}





Kecheng
2007-12-12
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20071212/7a6fe400/attachment.htm


More information about the Tinyos-help mailing list