Fix DMR timing bug with OscOffset.

This commit is contained in:
Jonathan Naylor 2016-03-23 17:46:21 +00:00
parent f656baf64e
commit 8d3ede9160
5 changed files with 20 additions and 18 deletions

View file

@ -210,11 +210,11 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
uint8_t dmrDelay = data[7U];
int8_t oscOffset = int8_t(data[8U]) - 128;
if (oscOffset < 0) {
m_sampleCount = 1000000U / uint32_t(-oscOffset);
m_sampleInsert = true;
} else if (oscOffset > 0) {
if (oscOffset > 0) {
m_sampleCount = 1000000U / uint32_t(oscOffset);
m_sampleInsert = true;
} else if (oscOffset < 0) {
m_sampleCount = 1000000U / uint32_t(-oscOffset);
m_sampleInsert = false;
} else {
m_sampleCount = 0U;