mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-10-18 01:34:10 +02:00
Adding watchdog to host serial port
This commit is contained in:
@@ -386,6 +386,11 @@ void CIO::resetWatchdog()
|
|||||||
m_watchdog = 0U;
|
m_watchdog = 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t CIO::getWatchdog()
|
||||||
|
{
|
||||||
|
return m_watchdog;
|
||||||
|
}
|
||||||
|
|
||||||
bool CIO::hasLockout() const
|
bool CIO::hasLockout() const
|
||||||
{
|
{
|
||||||
return m_lockout;
|
return m_lockout;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public:
|
|||||||
bool hasLockout() const;
|
bool hasLockout() const;
|
||||||
|
|
||||||
void resetWatchdog();
|
void resetWatchdog();
|
||||||
|
uint32_t getWatchdog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_started;
|
bool m_started;
|
||||||
|
|||||||
@@ -421,6 +421,10 @@ void CSerialPort::process()
|
|||||||
m_ptr = 1U;
|
m_ptr = 1U;
|
||||||
m_len = 0U;
|
m_len = 0U;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
m_ptr = 0U;
|
||||||
|
m_len = 0U;
|
||||||
|
}
|
||||||
} else if (m_ptr == 1U) {
|
} else if (m_ptr == 1U) {
|
||||||
// Handle the frame length
|
// Handle the frame length
|
||||||
m_len = m_buffer[m_ptr] = c;
|
m_len = m_buffer[m_ptr] = c;
|
||||||
@@ -663,6 +667,11 @@ void CSerialPort::process()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (io.getWatchdog() >= 48000U) {
|
||||||
|
m_ptr = 0U;
|
||||||
|
m_len = 0U;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(SERIAL_REPEATER)
|
#if defined(SERIAL_REPEATER)
|
||||||
// Write any outgoing serial data
|
// Write any outgoing serial data
|
||||||
uint16_t space = m_repeat.getData();
|
uint16_t space = m_repeat.getData();
|
||||||
|
|||||||
Reference in New Issue
Block a user