So I guess my question is...is signal tantamount to an interrupt,
or is it 'just' a function call? E.g, here's an interrupt routine
that I cobbled together in cargo-cult fashion which does a 'callback'
to a user "async event":

  default async event result_t HPLT3capture.fire( uint16_t count )
  { return SUCCESS; }

  TOSH_INTERRUPT(SIG_INPUT_CAPTURE3)
  {
    // ...do interrupt stuff...
    // warn user
    signal HPLT3capture.fire( count );
  }

Does fire() run in the original interrupt context or as a separate
"software interrupt"? If it runs in the original context can I do
        rval = signal HPLT3capture.fire( count );
to get its result?

thx
MS






Philip Levis wrote:

On Nov 13, 2007, at 10:52 AM, Michael Schippling wrote:

My personal belief is that it is like "call" in that no direct return
value is available to the user. My further belief is that the signaled
code is run asynch, so the signaler does not block waiting for it.

I could be wrong (probably) so I hope someone who actually knows will help

Events can have return values:

interface CsmaBackoff
{
  /**
   * Return initial backoff time before attempting to send message m. The
   * units are radio dependent.
   * @return Initial backoff time
   */
  async event uint16_t initial(message_t* m);

  /**
* Return backoff time after message m could not be send due to congestion.
   * The units are raio dependent.
   * @return Backoff time after congestion
   */
  async event uint16_t congestion(message_t* m);
}

Not all events are async:

interface Read<val_t> {
  /**
   * Initiates a read of the value.
   *
   * @return SUCCESS if a readDone() event will eventually come back.
   */
  command error_t read();

  /**
   * Signals the completion of the read().
   *
   * @param result SUCCESS if the read() was successful
   * @param val the value that has been read
   */
  event void readDone( error_t result, val_t val );
}

Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to