Browse Source

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.
main
Kurt Eckhardt 7 years ago
parent
commit
12be685ab1
3 changed files with 7 additions and 7 deletions
  1. +5
    -5
      USBHost_t36.h
  2. +1
    -1
      examples/SerialTest/SerialTest.ino
  3. +1
    -1
      keywords.txt

+ 5
- 5
USBHost_t36.h 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




+ 1
- 1
examples/SerialTest/SerialTest.ino 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);

+ 1
- 1
keywords.txt View File

@@ -85,4 +85,4 @@ USBHOST_SERIAL_7O1 LITERAL1
USBHOST_SERIAL_8N1 LITERAL1
USBHOST_SERIAL_8N2 LITERAL1
USBHOST_SERIAL_8E1 LITERAL1
USBHOST_SERIAL_8O1 LITERAL1
USBHOST_SERIAL_8O1 LITERAL1

Loading…
Cancel
Save