Simplify the mode pin code.

This commit is contained in:
Jonathan Naylor 2016-11-03 20:33:22 +00:00
parent 423af323ed
commit 81ec23eccc
1 changed files with 4 additions and 32 deletions

36
IO.cpp
View File

@ -320,38 +320,10 @@ void CIO::setADCDetection(bool detect)
void CIO::setMode()
{
#if defined(ARDUINO_MODE_PINS)
switch (m_modemState) {
case STATE_DSTAR:
setDStarInt(true);
setDMRInt(false);
setYSFInt(false);
setP25Int(false);
break;
case STATE_DMR:
setDStarInt(false);
setDMRInt(true);
setYSFInt(false);
setP25Int(false);
break;
case STATE_YSF:
setDStarInt(false);
setDMRInt(false);
setYSFInt(true);
setP25Int(false);
break;
case STATE_P25:
setDStarInt(false);
setDMRInt(false);
setYSFInt(false);
setP25Int(true);
break;
default:
setDStarInt(false);
setDMRInt(false);
setYSFInt(false);
setP25Int(false);
break;
}
setDStarInt(m_modemState == STATE_DSTAR);
setDMRInt(m_modemState == STATE_DMR);
setYSFInt(m_modemState == STATE_YSF);
setP25Int(m_modemState == STATE_P25);
#endif
}