Skip to content
Snippets Groups Projects
Commit 3fe8e7e2 authored by Federico Lolli's avatar Federico Lolli
Browse files

increased maximum baudrate accepted

parent 8c4b6803
Branches
Tags
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment