Add an error display.

This commit is contained in:
Jonathan Naylor
2016-03-21 22:47:58 +00:00
parent a3c25766c0
commit b19c46ff2c
11 changed files with 74 additions and 3 deletions

View File

@@ -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");