simpliciti上面的源码
/* * Read the RXBYTES register from the radio. * Bit description of RXBYTES register: * bit 7 - RXFIFO_OVERFLOW, set if receive overflow occurred * bits 6:0 - NUM_BYTES, number of bytes in receive FIFO * * Due a chip bug, the RXBYTES register must read the same value twice * in a row to guarantee an accurate value. */ { uint8_t rxBytesVerify; rxBytesVerify = mrfiSpiReadReg( RXBYTES ); do { rxBytes = rxBytesVerify; rxBytesVerify = mrfiSpiReadReg( RXBYTES ); } while (rxBytes != rxBytesVerify); }
事实上我以前读RxByte读取一次,还是稳定的!不知道为什么这段代码要读两次?
还有个问题,按照常理,接收触发一次都应该清洗一次RXFIFO,(SFRX)。但协议栈接收中断居然没有?