📄 cc2420run.c
字号:
#include <msp430x16x.h>
#include "cc2420init.h"
#include "cc2420const.h"
#include "port_config_CC2420.h"
#define ok 1;
int data[20];
int HPLCC2420_readRXFIFO()
{
int RevLen,i=0;
PHY_Selected();
// clear the RX flag if set
isTxIntrPending();
SPI_Rx(); //isRxIntrPending();
SPI_Tx(CC2420_RXFIFO |CMD_READ);
while(!(isRxIntrPending())) ;
SPI_Rx();
SPI_Tx(0);
while(!(isRxIntrPending())) ;
// get the length of the buffer
RevLen = SPI_Rx();
while(!(RevLen==0))
{
SPI_Tx(0);
while(!(isRxIntrPending())) ;
data[i++]=SPI_Rx();
RevLen--;
}
flushRxfifo();
P5OUT^=0X40;
return ok;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -