这个是我一个板子下的发射端。。另一个板子在SmartRF Studio 7模拟接收时出现的波形图,,这边红灯亮(发射数据)。就会出现波峰,,但是接收端接受不到数据。
下面是接收函数
INT8U rf_rec_packet(INT8U* pData, INT8U* pRssi, INT8U* pLqi, INT8U timeOut)
{
index = 0;
length = 0;
RFTXRXIF = 0;
IEN0 |= 0x01; //ENABLE rxtx interrupt
IEN0 |= 0x80; //enable global interrupt
RFIF = RFIF & ~IRQ_DONE;
pPayload = pData;
pRssiVal = pRssi;
pLqiVal = pLqi;
*pRssiVal = 0x00;
*pLqiVal = 0x00;
lengthReceived = FALSE;
isLengthByte = TRUE;
SRX();
while(1);
while(!(RFIF & IRQ_DONE))
{
if(timeOut)
{
halWait(1);
timeOut--;
}
else
{
if(lengthReceived == TRUE)
{
timeOut = 255;
lengthReceived = FALSE;
}
else
{
SIDLE();
IEN0 &= ~0x01; //disable rxtx interrupt
return 0;
}
}
}
SIDLE();
RFIF &= ~IRQ_DONE;
IEN0 &= ~0x01;
if(*pLqi & 0x80)
{
return index-1;
}
else
{
return 0;
}
}
主要的是接收方没有进入到中断里面。。 程序到底是哪里出现了问题。。望指导。
|