bugfixes
This commit is contained in:
@@ -285,7 +285,18 @@ void loop(void)
|
||||
|
||||
uint32_t currentMillis = millis();
|
||||
|
||||
#ifdef DEVICE_MODE_TX
|
||||
#ifdef DEVICE_MODE_RX
|
||||
/*
|
||||
* This routine handles resync of TX/RX while hoppping frequencies
|
||||
*/
|
||||
radioNode.handleChannelDwell();
|
||||
|
||||
/*
|
||||
* Detect the moment when radio module stopped transmittig and put it
|
||||
* back in to receive state
|
||||
*/
|
||||
radioNode.handleTxDoneState(false);
|
||||
#else
|
||||
|
||||
//Process buttons
|
||||
button0.loop();
|
||||
@@ -314,21 +325,10 @@ void loop(void)
|
||||
txInput.restart();
|
||||
serialRestartMillis = currentMillis;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This routine handles resync of TX/RX while hoppping frequencies
|
||||
*/
|
||||
#ifdef DEVICE_MODE_RX
|
||||
radioNode.handleChannelDwell();
|
||||
radioNode.handleTxDoneState(true);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Detect the moment when radio module stopped transmittig and put it
|
||||
* back in to receive state
|
||||
*/
|
||||
radioNode.handleTxDoneState();
|
||||
|
||||
radioNode.readAndDecode(
|
||||
&qsp,
|
||||
&rxDeviceState,
|
||||
@@ -356,7 +356,7 @@ void loop(void)
|
||||
qsp.protocolState == QSP_STATE_IDLE &&
|
||||
qsp.lastTxSlotTimestamp + TX_TRANSMIT_SLOT_RATE < currentMillis
|
||||
) {
|
||||
|
||||
|
||||
int8_t frameToSend = getFrameToTransmit(&qsp);
|
||||
|
||||
#ifndef FORCE_TX_WITHOUT_INPUT
|
||||
|
||||
@@ -119,8 +119,9 @@ void RadioNode::handleChannelDwell(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void RadioNode::handleTxDoneState(void) {
|
||||
void RadioNode::handleTxDoneState(bool hop) {
|
||||
uint32_t currentMillis = millis();
|
||||
|
||||
if (
|
||||
currentMillis > nextTxCheckMillis &&
|
||||
deviceState == RADIO_STATE_TX &&
|
||||
@@ -130,9 +131,9 @@ void RadioNode::handleTxDoneState(void) {
|
||||
/*
|
||||
* In case of TX module, hop right now
|
||||
*/
|
||||
#ifdef DEVICE_MODE_TX
|
||||
hopFrequency(true, getChannel(), currentMillis);
|
||||
#endif
|
||||
if (hop) {
|
||||
hopFrequency(true, getChannel(), currentMillis);
|
||||
}
|
||||
|
||||
LoRa.receive();
|
||||
deviceState = RADIO_STATE_RX;
|
||||
|
||||
@@ -33,7 +33,7 @@ class RadioNode {
|
||||
uint8_t getChannel(void);
|
||||
uint32_t getChannelEntryMillis(void);
|
||||
void handleChannelDwell(void);
|
||||
void handleTxDoneState();
|
||||
void handleTxDoneState(bool hop);
|
||||
void handleTx(QspConfiguration_t *qsp);
|
||||
volatile int8_t bytesToRead = -1;
|
||||
volatile uint8_t deviceState = RADIO_STATE_RX;
|
||||
|
||||
Reference in New Issue
Block a user