mirror of
https://github.com/g4klx/MMDVM_HS.git
synced 2026-01-09 10:09:57 +01:00
Adding watchdog to host serial port
This commit is contained in:
parent
a570b43f19
commit
c74b374636
4
IO.cpp
4
IO.cpp
|
|
@ -266,3 +266,7 @@ void CIO::resetWatchdog()
|
|||
m_watchdog = 0U;
|
||||
}
|
||||
|
||||
uint32_t CIO::getWatchdog()
|
||||
{
|
||||
return m_watchdog;
|
||||
}
|
||||
|
|
|
|||
3
IO.h
3
IO.h
|
|
@ -81,7 +81,8 @@ public:
|
|||
void interrupt2(void);
|
||||
#endif
|
||||
void resetWatchdog(void);
|
||||
|
||||
uint32_t getWatchdog(void);
|
||||
|
||||
#if defined(BIDIR_DATA_PIN)
|
||||
void Data_dir_out(bool dir);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in a new issue