Allow transmit within 2 seconds of cycle start

This commit is contained in:
Jordan Sherer 2018-07-09 16:36:08 -04:00
parent f44b1154b7
commit 42a8338d1c

View File

@ -3956,9 +3956,9 @@ void MainWindow::startTx()
ui->rbNextFreeTextMsg->setChecked(true); ui->rbNextFreeTextMsg->setChecked(true);
if (m_transmitting) m_restart=true; if (m_transmitting) m_restart=true;
// detect if we're currently in a possible transmit cycle...and if so, wait until the next one... // detect if we're currently in a possible transmit cycle...and if so, wait until the next one if we're more than 2 seconds in...
QDateTime now {QDateTime::currentDateTimeUtc()}; QDateTime now {QDateTime::currentDateTimeUtc()};
int s=now.time().second(); int s=now.addSecs(-2).time().second();
int n=s % (2*m_TRperiod); int n=s % (2*m_TRperiod);
if((n <= m_TRperiod && m_txFirst) || (n > m_TRperiod && !m_txFirst)){ if((n <= m_TRperiod && m_txFirst) || (n > m_TRperiod && !m_txFirst)){
ui->txFirstCheckBox->setChecked(!m_txFirst); ui->txFirstCheckBox->setChecked(!m_txFirst);