如下macMcuInit函数已经MAC_RADIO_TURN_ON_AUTO_ACK();
rxStartIsr函数下的三个函数分别是什么意思?
MAC_RADIO_TX_ACK_PEND();
MAC_RADIO_TX_ACK();
MAC_RADIO_REQUEST_ACK_TX_DONE_CALLBACK();
MAC_RX_FLAG_ACK_PENDING 是什么意思?
MAC_INTERNAL_API void macMcuInit(void)
{
……
/* Turn on autoack */
MAC_RADIO_TURN_ON_AUTO_ACK();
……
}
static void rxStartIsr(void)
……
/*——————————————————————————-
* Process any ACK request.
*/
if (macRxOutgoingAckFlag)
{
halIntState_t s;
/*
* This critical section ensures that the callback ISR is initiated within time
* to guarantee correlation with the strobe.
*/
HAL_ENTER_CRITICAL_SECTION(s);
/* Do not ack data packet with pending more data */
if( MAC_FRAME_TYPE(&rxBuf[1]) == MAC_FRAME_TYPE_COMMAND )
{
……
}
if( ackWithPending == MAC_RX_FLAG_ACK_PENDING )
{
MAC_RADIO_TX_ACK_PEND();
}
else
{
MAC_RADIO_TX_ACK();
}
/* request a callback to macRxAckTxDoneCallback() when the ACK transmit has finished */
MAC_RADIO_REQUEST_ACK_TX_DONE_CALLBACK();
HAL_EXIT_CRITICAL_SECTION(s);
}
}
huazhen zheng:
回复 Alvin Chen:
这个跑的是zigbee,但问题是同一套代码下mac层。