1
0
mirror of https://github.com/gdsports/USBHost_t36 synced 2024-11-21 08:35:03 -05:00

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.
This commit is contained in:
Kurt Eckhardt 2017-11-05 10:53:54 -08:00
parent ef59f98a5f
commit 12be685ab1
3 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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);