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

// your best effort to read chapter 4 before asking USB questions! // your best effort to read chapter 4 before asking USB questions!




#define USBHOST_PRINT_DEBUG
//#define USBHOST_PRINT_DEBUG


/************************************************/ /************************************************/
/* Data Types */ /* Data Types */
// bits: 8-9 - Stop bits. 0=1, 1=2 // 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_8N1 0x08
#define USBHOST_SERIAL_8N2 0x108 #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

Serial.print(" New Baud: "); Serial.print(" New Baud: ");
Serial.println(baud); Serial.println(baud);
Serial.print(" Format: "); Serial.print(" Format: ");
Serial.println(format);
Serial.println(format, HEX);
digitalWriteFast(3, HIGH); digitalWriteFast(3, HIGH);
userial.begin(baud, format); userial.begin(baud, format);
digitalWriteFast(3, LOW); digitalWriteFast(3, LOW);

+ 1
- 1
keywords.txt View File

USBHOST_SERIAL_8N1 LITERAL1 USBHOST_SERIAL_8N1 LITERAL1
USBHOST_SERIAL_8N2 LITERAL1 USBHOST_SERIAL_8N2 LITERAL1
USBHOST_SERIAL_8E1 LITERAL1 USBHOST_SERIAL_8E1 LITERAL1
USBHOST_SERIAL_8O1 LITERAL1
USBHOST_SERIAL_8O1 LITERAL1

Loading…
Cancel
Save