From c06adec48bc051eae187803450cc1fbbe5aed913 Mon Sep 17 00:00:00 2001 From: Micah Elizabeth Scott <micah@scanlime.org> Date: Sun, 6 Oct 2013 11:44:00 -0700 Subject: [PATCH] serial_passthrough: Default to 115k baud --- testjig/serial_passthrough/serial_passthrough.ino | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/testjig/serial_passthrough/serial_passthrough.ino b/testjig/serial_passthrough/serial_passthrough.ino index d57de78..6742568 100644 --- a/testjig/serial_passthrough/serial_passthrough.ino +++ b/testjig/serial_passthrough/serial_passthrough.ino @@ -2,7 +2,7 @@ * Serial pass-through adapter. * * This bridges the Teensy's USB serial port to the Fadecandy board's serial - * interface at 9600 baud. When the green button is held, we implement a simple + * interface at 115200 baud. When the green button is held, we implement a simple * serial port loopback which will put the Fadecandy into bootloader mode. */ @@ -13,11 +13,13 @@ const unsigned ledPin = 13; HardwareSerial Uart = HardwareSerial(); +#define BAUD 115200 + void setup() { pinMode(ledPin, OUTPUT); pinMode(buttonPin, INPUT_PULLUP); - Serial.begin(9600); + Serial.begin(BAUD); } void passthroughMode() @@ -26,7 +28,9 @@ void passthroughMode() pinMode(txPin, OUTPUT); digitalWrite(ledPin, HIGH); - // Input-to-output latency must be less than one character for the bootloader to detect this. + // This is only slow 9600 baud, but input-to-output latency must be less + // than one character for the bootloader to detect the loopback. + while (digitalRead(buttonPin) == LOW) { digitalWrite(txPin, digitalRead(rxPin)); } @@ -36,7 +40,7 @@ void passthroughMode() void loopbackMode() { - Uart.begin(9600); + Uart.begin(BAUD); while (digitalRead(buttonPin) == HIGH) { if (Serial.available()) { -- GitLab