Make m_dcd global variable and save extra function

This commit is contained in:
phl0 2016-11-17 14:05:19 +01:00
parent e3f35e0875
commit 230fab308c
No known key found for this signature in database
GPG Key ID: 48EA1E640798CA9A
6 changed files with 6 additions and 10 deletions

View File

@ -86,6 +86,7 @@ extern bool m_p25Enable;
extern bool m_duplex;
extern bool m_tx;
extern bool m_dcd;
extern uint32_t m_sampleCount;
extern bool m_sampleInsert;

6
IO.cpp
View File

@ -61,7 +61,6 @@ m_ysfTXLevel(128 * 128),
m_p25TXLevel(128 * 128),
m_ledCount(0U),
m_ledValue(true),
m_dcd(false),
m_detect(false),
m_adcOverflow(0U),
m_dacOverflow(0U),
@ -312,11 +311,6 @@ void CIO::setDecode(bool dcd)
m_dcd = dcd;
}
bool CIO::getDecode()
{
return m_dcd;
}
void CIO::setADCDetection(bool detect)
{
m_detect = detect;

1
IO.h
View File

@ -78,7 +78,6 @@ private:
uint32_t m_ledCount;
bool m_ledValue;
bool m_dcd;
bool m_detect;
uint16_t m_adcOverflow;

View File

@ -33,7 +33,8 @@ bool m_p25Enable = true;
bool m_duplex = true;
bool m_tx = false;
bool m_tx = false;
bool m_dcd = false;
uint32_t m_sampleCount = 0U;
bool m_sampleInsert = false;

View File

@ -30,7 +30,8 @@ bool m_p25Enable = true;
bool m_duplex = true;
bool m_tx = false;
bool m_tx = false;
bool m_dcd = false;
uint32_t m_sampleCount = 0U;
bool m_sampleInsert = false;

View File

@ -180,7 +180,7 @@ void CSerialPort::getStatus()
else
reply[10U] = 0U;
if (io.getDecode())
if (m_dcd)
reply[11U] = 1U;
else
reply[11U] = 0U;