RadioState removed

This commit is contained in:
Pawel Spychalski
2018-05-16 13:36:22 +02:00
parent 0079264128
commit 948cc7915b
9 changed files with 49 additions and 64 deletions

View File

@@ -36,7 +36,6 @@ static uint8_t RadioNode::getPrevChannel(uint8_t channel) {
}
void RadioNode::readAndDecode(
volatile RadioState_t *radioState,
QspConfiguration_t *qsp,
RxDeviceState_t *rxDeviceState,
TxDeviceState_t *txDeviceState
@@ -91,4 +90,25 @@ void RadioNode::handleChannelDwell(void) {
hopFrequency(false, getChannel(), getChannelEntryMillis() + RX_CHANNEL_DWELL_TIME); //Start jumping in opposite direction to resync
LoRa.receive();
}
}
void RadioNode::handleTxDoneState(void) {
uint32_t currentMillis = millis();
if (
currentMillis > nextTxCheckMillis &&
deviceState == RADIO_STATE_TX &&
!LoRa.isTransmitting()
) {
/*
* In case of TX module, hop right now
*/
#ifdef DEVICE_MODE_TX
hopFrequency(true, getChannel(), currentMillis);
#endif
LoRa.receive();
deviceState = RADIO_STATE_RX;
nextTxCheckMillis = currentMillis + 1; //We check of TX done every 1ms
}
}