Skip to content

Commit

Permalink
Add timer to return from CW Ident
Browse files Browse the repository at this point in the history
  • Loading branch information
phl0 committed Sep 15, 2016
1 parent 4e1b002 commit 2877502
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const unsigned char MODE_IDLE = 0U;
const unsigned char MODE_DSTAR = 1U;
const unsigned char MODE_DMR = 2U;
const unsigned char MODE_YSF = 3U;
const unsigned char MODE_CW = 4U;
const unsigned char MODE_LOCKOUT = 99U;
const unsigned char MODE_ERROR = 100U;

Expand Down
8 changes: 8 additions & 0 deletions Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ void CDisplay::clearFusion()

void CDisplay::writeCW()
{
m_timer1.start();
m_mode1 = MODE_CW;

writeCWInt();
}

Expand All @@ -180,6 +183,11 @@ void CDisplay::clock(unsigned int ms)
m_mode1 = MODE_IDLE;
m_timer1.stop();
break;
case MODE_CW:
clearCWInt();
m_mode1 = MODE_IDLE;
m_timer1.stop();
break;
default:
break;
}
Expand Down
2 changes: 2 additions & 0 deletions Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class CDisplay
void clearFusion();

void writeCW();
void clearCW();

virtual void close() = 0;

Expand All @@ -65,6 +66,7 @@ class CDisplay
virtual void clearFusionInt() = 0;

virtual void writeCWInt() = 0;
virtual void clearCWInt() = 0;

virtual void clockInt(unsigned int ms);

Expand Down
2 changes: 1 addition & 1 deletion MMDVMHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@ int CMMDVMHost::run()
if (m_cwIdTimer.isRunning() && m_cwIdTimer.hasExpired()) {
if (m_mode == MODE_IDLE && !m_modem->hasTX()){
LogDebug("sending CW ID");
m_display->writeCW();
m_modem->sendCWId(m_callsign);
m_display->setIdle();

m_cwIdTimer.start(); //reset only after sending ID, timer-overflow after 49 days doesnt matter
}
Expand Down
9 changes: 9 additions & 0 deletions Nextion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,15 @@ void CNextion::writeCWInt()

sendCommand(command);
sendCommand("t1.txt=\"Sending CW Ident\"");

m_clockDisplayTimer.stop();

m_mode = MODE_CW;
}

void CNextion::clearCWInt()
{
setIdleInt();
}

void CNextion::clockInt(unsigned int ms)
Expand Down
1 change: 1 addition & 0 deletions Nextion.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class CNextion : public CDisplay
virtual void clearFusionInt();

virtual void writeCWInt();
virtual void clearCWInt();

virtual void clockInt(unsigned int ms);

Expand Down
4 changes: 4 additions & 0 deletions NullDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ void CNullDisplay::writeCWInt()
{
}

void CNullDisplay::clearCWInt()
{
}

void CNullDisplay::close()
{
}
1 change: 1 addition & 0 deletions NullDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class CNullDisplay : public CDisplay
virtual void clearFusionInt();

virtual void writeCWInt();
virtual void clearCWInt();

private:
};
Expand Down
4 changes: 4 additions & 0 deletions TFTSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ void CTFTSerial::writeCWInt()
{
}

void CTFTSerial::clearCWInt()
{
}

void CTFTSerial::close()
{
m_serial.close();
Expand Down
1 change: 1 addition & 0 deletions TFTSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class CTFTSerial : public CDisplay
virtual void clearFusionInt();

virtual void writeCWInt();
virtual void clearCWInt();

private:
std::string m_callsign;
Expand Down

0 comments on commit 2877502

Please sign in to comment.