-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create trivial serial port opener to handle waiting for a port * Stitch in new wait command * use PathBuf directly for file paths on disk * Bump version
- Loading branch information
Showing
9 changed files
with
146 additions
and
116 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
use crate::serial_monitor::run_serial_monitor; | ||
use crate::{serial_monitor::run_serial_monitor, serial_port_opener::open_serial_port_with_wait}; | ||
|
||
pub fn cmd_serial_port_monitor(port_name: String, baud_rate: u32) { | ||
pub fn cmd_serial_port_monitor(port_name: &str, baud_rate: u32, wait_for_port: bool) { | ||
// Span a basic serial port monitor attached to the serial port | ||
// Eventually we will hook in extra utility commands | ||
println!("Opening serial monitor to {port_name} @ {baud_rate}"); | ||
let serial_port = serialport::new(port_name, baud_rate); | ||
let port = open_serial_port_with_wait(port_name, baud_rate, wait_for_port); | ||
|
||
match serial_port.open() { | ||
Ok(port) => { | ||
let _ = run_serial_monitor(port); | ||
} | ||
Err(e) => println!("Failed to open serial port - {e:?}"), | ||
} | ||
run_serial_monitor(port).unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.