Refactor header files - includes should only declare, not define

This commit is contained in:
Sassa NF
2024-12-23 09:36:23 +00:00
parent cb6b93f9ff
commit ca6a61ff93
6 changed files with 132 additions and 73 deletions

View File

@@ -57,6 +57,7 @@ void _onUsbEvent0(void *arg, esp_event_base_t event_base, int32_t event_id,
bool Comms::initComms(Config &c)
{
bool fine = false;
#ifndef HELTEC
if (c.listen_on_usb.equalsIgnoreCase("readline"))
{
// comms using readline plaintext protocol
@@ -68,13 +69,14 @@ bool Comms::initComms(Config &c)
fine = true;
}
#endif
if (c.listen_on_serial0.equalsIgnoreCase("readline"))
{
// comms using readline plaintext protocol
Comms0 = new ReadlineComms("UART0", Serial0);
Serial0.onReceive(_onReceive0, false);
Serial0.begin(115200);
Comms0 = new ReadlineComms("UART0", SERIAL0);
SERIAL0.onReceive(_onReceive0, false);
SERIAL0.begin(115200);
Serial.println("Initialized communications on Serial0 using readline protocol");
}