Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Serial Bridge
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Serial Bridge
Commits
3fe8e7e2
Commit
3fe8e7e2
authored
1 year ago
by
Federico Lolli
Browse files
Options
Downloads
Patches
Plain Diff
increased maximum baudrate accepted
parent
8c4b6803
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib.rs
+2
-2
2 additions, 2 deletions
src/lib.rs
with
2 additions
and
2 deletions
src/lib.rs
+
2
−
2
View file @
3fe8e7e2
...
...
@@ -108,9 +108,9 @@ fn open_serial(args: Args<'_>) -> SResult<()> {
.map_mexerr
(|
e
|
Error
::
InvalidBaudrate
(
Box
::
new
(
e
)))
?
;
// Check for arg2 to resemble a baud rate (this type mismatch should be
// fixed later on)
if
arg2
!=
arg2
.floor
()
||
!
(
0.0
..=
921_600.0
)
.contains
(
&
arg2
)
{
if
arg2
!=
arg2
.floor
()
||
!
(
0.0
..=
u32
::
MAX
as
f64
)
.contains
(
&
arg2
)
{
return
Err
(
Error
::
InvalidBaudrate
(
Box
::
new
(
Error
::
InvalidMatlabType
(
"do not use decimal units, use a number
between 0 and 115200
"
.into
(),
"do not use decimal units, use a number
greater than zero
"
.into
(),
))));
}
let
baudrate
=
arg2
as
u32
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment