mirror of
https://github.com/fasteddy516/SimplySerial.git
synced 2024-11-24 10:04:35 +00:00
Corrected default baud rate for CircuitPython devices. (Closes #15)
This commit is contained in:
parent
16722d499c
commit
ae75570442
@ -39,7 +39,7 @@ namespace SimplySerial
|
|||||||
static bool Quiet = false;
|
static bool Quiet = false;
|
||||||
static AutoConnect autoConnect = AutoConnect.ONE;
|
static AutoConnect autoConnect = AutoConnect.ONE;
|
||||||
static ComPort port;
|
static ComPort port;
|
||||||
static int baud = 9600;
|
static int baud = -1;
|
||||||
static Parity parity = Parity.None;
|
static Parity parity = Parity.None;
|
||||||
static int dataBits = 8;
|
static int dataBits = 8;
|
||||||
static StopBits stopBits = StopBits.One;
|
static StopBits stopBits = StopBits.One;
|
||||||
@ -187,6 +187,14 @@ namespace SimplySerial
|
|||||||
// attempt to set the baud rate, fail if the specified value is not supported by the hardware
|
// attempt to set the baud rate, fail if the specified value is not supported by the hardware
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (baud < 0)
|
||||||
|
{
|
||||||
|
if (port.board.isCircuitPython)
|
||||||
|
baud = 115200;
|
||||||
|
else
|
||||||
|
baud = 9600;
|
||||||
|
}
|
||||||
|
|
||||||
serialPort.BaudRate = baud;
|
serialPort.BaudRate = baud;
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
|
Loading…
Reference in New Issue
Block a user