Factor out bus configuration

This commit is contained in:
Sassa NF
2025-01-26 22:33:37 +00:00
parent c7727fb527
commit 2b1da5ae4a
11 changed files with 453 additions and 61 deletions
+4 -6
View File
@@ -86,9 +86,8 @@ bool Comms::initComms(Config &c)
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", Uart0);
Uart0.onReceive(_onReceive0, false);
Serial.println("Initialized communications on Serial0 using readline protocol");
}
@@ -102,9 +101,8 @@ bool Comms::initComms(Config &c)
if (c.listen_on_serial1.equalsIgnoreCase("readline"))
{
// comms using readline plaintext protocol
Comms1 = new ReadlineComms("UART1", Serial1);
Serial1.onReceive(_onReceive1, false);
Serial1.begin(115200);
Comms1 = new ReadlineComms("UART1", Uart1);
Uart1.onReceive(_onReceive1, false);
Serial.println("Initialized communications on Serial1 using readline protocol");
}