Add FM mode display.
This commit is contained in:
parent
c381f2ceac
commit
dcdfca39d7
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -76,6 +76,10 @@ void CCASTInfo::setQuitInt()
|
|||
{
|
||||
}
|
||||
|
||||
void CCASTInfo::setFMInt()
|
||||
{
|
||||
}
|
||||
|
||||
void CCASTInfo::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
|
||||
{
|
||||
if (m_modem != NULL)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -40,6 +40,7 @@ protected:
|
|||
virtual void setErrorInt(const char* text);
|
||||
virtual void setLockoutInt();
|
||||
virtual void setQuitInt();
|
||||
virtual void setFMInt();
|
||||
|
||||
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
|
||||
virtual void clearDStarInt();
|
||||
|
|
|
@ -26,6 +26,9 @@ const unsigned char MODE_YSF = 3U;
|
|||
const unsigned char MODE_P25 = 4U;
|
||||
const unsigned char MODE_NXDN = 5U;
|
||||
const unsigned char MODE_POCSAG = 6U;
|
||||
|
||||
const unsigned char MODE_FM = 10U;
|
||||
|
||||
const unsigned char MODE_CW = 98U;
|
||||
const unsigned char MODE_LOCKOUT = 99U;
|
||||
const unsigned char MODE_ERROR = 100U;
|
||||
|
|
14
Display.cpp
14
Display.cpp
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -101,6 +101,17 @@ void CDisplay::setQuit()
|
|||
setQuitInt();
|
||||
}
|
||||
|
||||
void CDisplay::setFM()
|
||||
{
|
||||
m_timer1.stop();
|
||||
m_timer2.stop();
|
||||
|
||||
m_mode1 = MODE_FM;
|
||||
m_mode2 = MODE_FM;
|
||||
|
||||
setFMInt();
|
||||
}
|
||||
|
||||
void CDisplay::writeDStar(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
|
||||
{
|
||||
assert(my1 != NULL);
|
||||
|
@ -190,6 +201,7 @@ void CDisplay::writeDMRBER(unsigned int slotNo, float ber)
|
|||
{
|
||||
writeDMRBERInt(slotNo, ber);
|
||||
}
|
||||
|
||||
void CDisplay::clearDMR(unsigned int slotNo)
|
||||
{
|
||||
if (slotNo == 1U) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -42,6 +42,7 @@ public:
|
|||
void setLockout();
|
||||
void setError(const char* text);
|
||||
void setQuit();
|
||||
void setFM();
|
||||
|
||||
void writeDStar(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
|
||||
void writeDStarRSSI(unsigned char rssi);
|
||||
|
@ -87,6 +88,7 @@ protected:
|
|||
virtual void setLockoutInt() = 0;
|
||||
virtual void setErrorInt(const char* text) = 0;
|
||||
virtual void setQuitInt() = 0;
|
||||
virtual void setFMInt() = 0;
|
||||
|
||||
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector) = 0;
|
||||
virtual void writeDStarRSSIInt(unsigned char rssi);
|
||||
|
|
31
HD44780.cpp
31
HD44780.cpp
|
@ -399,6 +399,37 @@ void CHD44780::setQuitInt()
|
|||
m_dmr = false;
|
||||
}
|
||||
|
||||
void CHD44780::setIdleInt()
|
||||
{
|
||||
m_clockDisplayTimer.stop();
|
||||
::lcdClear(m_fd);
|
||||
|
||||
#ifdef ADAFRUIT_DISPLAY
|
||||
adafruitLCDColour(AC_WHITE);
|
||||
#endif
|
||||
|
||||
if (m_pwm) {
|
||||
if (m_pwmPin != 1U)
|
||||
::softPwmWrite(m_pwmPin, m_pwmDim);
|
||||
else
|
||||
::pwmWrite(m_pwmPin, (m_pwmDim / 100) * 1024);
|
||||
}
|
||||
|
||||
// Print callsign and ID at on top row for all screen sizes
|
||||
::lcdPosition(m_fd, 0, 0);
|
||||
::lcdPrintf(m_fd, "%-6s", m_callsign.c_str());
|
||||
::lcdPosition(m_fd, m_cols - 7, 0);
|
||||
::lcdPrintf(m_fd, "%7u", m_dmrid);
|
||||
|
||||
// Print MMDVM and Idle on bottom row for all screen sizes
|
||||
::lcdPosition(m_fd, 0, m_rows - 1);
|
||||
::lcdPuts(m_fd, "MMDVM");
|
||||
::lcdPosition(m_fd, m_cols - 4, m_rows - 1);
|
||||
::lcdPuts(m_fd, "FM"); // Gets overwritten by clock on 2 line screen
|
||||
|
||||
m_dmr = false;
|
||||
}
|
||||
|
||||
void CHD44780::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
|
||||
{
|
||||
assert(my1 != NULL);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX & Tony Corbett G0WFV
|
||||
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX & Tony Corbett G0WFV
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -101,6 +101,7 @@ protected:
|
|||
virtual void setErrorInt(const char* text);
|
||||
virtual void setLockoutInt();
|
||||
virtual void setQuitInt();
|
||||
virtual void setFMInt();
|
||||
|
||||
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
|
||||
virtual void writeDStarRSSIInt(unsigned char rssi);
|
||||
|
|
19
LCDproc.cpp
19
LCDproc.cpp
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2017,2018 by Tony Corbett G0WFV
|
||||
* Copyright (C) 2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -241,6 +241,23 @@ void CLCDproc::setQuitInt()
|
|||
m_dmr = false;
|
||||
}
|
||||
|
||||
void CLCDproc::setFMInt()
|
||||
{
|
||||
m_clockDisplayTimer.stop(); // Stop the clock display
|
||||
|
||||
if (m_screensDefined) {
|
||||
socketPrintf(m_socketfd, "screen_set DStar -priority hidden");
|
||||
socketPrintf(m_socketfd, "screen_set DMR -priority hidden");
|
||||
socketPrintf(m_socketfd, "screen_set YSF -priority hidden");
|
||||
socketPrintf(m_socketfd, "screen_set P25 -priority hidden");
|
||||
socketPrintf(m_socketfd, "screen_set NXDN -priority hidden");
|
||||
socketPrintf(m_socketfd, "widget_set Status Status %u %u FM", m_cols - 6, m_rows);
|
||||
socketPrintf(m_socketfd, "output 0"); // Clear all LEDs
|
||||
}
|
||||
|
||||
m_dmr = false;
|
||||
}
|
||||
|
||||
void CLCDproc::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
|
||||
{
|
||||
assert(my1 != NULL);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2017 by Tony Corbett G0WFV
|
||||
* Copyright (C) 2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -40,8 +40,8 @@ protected:
|
|||
virtual void setErrorInt(const char* text);
|
||||
virtual void setLockoutInt();
|
||||
virtual void setQuitInt();
|
||||
virtual void setFMInt();
|
||||
|
||||
|
||||
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
|
||||
virtual void writeDStarRSSIInt(unsigned char rssi);
|
||||
virtual void clearDStarInt();
|
||||
|
|
|
@ -658,10 +658,7 @@ int CMMDVMHost::run()
|
|||
|
||||
m_modem->setFMCallsignParams(callsign, callsignSpeed, callsignFrequency, callsignTime, callsignHoldoff, callsignHighLevel, callsignLowLevel, callsignAtStart, callsignAtEnd);
|
||||
m_modem->setFMAckParams(ack, ackSpeed, ackFrequency, ackDelay, ackLevel);
|
||||
m_modem->setFMTimeoutParams(timeout, timeoutLevel);
|
||||
m_modem->setFMCTCSSParams(ctcssFrequency, ctcssThreshold, ctcssLevel);
|
||||
m_modem->setFMMiscParams(inputLevel, outputLevel, kerchunkTime, hangTime);
|
||||
m_modem->setFMStart();
|
||||
m_modem->setFMMiscParams(timeout, timeoutLevel, ctcssFrequency, ctcssThreshold, ctcssLevel, inputLevel, outputLevel, kerchunkTime, hangTime);
|
||||
}
|
||||
|
||||
bool remoteControlEnabled = m_conf.getRemoteControlEnabled();
|
||||
|
@ -701,6 +698,12 @@ int CMMDVMHost::run()
|
|||
else if (!error && m_mode == MODE_ERROR)
|
||||
setMode(MODE_IDLE);
|
||||
|
||||
unsigned char mode = m_modem->getMode();
|
||||
if (mode == MODE_FM && m_mode != MODE_FM)
|
||||
setMode(mode);
|
||||
else if (mode != MODE_FM && m_mode == MODE_FM)
|
||||
setMode(mode);
|
||||
|
||||
if (m_ump != NULL) {
|
||||
bool tx = m_modem->hasTX();
|
||||
m_ump->setTX(tx);
|
||||
|
@ -1743,6 +1746,45 @@ void CMMDVMHost::setMode(unsigned char mode)
|
|||
createLockFile("POCSAG");
|
||||
break;
|
||||
|
||||
case MODE_FM:
|
||||
LogMessage("Mode set to FM");
|
||||
if (m_dstarNetwork != NULL)
|
||||
m_dstarNetwork->enable(false);
|
||||
if (m_dmrNetwork != NULL)
|
||||
m_dmrNetwork->enable(false);
|
||||
if (m_ysfNetwork != NULL)
|
||||
m_ysfNetwork->enable(false);
|
||||
if (m_p25Network != NULL)
|
||||
m_p25Network->enable(false);
|
||||
if (m_nxdnNetwork != NULL)
|
||||
m_nxdnNetwork->enable(false);
|
||||
if (m_pocsagNetwork != NULL)
|
||||
m_pocsagNetwork->enable(false);
|
||||
if (m_dstar != NULL)
|
||||
m_dstar->enable(false);
|
||||
if (m_dmr != NULL)
|
||||
m_dmr->enable(false);
|
||||
if (m_ysf != NULL)
|
||||
m_ysf->enable(false);
|
||||
if (m_p25 != NULL)
|
||||
m_p25->enable(false);
|
||||
if (m_nxdn != NULL)
|
||||
m_nxdn->enable(false);
|
||||
if (m_pocsag != NULL)
|
||||
m_pocsag->enable(false);
|
||||
if (m_mode == MODE_DMR && m_duplex && m_modem->hasTX()) {
|
||||
m_modem->writeDMRStart(false);
|
||||
m_dmrTXTimer.stop();
|
||||
}
|
||||
if (m_ump != NULL)
|
||||
m_ump->setMode(MODE_FM);
|
||||
m_display->setFM();
|
||||
m_mode = MODE_FM;
|
||||
m_modeTimer.stop();
|
||||
m_cwIdTimer.stop();
|
||||
createLockFile("FM");
|
||||
break;
|
||||
|
||||
case MODE_LOCKOUT:
|
||||
LogMessage("Mode set to Lockout");
|
||||
if (m_dstarNetwork != NULL)
|
||||
|
|
142
Modem.cpp
142
Modem.cpp
|
@ -79,9 +79,6 @@ const unsigned char MMDVM_POCSAG_DATA = 0x50U;
|
|||
const unsigned char MMDVM_FM_PARAMS1 = 0x60U;
|
||||
const unsigned char MMDVM_FM_PARAMS2 = 0x61U;
|
||||
const unsigned char MMDVM_FM_PARAMS3 = 0x62U;
|
||||
const unsigned char MMDVM_FM_PARAMS4 = 0x63U;
|
||||
const unsigned char MMDVM_FM_PARAMS5 = 0x64U;
|
||||
const unsigned char MMDVM_FM_START = 0x65U;
|
||||
|
||||
const unsigned char MMDVM_ACK = 0x70U;
|
||||
const unsigned char MMDVM_NAK = 0x7FU;
|
||||
|
@ -168,11 +165,12 @@ m_tx(false),
|
|||
m_cd(false),
|
||||
m_lockout(false),
|
||||
m_error(false),
|
||||
m_mode(MODE_IDLE),
|
||||
m_hwType(HWT_UNKNOWN)
|
||||
{
|
||||
assert(!port.empty());
|
||||
|
||||
m_buffer = new unsigned char[BUFFER_LENGTH];
|
||||
|
||||
assert(!port.empty());
|
||||
}
|
||||
|
||||
CModem::~CModem()
|
||||
|
@ -525,6 +523,8 @@ void CModem::clock(unsigned int ms)
|
|||
m_nxdnSpace = 0U;
|
||||
m_pocsagSpace = 0U;
|
||||
|
||||
m_mode = m_buffer[4U];
|
||||
|
||||
m_tx = (m_buffer[5U] & 0x01U) == 0x01U;
|
||||
|
||||
bool adcOverflow = (m_buffer[5U] & 0x02U) == 0x02U;
|
||||
|
@ -1713,6 +1713,11 @@ HW_TYPE CModem::getHWType() const
|
|||
return m_hwType;
|
||||
}
|
||||
|
||||
unsigned char CModem::getMode() const
|
||||
{
|
||||
return m_mode;
|
||||
}
|
||||
|
||||
bool CModem::setMode(unsigned char mode)
|
||||
{
|
||||
assert(m_serial != NULL);
|
||||
|
@ -1926,23 +1931,32 @@ bool CModem::setFMAckParams(const std::string& ack, unsigned int ackSpeed, unsig
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CModem::setFMTimeoutParams(unsigned int timeout, unsigned int timeoutLevel)
|
||||
bool CModem::setFMMiscParams(unsigned int timeout, unsigned int timeoutLevel, float ctcssFrequency, unsigned int ctcssThreshold, unsigned int ctcssLevel, unsigned int inputLevel, unsigned int outputLevel, unsigned int kerchunkTime, unsigned int hangTime)
|
||||
{
|
||||
assert(m_serial != NULL);
|
||||
|
||||
unsigned char buffer[10U];
|
||||
unsigned char buffer[20U];
|
||||
|
||||
buffer[0U] = MMDVM_FRAME_START;
|
||||
buffer[1U] = 5U;
|
||||
buffer[1U] = 12U;
|
||||
buffer[2U] = MMDVM_FM_PARAMS3;
|
||||
|
||||
buffer[3U] = timeout / 5U;
|
||||
buffer[4U] = timeoutLevel;
|
||||
|
||||
// CUtils::dump(1U, "Written", buffer, 5U);
|
||||
buffer[5U] = (unsigned char)ctcssFrequency;
|
||||
buffer[6U] = ctcssThreshold;
|
||||
buffer[7U] = ctcssLevel;
|
||||
|
||||
int ret = m_serial->write(buffer, 5U);
|
||||
if (ret != 5)
|
||||
buffer[8U] = inputLevel;
|
||||
buffer[9U] = outputLevel;
|
||||
buffer[10U] = kerchunkTime;
|
||||
buffer[11U] = hangTime;
|
||||
|
||||
// CUtils::dump(1U, "Written", buffer, 12U);
|
||||
|
||||
int ret = m_serial->write(buffer, 12U);
|
||||
if (ret != 12)
|
||||
return false;
|
||||
|
||||
unsigned int count = 0U;
|
||||
|
@ -1970,112 +1984,6 @@ bool CModem::setFMTimeoutParams(unsigned int timeout, unsigned int timeoutLevel)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CModem::setFMCTCSSParams(float ctcssFrequency, unsigned int ctcssThreshold, unsigned int ctcssLevel)
|
||||
{
|
||||
assert(m_serial != NULL);
|
||||
|
||||
unsigned char buffer[10U];
|
||||
|
||||
buffer[0U] = MMDVM_FRAME_START;
|
||||
buffer[1U] = 6U;
|
||||
buffer[2U] = MMDVM_FM_PARAMS4;
|
||||
|
||||
buffer[3U] = ctcssFrequency; // XXX
|
||||
buffer[4U] = ctcssThreshold;
|
||||
buffer[5U] = ctcssLevel;
|
||||
|
||||
// CUtils::dump(1U, "Written", buffer, 6U);
|
||||
|
||||
int ret = m_serial->write(buffer, 6U);
|
||||
if (ret != 6)
|
||||
return false;
|
||||
|
||||
unsigned int count = 0U;
|
||||
RESP_TYPE_MMDVM resp;
|
||||
do {
|
||||
CThread::sleep(10U);
|
||||
|
||||
resp = getResponse();
|
||||
if (resp == RTM_OK && m_buffer[2U] != MMDVM_ACK && m_buffer[2U] != MMDVM_NAK) {
|
||||
count++;
|
||||
if (count >= MAX_RESPONSES) {
|
||||
LogError("The MMDVM is not responding to the SET_FM_PARAMS4 command");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} while (resp == RTM_OK && m_buffer[2U] != MMDVM_ACK && m_buffer[2U] != MMDVM_NAK);
|
||||
|
||||
// CUtils::dump(1U, "Response", m_buffer, m_length);
|
||||
|
||||
if (resp == RTM_OK && m_buffer[2U] == MMDVM_NAK) {
|
||||
LogError("Received a NAK to the SET_FM_PARAMS4 command from the modem");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CModem::setFMMiscParams(unsigned int inputLevel, unsigned int outputLevel, unsigned int kerchunkTime, unsigned int hangTime)
|
||||
{
|
||||
assert(m_serial != NULL);
|
||||
|
||||
unsigned char buffer[10U];
|
||||
|
||||
buffer[0U] = MMDVM_FRAME_START;
|
||||
buffer[1U] = 7U;
|
||||
buffer[2U] = MMDVM_FM_PARAMS5;
|
||||
|
||||
buffer[3U] = inputLevel;
|
||||
buffer[4U] = outputLevel;
|
||||
buffer[5U] = kerchunkTime;
|
||||
buffer[6U] = hangTime;
|
||||
|
||||
// CUtils::dump(1U, "Written", buffer, 7U);
|
||||
|
||||
int ret = m_serial->write(buffer, 7U);
|
||||
if (ret != 7)
|
||||
return false;
|
||||
|
||||
unsigned int count = 0U;
|
||||
RESP_TYPE_MMDVM resp;
|
||||
do {
|
||||
CThread::sleep(10U);
|
||||
|
||||
resp = getResponse();
|
||||
if (resp == RTM_OK && m_buffer[2U] != MMDVM_ACK && m_buffer[2U] != MMDVM_NAK) {
|
||||
count++;
|
||||
if (count >= MAX_RESPONSES) {
|
||||
LogError("The MMDVM is not responding to the SET_FM_PARAMS5 command");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} while (resp == RTM_OK && m_buffer[2U] != MMDVM_ACK && m_buffer[2U] != MMDVM_NAK);
|
||||
|
||||
// CUtils::dump(1U, "Response", m_buffer, m_length);
|
||||
|
||||
if (resp == RTM_OK && m_buffer[2U] == MMDVM_NAK) {
|
||||
LogError("Received a NAK to the SET_FM_PARAMS5 command from the modem");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CModem::setFMStart()
|
||||
{
|
||||
assert(m_serial != NULL);
|
||||
|
||||
unsigned char buffer[10U];
|
||||
|
||||
buffer[0U] = MMDVM_FRAME_START;
|
||||
buffer[1U] = 3U;
|
||||
buffer[2U] = MMDVM_FM_START;
|
||||
|
||||
// CUtils::dump(1U, "Written", buffer, 3U);
|
||||
|
||||
return m_serial->write(buffer, 3U) == 3;
|
||||
}
|
||||
|
||||
void CModem::printDebug()
|
||||
{
|
||||
if (m_buffer[2U] == MMDVM_DEBUG1) {
|
||||
|
|
7
Modem.h
7
Modem.h
|
@ -47,10 +47,7 @@ public:
|
|||
|
||||
virtual bool setFMCallsignParams(const std::string& callsign, unsigned int callsignSpeed, unsigned int callsignFrequency, unsigned int callsignTime, unsigned int callsignHoldoff, unsigned int callsignHighLevel, unsigned int callsignLowLevel, bool callsignAtStart, bool callsignAtEnd);
|
||||
virtual bool setFMAckParams(const std::string& ack, unsigned int ackSpeed, unsigned int ackFrequency, unsigned int ackDelay, unsigned int ackLevel);
|
||||
virtual bool setFMTimeoutParams(unsigned int timeout, unsigned int timeoutLevel);
|
||||
virtual bool setFMCTCSSParams(float ctcssFrequency, unsigned int ctcssThreshold, unsigned int ctcssLevel);
|
||||
virtual bool setFMMiscParams(unsigned int inputLevel, unsigned int outputLevel, unsigned int kerchunkTime, unsigned int hangTime);
|
||||
virtual bool setFMStart();
|
||||
virtual bool setFMMiscParams(unsigned int timeout, unsigned int timeoutLevel, float ctcssFrequency, unsigned int ctcssThreshold, unsigned int ctcssLevel, unsigned int inputLevel, unsigned int outputLevel, unsigned int kerchunkTime, unsigned int hangTime);
|
||||
|
||||
virtual bool open();
|
||||
|
||||
|
@ -102,6 +99,7 @@ public:
|
|||
|
||||
virtual bool writeSerial(const unsigned char* data, unsigned int length);
|
||||
|
||||
virtual unsigned char getMode() const;
|
||||
virtual bool setMode(unsigned char mode);
|
||||
|
||||
virtual bool sendCWId(const std::string& callsign);
|
||||
|
@ -181,6 +179,7 @@ private:
|
|||
bool m_cd;
|
||||
bool m_lockout;
|
||||
bool m_error;
|
||||
unsigned char m_mode;
|
||||
HW_TYPE m_hwType;
|
||||
|
||||
bool readVersion();
|
||||
|
|
22
Nextion.cpp
22
Nextion.cpp
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -102,7 +102,6 @@ bool CNextion::open()
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CNextion::setIdleInt()
|
||||
{
|
||||
// a few bits borrowed from Lieven De Samblanx ON7LDS, NextionDriver
|
||||
|
@ -240,6 +239,25 @@ void CNextion::setQuitInt()
|
|||
m_mode = MODE_QUIT;
|
||||
}
|
||||
|
||||
void CNextion::setFMInt()
|
||||
{
|
||||
sendCommand("page MMDVM");
|
||||
sendCommandAction(1U);
|
||||
|
||||
char command[20];
|
||||
if (m_brightness > 0) {
|
||||
::sprintf(command, "dim=%u", m_brightness);
|
||||
sendCommand(command);
|
||||
}
|
||||
|
||||
sendCommand("t0.txt=\"FM\"");
|
||||
sendCommandAction(15U);
|
||||
|
||||
m_clockDisplayTimer.stop();
|
||||
|
||||
m_mode = MODE_FM;
|
||||
}
|
||||
|
||||
void CNextion::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
|
||||
{
|
||||
assert(my1 != NULL);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -41,6 +41,7 @@ protected:
|
|||
virtual void setErrorInt(const char* text);
|
||||
virtual void setLockoutInt();
|
||||
virtual void setQuitInt();
|
||||
virtual void setFMInt();
|
||||
|
||||
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
|
||||
virtual void writeDStarRSSIInt(unsigned char rssi);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -60,6 +60,10 @@ void CNullDisplay::setQuitInt()
|
|||
{
|
||||
}
|
||||
|
||||
void CNullDisplay::setFMInt()
|
||||
{
|
||||
}
|
||||
|
||||
void CNullDisplay::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
|
||||
{
|
||||
#if defined(RASPBERRY_PI)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -38,6 +38,7 @@ protected:
|
|||
virtual void setErrorInt(const char* text);
|
||||
virtual void setLockoutInt();
|
||||
virtual void setQuitInt();
|
||||
virtual void setFMInt();
|
||||
|
||||
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
|
||||
virtual void clearDStarInt();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -161,6 +161,22 @@ void CTFTSerial::setQuitInt()
|
|||
m_mode = MODE_QUIT;
|
||||
}
|
||||
|
||||
void CTFTSerial::setFMInt()
|
||||
{
|
||||
// Clear the screen
|
||||
clearScreen();
|
||||
|
||||
setFontSize(FONT_LARGE);
|
||||
|
||||
// Draw MMDVM logo
|
||||
displayBitmap(0U, 0U, "MMDVM_sm.bmp");
|
||||
|
||||
gotoPosPixel(20U, 60U);
|
||||
displayText("FM");
|
||||
|
||||
m_mode = MODE_FM;
|
||||
}
|
||||
|
||||
void CTFTSerial::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
|
||||
{
|
||||
assert(my1 != NULL);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -40,6 +40,7 @@ protected:
|
|||
virtual void setErrorInt(const char* text);
|
||||
virtual void setLockoutInt();
|
||||
virtual void setQuitInt();
|
||||
virtual void setFMInt();
|
||||
|
||||
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
|
||||
virtual void clearDStarInt();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2019 by SASANO Takayoshi JG1UAA
|
||||
* Copyright (C) 2015,2016,2018,2019 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2018,2019,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -174,6 +174,14 @@ void CTFTSurenoo::setQuitInt()
|
|||
m_mode = MODE_QUIT;
|
||||
}
|
||||
|
||||
void CTFTSurenoo::setFMInt()
|
||||
{
|
||||
setModeLine(STR_MMDVM);
|
||||
setStatusLine(statusLineNo(1), "FM");
|
||||
|
||||
m_mode = MODE_FM;
|
||||
}
|
||||
|
||||
void CTFTSurenoo::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
|
||||
{
|
||||
assert(my1 != NULL);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2019 by SASANO Takayoshi JG1UAA
|
||||
* Copyright (C) 2015,2016,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2018,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -42,6 +42,7 @@ protected:
|
|||
virtual void setErrorInt(const char* text);
|
||||
virtual void setLockoutInt();
|
||||
virtual void setQuitInt();
|
||||
virtual void setFMInt();
|
||||
|
||||
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
|
||||
virtual void clearDStarInt();
|
||||
|
|
Loading…
Reference in New Issue