From 12be685ab1dc9e5ee23a5fb7740e190544c817fe Mon Sep 17 00:00:00 2001 From: Kurt Eckhardt Date: Sun, 5 Nov 2017 10:53:54 -0800 Subject: [PATCH] Test fixes for different parity and like I did a quick test using the Serial test app, where I can type in lines like: #38400,7E1 And it reopens the serial port at the specified baud and format. Note the formats the test app looks for is 7E1, 7O1, 8N1, 8N2. Tested on an FTDI, PL2303 and CH341. I also tested going to Teensy 3.2 CDCACM. But as far as I know the teensy could not care less about Baud/Format. Unless of course there is a way to query the value and use it to set a Hardware Serial port to it. --- USBHost_t36.h | 10 +++++----- examples/SerialTest/SerialTest.ino | 2 +- keywords.txt | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/USBHost_t36.h b/USBHost_t36.h index e96ea87..d2e92da 100644 --- a/USBHost_t36.h +++ b/USBHost_t36.h @@ -56,7 +56,7 @@ // your best effort to read chapter 4 before asking USB questions! -#define USBHOST_PRINT_DEBUG +//#define USBHOST_PRINT_DEBUG /************************************************/ /* Data Types */ @@ -122,12 +122,12 @@ class USBDriverTimer; // bits: 8-9 - Stop bits. 0=1, 1=2 -#define USBHOST_SERIAL_7E1 0x027 -#define USBHOST_SERIAL_7O1 0x047 +#define USBHOST_SERIAL_7E1 0x047 +#define USBHOST_SERIAL_7O1 0x027 #define USBHOST_SERIAL_8N1 0x08 #define USBHOST_SERIAL_8N2 0x108 -#define USBHOST_SERIAL_8E1 0x028 -#define USBHOST_SERIAL_8O1 0x048 +#define USBHOST_SERIAL_8E1 0x048 +#define USBHOST_SERIAL_8O1 0x028 diff --git a/examples/SerialTest/SerialTest.ino b/examples/SerialTest/SerialTest.ino index 0928ae2..2b6ae6a 100644 --- a/examples/SerialTest/SerialTest.ino +++ b/examples/SerialTest/SerialTest.ino @@ -112,7 +112,7 @@ void loop() Serial.print(" New Baud: "); Serial.println(baud); Serial.print(" Format: "); - Serial.println(format); + Serial.println(format, HEX); digitalWriteFast(3, HIGH); userial.begin(baud, format); digitalWriteFast(3, LOW); diff --git a/keywords.txt b/keywords.txt index 5b3b4ea..a7d6416 100644 --- a/keywords.txt +++ b/keywords.txt @@ -85,4 +85,4 @@ USBHOST_SERIAL_7O1 LITERAL1 USBHOST_SERIAL_8N1 LITERAL1 USBHOST_SERIAL_8N2 LITERAL1 USBHOST_SERIAL_8E1 LITERAL1 -USBHOST_SERIAL_8O1 LITERAL1 \ No newline at end of file +USBHOST_SERIAL_8O1 LITERAL1