mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-04-05 14:35:31 +00:00
Add an error display.
This commit is contained in:
parent
a3c25766c0
commit
b19c46ff2c
11 changed files with 74 additions and 3 deletions
|
|
@ -192,6 +192,12 @@ int CMMDVMHost::run()
|
|||
else if (!lockout && m_mode == MODE_LOCKOUT)
|
||||
setMode(MODE_IDLE);
|
||||
|
||||
bool error = m_modem->hasError();
|
||||
if (error && m_mode != MODE_ERROR)
|
||||
setMode(MODE_ERROR);
|
||||
else if (!error && m_mode == MODE_ERROR)
|
||||
setMode(MODE_IDLE);
|
||||
|
||||
unsigned char data[200U];
|
||||
unsigned int len;
|
||||
bool ret;
|
||||
|
|
@ -632,6 +638,18 @@ void CMMDVMHost::setMode(unsigned char mode, bool logging)
|
|||
m_modeTimer.stop();
|
||||
break;
|
||||
|
||||
case MODE_ERROR:
|
||||
if (logging)
|
||||
LogMessage("Mode set to Error");
|
||||
if (m_dstarNetwork != NULL)
|
||||
m_dstarNetwork->enable(false);
|
||||
if (m_dmrNetwork != NULL)
|
||||
m_dmrNetwork->enable(false);
|
||||
m_display->setError("MODEM");
|
||||
m_mode = MODE_ERROR;
|
||||
m_modeTimer.stop();
|
||||
break;
|
||||
|
||||
default:
|
||||
if (logging)
|
||||
LogMessage("Mode set to Idle");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue