X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Fchips%2Fcc2420%2Freceive%2FCC2420ReceiveP.nc;h=b50ad035a36a93e54086eb8bdaee2f68e1489988;hb=979965da13886883fe7399d60ff4d025f53bfd4c;hp=710d0d7e9d4757ccf80b098edf1210352b7ae1ab;hpb=03dcd5e45ed389e49e31c072c171dc5cf98fba76;p=tinyos-2.x.git diff --git a/tos/chips/cc2420/receive/CC2420ReceiveP.nc b/tos/chips/cc2420/receive/CC2420ReceiveP.nc index 710d0d7e..b50ad035 100644 --- a/tos/chips/cc2420/receive/CC2420ReceiveP.nc +++ b/tos/chips/cc2420/receive/CC2420ReceiveP.nc @@ -126,6 +126,10 @@ implementation { reset_state(); m_state = S_STARTED; atomic receivingPacket = FALSE; + /* Note: + We use the falling edge because the FIFOP polarity is reversed. + This is done in CC2420Power.startOscillator from CC2420ControlP.nc. + */ call InterruptFIFOP.enableFallingEdge(); } return SUCCESS; @@ -214,7 +218,7 @@ implementation { if(rxFrameLength <= MAC_PACKET_SIZE) { if(rxFrameLength > 0) { - if(rxFrameLength >= CC2420_SIZE) { + if(rxFrameLength > SACK_HEADER_LENGTH) { // This packet has an FCF byte plus at least one more byte to read call RXFIFO.continueRead(buf + 1, SACK_HEADER_LENGTH); @@ -334,7 +338,7 @@ implementation { metadata->lqi = buf[ length ] & 0x7f; metadata->rssi = buf[ length - 1 ]; - if(passesAddressCheck(m_p_rx_buf)) { + if (passesAddressCheck(m_p_rx_buf) && length >= CC2420_SIZE) { m_p_rx_buf = signal Receive.receive( m_p_rx_buf, m_p_rx_buf->data, length - CC2420_SIZE); }