diff --git a/ArduinoConfig.h b/ArduinoConfig.h index d04fb91..8b75d7c 100644 --- a/ArduinoConfig.h +++ b/ArduinoConfig.h @@ -3,6 +3,12 @@ static const uint8_t COMMAND_TRANSFER_SPI = 1; +// Can be set to one for additional programming information from the primary +// serial port which is usually also used to flash the Arduino +// Can be disabled if this output interferes with the usual +// serial communication logic +#define PROGRAMMING_OUTPUT 1 + #define BAUD_RATE 115200 #define SERIAL_RX_BUFFER_SIZE 256 #define RING_BUFFER_SIZE 100 diff --git a/main.cpp b/main.cpp index 8a57dce..9d70481 100644 --- a/main.cpp +++ b/main.cpp @@ -142,7 +142,8 @@ void handleNewData() { if (result == HasReturnvaluesIF::RETURN_OK) { handlePacket(packet, packetLen); - //after handling the packet, we can delete it from the raw stream, it has been copied to packet + // after handling the packet, we can delete it from the raw stream, + // it has been copied to packet toDelete += readSize; } @@ -170,16 +171,18 @@ void setup() { // if no transfer is going on. CS_PORT = 0xff; Serial.begin(BAUD_RATE); - Serial.println("Setting up Arduino IO interface board."); - Serial.print("Configured baud rate for serial communication: "); +#if PROGRAMMING_OUTPUT == 1 + Serial.println("-AI- Setting up Arduino IO interface board."); + Serial.print("-AI- Configured baud rate for serial communication: "); Serial.println(BAUD_RATE, DEC); - Serial.print("Size of serial receiver buffer: "); - Serial.print(SERIAL_RX_BUFFER_SIZE, DEC);Serial.print(" bytes"); + Serial.print("-AI- Size of serial receiver buffer: "); + Serial.print(SERIAL_RX_BUFFER_SIZE, DEC); + Serial.println(" bytes"); +#endif SPI.begin(); } void loop() { -; handleNewData(); delay(1000); }