Hi everybody,

The following snippet is in CC2420ReceiveP.nc.

*  void waitForNextPacket() {*
*    atomic {*
*      if ( m_state == S_STOPPED ) {*
*        call SpiResource.release();*
*        return;*
*      }*
*      *
*      atomic receivingPacket = FALSE;*
*      *
*      /**
*       * The FIFOP pin here is high when there are 0 bytes in the RX FIFO*
*       * and goes low as soon as there are bytes in the RX FIFO.  The pin*
*       * is inverted from what the datasheet says, and its threshold is
127.*
*       * Whenever the FIFOP line goes low, as you can see from the
interrupt*
*       * handler elsewhere in this module, it means we received a new
packet.*
*       * If the line stays low without generating an interrupt, that means*
*       * there's still more data to be received.*
*       */*
*      if ( ( m_missed_packets && call FIFO.get() ) || !call FIFOP.get() ) {
*
*        // A new packet is buffered up and ready to go*
*        if ( m_missed_packets ) {*
*          m_missed_packets--;*
*        }*
* beginReceive();*
*      } else {*
*        // Wait for the next packet to arrive*
*        m_state = S_STARTED;*
*        m_missed_packets = 0;*
*        call SpiResource.release();*
*      }*
*    }*
*  }*

The statement in red checks if there is more frames buffered in RXFIFO. Why
not use
*if (call FIFO.get()) {*
?
Thanks in advance and await your explanation.

-- TelosB
-Xiaohui Liu
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to