Stop TX buffer overflows.

48kHz
Jonathan Naylor 2016-05-10 18:11:31 +01:00
parent 90ff130c51
commit c509f11c2a
6 changed files with 9 additions and 9 deletions

View File

@ -101,7 +101,7 @@ void CCWIdTX::process()
uint16_t space = io.getSpace(); uint16_t space = io.getSpace();
while (space > CYCLE_LENGTH && space < 1000U) { while (space > CYCLE_LENGTH && space <= TX_RINGBUFFER_SIZE) {
bool b = READ_BIT1(m_poBuffer, m_poPtr); bool b = READ_BIT1(m_poBuffer, m_poPtr);
if (b) if (b)
io.write(TONE, CYCLE_LENGTH); io.write(TONE, CYCLE_LENGTH);

View File

@ -113,7 +113,7 @@ void CDMRTX::process()
if (m_poLen > 0U) { if (m_poLen > 0U) {
uint16_t space = io.getSpace(); uint16_t space = io.getSpace();
while (space > (4U * DMR_RADIO_SYMBOL_LENGTH) && space < 1000U) { while (space > (4U * DMR_RADIO_SYMBOL_LENGTH) && space <= TX_RINGBUFFER_SIZE) {
uint8_t c = m_poBuffer[m_poPtr]; uint8_t c = m_poBuffer[m_poPtr];
uint8_t m = m_markBuffer[m_poPtr]; uint8_t m = m_markBuffer[m_poPtr];
m_poPtr++; m_poPtr++;

View File

@ -266,7 +266,7 @@ void CDStarTX::process()
if (m_poLen > 0U) { if (m_poLen > 0U) {
uint16_t space = io.getSpace(); uint16_t space = io.getSpace();
while (space > (8U * DSTAR_RADIO_BIT_LENGTH) && space < 1000U) { while (space > (8U * DSTAR_RADIO_BIT_LENGTH) && space <= TX_RINGBUFFER_SIZE) {
uint8_t c = m_poBuffer[m_poPtr++]; uint8_t c = m_poBuffer[m_poPtr++];
writeByte(c); writeByte(c);

View File

@ -64,6 +64,9 @@ const uint8_t MARK_NONE = 0x00U;
const uint16_t RX_BLOCK_SIZE = 2U; const uint16_t RX_BLOCK_SIZE = 2U;
const uint16_t TX_RINGBUFFER_SIZE = 500U;
const uint16_t RX_RINGBUFFER_SIZE = 600U;
extern MMDVM_STATE m_modemState; extern MMDVM_STATE m_modemState;
extern bool m_dstarEnable; extern bool m_dstarEnable;

7
IO.cpp
View File

@ -36,9 +36,6 @@ const uint16_t GMSK_FILTER_LEN = 12U;
const uint16_t DC_OFFSET = 2048U; const uint16_t DC_OFFSET = 2048U;
const uint16_t TX_BUFFER_SIZE = 501U;
const uint16_t RX_BUFFER_SIZE = 601U;
#if defined(__SAM3X8E__) #if defined(__SAM3X8E__)
// An Arduino Due // An Arduino Due
#if defined(ARDUINO_DUE_PAPA) #if defined(ARDUINO_DUE_PAPA)
@ -105,8 +102,8 @@ m_pinDAC(PIN_DAC),
m_ticker(), m_ticker(),
#endif #endif
m_started(false), m_started(false),
m_rxBuffer(RX_BUFFER_SIZE), m_rxBuffer(RX_RINGBUFFER_SIZE),
m_txBuffer(TX_BUFFER_SIZE), m_txBuffer(TX_RINGBUFFER_SIZE),
m_C4FSKFilter(), m_C4FSKFilter(),
m_GMSKFilter(), m_GMSKFilter(),
m_C4FSKState(), m_C4FSKState(),

View File

@ -78,7 +78,7 @@ void CYSFTX::process()
if (m_poLen > 0U) { if (m_poLen > 0U) {
uint16_t space = io.getSpace(); uint16_t space = io.getSpace();
while (space > (4U * YSF_RADIO_SYMBOL_LENGTH) && space < 1000U) { while (space > (4U * YSF_RADIO_SYMBOL_LENGTH) && space <= TX_RINGBUFFER_SIZE) {
uint8_t c = m_poBuffer[m_poPtr++]; uint8_t c = m_poBuffer[m_poPtr++];
writeByte(c); writeByte(c);