4 #define PAYLOAD_TYPE_DATA 0
5 #define PAYLOAD_TYPE_CONTROL_SIGNALS 1
16 static uint8 radioComRxSignals = 0;
17 static uint8 radioComTxSignals = 0;
18 static uint8 lastRxSignals = 0;
19 static BIT sendSignalsSoon = 0;
30 #define TX_QUEUE_THRESHOLD 1
39 #define WAITING_TO_REPORT_RX_SIGNALS (radioComRxEnforceOrdering && radioComRxSignals != lastRxSignals)
41 static void receiveMorePackets(
void)
52 if (WAITING_TO_REPORT_RX_SIGNALS)
66 case PAYLOAD_TYPE_DATA:
73 rxBytesLeft = packet[0];
77 case PAYLOAD_TYPE_CONTROL_SIGNALS:
79 radioComRxSignals = packet[1];
83 if (WAITING_TO_REPORT_RX_SIGNALS)
105 receiveMorePackets();
113 uint8 tmp = *rxPointer;
117 if (rxBytesLeft == 0)
127 receiveMorePackets();
128 lastRxSignals = radioComRxSignals;
129 return lastRxSignals;
134 static void radioComSendDataNow()
136 *packetPointer = txBytesLoaded;
141 static void radioComSendControlSignalsNow()
150 packet[1] = radioComTxSignals;
172 if (txBytesLoaded != 0)
176 radioComSendDataNow();
181 radioComSendControlSignalsNow();
192 radioComSendDataNow();
219 if (txBytesLoaded == 0)
230 radioComSendDataNow();
237 if(controlSignals != radioComTxSignals)
239 radioComTxSignals = controlSignals;
uint8 XDATA * radioLinkTxCurrentPacket(void)
void radioComTxSendByte(uint8 byte)
uint8 radioComRxControlSignals(void)
uint8 radioComTxAvailable(void)
uint8 radioLinkRxCurrentPayloadType(void)
void radioComTxControlSignals(uint8 controlSignals)
void radioLinkRxDoneWithPacket(void)
void radioComTxService(void)
uint8 radioLinkTxQueued(void)
uint8 radioComRxReceiveByte(void)
BIT radioComRxEnforceOrdering
uint8 radioComRxAvailable(void)
uint8 radioLinkTxAvailable(void)
volatile BIT radioLinkResetPacketReceived
uint8 XDATA * radioLinkRxCurrentPacket(void)
#define RADIO_LINK_PAYLOAD_SIZE
void radioLinkTxSendPacket(uint8 payloadType)