Merge in com port switching from sangaboard v4
I've refactored the use of the serial port, to store the current serial port in a global variable in a module. This is set to the most recent port to receive data, and so we should always be replying to the port that was used to initiate a command. If SECONDARY_SERIAL_PORT is not defined, this should result in no change - if it is, we should be able to communicate on either port.
This commit is contained in:
parent
e65c290ae6
commit
3997d66cde
12 changed files with 180 additions and 145 deletions
|
|
@ -1,8 +1,9 @@
|
|||
#ifndef MAIN_H
|
||||
#include "config.h"
|
||||
#include <Arduino.h>
|
||||
#include <ComPort.h>
|
||||
#ifdef DEBUG_ON
|
||||
#define D(x) Serial.println(x)
|
||||
#define D(x) comPort->println(x)
|
||||
#else
|
||||
#define D(x)
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue