Small tweaks.

c4fmdemod
Jonathan Naylor 2016-12-30 11:34:31 +00:00
parent 52fbd4f6ce
commit fca53dc67e
4 changed files with 8 additions and 10 deletions

View File

@ -24,8 +24,8 @@
CCalRSSI::CCalRSSI() :
m_count(0U),
m_accum(0U),
m_min(0xFFFFFFU),
m_max(0x000000U)
m_min(0xFFFFU),
m_max(0x0000U)
{
}
@ -57,8 +57,8 @@ void CCalRSSI::samples(const uint16_t* rssi, uint8_t length)
m_count = 0U;
m_accum = 0U;
m_min = 0xFFFFFFU;
m_max = 0x000000U;
m_min = 0xFFFFU;
m_max = 0x0000U;
}
}
}

View File

@ -88,8 +88,6 @@ void CDMRDMORX::samples(const q15_t* samples, const uint16_t* rssi, uint8_t leng
bool CDMRDMORX::processSample(q15_t sample, uint16_t rssi)
{
uint16_t rssi_avg;
m_buffer[m_dataPtr] = sample;
m_rssi[m_dataPtr] = rssi;
@ -194,7 +192,7 @@ bool CDMRDMORX::processSample(q15_t sample, uint16_t rssi)
// Send RSSI data approximately every second
if (m_rssiCount == 2U) {
// Calculate RSSI average over a burst period. We don't take into account 2.5 ms at the beginning and 2.5 ms at the end
rssi_avg = avgRSSI(m_startPtr + DMR_SYNC_LENGTH_SAMPLES / 2U, DMR_FRAME_LENGTH_SAMPLES - DMR_SYNC_LENGTH_SAMPLES);
uint16_t rssi_avg = avgRSSI(m_startPtr + DMR_SYNC_LENGTH_SAMPLES / 2U, DMR_FRAME_LENGTH_SAMPLES - DMR_SYNC_LENGTH_SAMPLES);
frame[34U] = (rssi_avg >> 8) & 0xFFU;
frame[35U] = (rssi_avg >> 0) & 0xFFU;
serial.writeDMRData(true, frame, DMR_FRAME_LENGTH_BYTES + 3U);

View File

@ -96,8 +96,6 @@ void CDMRSlotRX::reset()
bool CDMRSlotRX::processSample(q15_t sample, uint16_t rssi)
{
uint16_t rssi_avg;
m_delayPtr++;
if (m_delayPtr < m_delay)
return m_state != DMRRXS_NONE;
@ -199,7 +197,7 @@ bool CDMRSlotRX::processSample(q15_t sample, uint16_t rssi)
// Send RSSI data approximately every second
if (m_rssiCount == 2U) {
// Calculate RSSI average over a burst period. We don't take into account 2.5 ms at the beginning and 2.5 ms at the end
rssi_avg = avgRSSI(m_startPtr + DMR_SYNC_LENGTH_SAMPLES / 2U, DMR_FRAME_LENGTH_SAMPLES - DMR_SYNC_LENGTH_SAMPLES);
uint16_t rssi_avg = avgRSSI(m_startPtr + DMR_SYNC_LENGTH_SAMPLES / 2U, DMR_FRAME_LENGTH_SAMPLES - DMR_SYNC_LENGTH_SAMPLES);
frame[34U] = (rssi_avg >> 8) & 0xFFU;
frame[35U] = (rssi_avg >> 0) & 0xFFU;
serial.writeDMRData(m_slot, frame, DMR_FRAME_LENGTH_BYTES + 3U);

View File

@ -239,6 +239,7 @@
<File name="DMRDMOTX.cpp" path="DMRDMOTX.cpp" type="1"/>
<File name="DMRRX.cpp" path="DMRRX.cpp" type="1"/>
<File name="YSFRX.cpp" path="YSFRX.cpp" type="1"/>
<File name="CalRSSI.cpp" path="CalRSSI.cpp" type="1"/>
<File name="STM32F4XX_Lib/Device/stm32f4xx.h" path="STM32F4XX_Lib/Device/stm32f4xx.h" type="1"/>
<File name="SampleRB.cpp" path="SampleRB.cpp" type="1"/>
<File name="CalDStarTX.h" path="CalDStarTX.h" type="1"/>
@ -261,6 +262,7 @@
<File name="SampleRB.h" path="SampleRB.h" type="1"/>
<File name="YSFTX.h" path="YSFTX.h" type="1"/>
<File name="DMRRX.h" path="DMRRX.h" type="1"/>
<File name="CalRSSI.h" path="CalRSSI.h" type="1"/>
<File name="IOTeensy.cpp" path="IOTeensy.cpp" type="1"/>
<File name="MMDVM.cpp" path="MMDVM.cpp" type="1"/>
<File name="STM32F4XX_Lib/CMSIS/Include/core_cmSimd.h" path="STM32F4XX_Lib/CMSIS/Include/core_cmSimd.h" type="1"/>