Adding watchdog to host serial port

This commit is contained in:
Andy CA6JAU 2017-08-20 12:24:12 -03:00
parent a570b43f19
commit c74b374636
3 changed files with 15 additions and 1 deletions

View file

@ -406,6 +406,10 @@ void CSerialPort::process()
m_ptr = 1U;
m_len = 0U;
}
else {
m_ptr = 0U;
m_len = 0U;
}
} else if (m_ptr == 1U) {
// Handle the frame length
m_len = m_buffer[m_ptr] = c;
@ -645,6 +649,11 @@ void CSerialPort::process()
}
}
if (io.getWatchdog() >= 48000U) {
m_ptr = 0U;
m_len = 0U;
}
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
// Drain any incoming serial data
while (availableInt(3U))