From fe7e99898c26bb740a903b5adc423b037f5122ba Mon Sep 17 00:00:00 2001 From: Thomas Frans Date: Tue, 16 Jul 2024 22:12:57 +0200 Subject: [PATCH 1/2] gnss: update supported baud rates The Septentrio GNSS driver requires certain baud rates to test all the supported baud rates of the receiver. Without these changes, certain "non-standard" ones would print an error to the MAVLink console when the driver was started through the console. --- platforms/nuttx/src/px4/common/SerialImpl.cpp | 8 ++++++++ platforms/posix/src/px4/common/SerialImpl.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/platforms/nuttx/src/px4/common/SerialImpl.cpp b/platforms/nuttx/src/px4/common/SerialImpl.cpp index 7fc5ea7520a2..4210cfb2af20 100644 --- a/platforms/nuttx/src/px4/common/SerialImpl.cpp +++ b/platforms/nuttx/src/px4/common/SerialImpl.cpp @@ -97,12 +97,20 @@ bool SerialImpl::configure() case 460800: speed = B460800; break; + case 500000: speed = B500000; break; + + case 576000: speed = B576000; break; + #ifndef B921600 #define B921600 921600 #endif case 921600: speed = B921600; break; + case 1000000: speed = B1000000; break; + + case 1500000: speed = B1500000; break; + default: speed = _baudrate; PX4_WARN("Using non-standard baudrate: %lu", _baudrate); diff --git a/platforms/posix/src/px4/common/SerialImpl.cpp b/platforms/posix/src/px4/common/SerialImpl.cpp index 822ed4255ec0..0be8ff002899 100644 --- a/platforms/posix/src/px4/common/SerialImpl.cpp +++ b/platforms/posix/src/px4/common/SerialImpl.cpp @@ -90,12 +90,20 @@ bool SerialImpl::configure() case 460800: speed = B460800; break; + case 500000: speed = B500000; break; + + case 576000: speed = B576000; break; + #ifndef B921600 #define B921600 921600 #endif case 921600: speed = B921600; break; + case 1000000: speed = B1000000; break; + + case 1500000: speed = B1500000; break; + default: speed = _baudrate; PX4_WARN("Using non-standard baudrate: %u", _baudrate); From b8c2f1020621ece86b11b2b739d809301dd7af47 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 29 Jul 2024 08:14:53 +1200 Subject: [PATCH 2/2] platforms: add missing baudrate defines --- platforms/nuttx/src/px4/common/SerialImpl.cpp | 16 ++++++++++++++++ platforms/posix/src/px4/common/SerialImpl.cpp | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/platforms/nuttx/src/px4/common/SerialImpl.cpp b/platforms/nuttx/src/px4/common/SerialImpl.cpp index 4210cfb2af20..4264976f4471 100644 --- a/platforms/nuttx/src/px4/common/SerialImpl.cpp +++ b/platforms/nuttx/src/px4/common/SerialImpl.cpp @@ -97,8 +97,16 @@ bool SerialImpl::configure() case 460800: speed = B460800; break; +#ifndef B500000 +#define B500000 500000 +#endif + case 500000: speed = B500000; break; +#ifndef B576000 +#define B576000 576000 +#endif + case 576000: speed = B576000; break; #ifndef B921600 @@ -107,8 +115,16 @@ bool SerialImpl::configure() case 921600: speed = B921600; break; +#ifndef B1000000 +#define B1000000 1000000 +#endif + case 1000000: speed = B1000000; break; +#ifndef B1500000 +#define B1500000 1500000 +#endif + case 1500000: speed = B1500000; break; default: diff --git a/platforms/posix/src/px4/common/SerialImpl.cpp b/platforms/posix/src/px4/common/SerialImpl.cpp index 0be8ff002899..2298c3829263 100644 --- a/platforms/posix/src/px4/common/SerialImpl.cpp +++ b/platforms/posix/src/px4/common/SerialImpl.cpp @@ -90,8 +90,16 @@ bool SerialImpl::configure() case 460800: speed = B460800; break; +#ifndef B500000 +#define B500000 500000 +#endif + case 500000: speed = B500000; break; +#ifndef B576000 +#define B576000 576000 +#endif + case 576000: speed = B576000; break; #ifndef B921600 @@ -100,8 +108,16 @@ bool SerialImpl::configure() case 921600: speed = B921600; break; +#ifndef B1000000 +#define B1000000 1000000 +#endif + case 1000000: speed = B1000000; break; +#ifndef B1500000 +#define B1500000 1500000 +#endif + case 1500000: speed = B1500000; break; default: