mirror of https://github.com/g4klx/MMDVM.git
Allow the modem to host serial displays.
This commit is contained in:
parent
02c90e3f7f
commit
f8d9c881ff
5
Config.h
5
Config.h
|
@ -22,7 +22,7 @@
|
|||
// Allow for the use of high quality external clock oscillators
|
||||
// The number is the frequency of the oscillator in Hertz.
|
||||
// For 12 MHz
|
||||
// #define EXTERNAL_OSC 12000000
|
||||
#define EXTERNAL_OSC 12000000
|
||||
// For 14.4 MHz
|
||||
// #define EXTERNAL_OSC 14400000
|
||||
// For 19.2 MHz
|
||||
|
@ -51,5 +51,8 @@
|
|||
// Pass RSSI information to the host
|
||||
// #define SEND_RSSI_DATA
|
||||
|
||||
// Use the modem as a serial repeater for Nextion displays
|
||||
// #define SERIAL_REPEATER
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -59,6 +59,8 @@ const uint8_t MMDVM_P25_LOST = 0x32U;
|
|||
const uint8_t MMDVM_ACK = 0x70U;
|
||||
const uint8_t MMDVM_NAK = 0x7FU;
|
||||
|
||||
const uint8_t MMDVM_SERIAL = 0x80U;
|
||||
|
||||
const uint8_t MMDVM_DEBUG1 = 0xF1U;
|
||||
const uint8_t MMDVM_DEBUG2 = 0xF2U;
|
||||
const uint8_t MMDVM_DEBUG3 = 0xF3U;
|
||||
|
@ -386,6 +388,10 @@ void CSerialPort::start()
|
|||
m_serial.baud(115200);
|
||||
#else
|
||||
Serial.begin(115200);
|
||||
|
||||
#if defined(SERIAL_REPEATER)
|
||||
Serial3.begin(9600);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -632,6 +638,12 @@ void CSerialPort::process()
|
|||
}
|
||||
break;
|
||||
|
||||
#if defined(SERIAL_REPEATER)
|
||||
case MMDVM_SERIAL:
|
||||
Serial3.write(m_buffer + 3U, m_len - 3U);
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
// Handle this, send a NAK back
|
||||
sendNAK(1U);
|
||||
|
@ -643,6 +655,12 @@ void CSerialPort::process()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(SERIAL_REPEATER)
|
||||
// Drain any incoming serial data
|
||||
while (Serial3.available())
|
||||
Serial3.read();
|
||||
#endif
|
||||
}
|
||||
|
||||
void CSerialPort::writeDStarHeader(const uint8_t* header, uint8_t length)
|
||||
|
|
Loading…
Reference in New Issue