Jitter slots insert should be always multiple of 6 to avoid break DMR sequence

This commit is contained in:
Andy CA6JAU 2018-02-09 14:49:18 -03:00
parent 88273f3f3b
commit 051f8c46e3

View file

@ -30,6 +30,7 @@
#include <ctime>
#include <algorithm>
#include <cstdint>
#include <cmath>
unsigned int CDMRSlot::m_colorCode = 0U;
@ -1835,7 +1836,9 @@ void CDMRSlot::init(unsigned int colorCode, bool embeddedLCOnly, bool dumpTAData
m_rssiMapper = rssiMapper;
m_jitterTime = jitter;
m_jitterSlots = jitter / DMR_SLOT_TIME;
float jitter_tmp = float(jitter) / 360.0F;
m_jitterSlots = (unsigned int) (std::ceil(jitter_tmp) * 6.0F);
m_idle = new unsigned char[DMR_FRAME_LENGTH_BYTES + 2U];
::memcpy(m_idle, DMR_IDLE_DATA, DMR_FRAME_LENGTH_BYTES + 2U);