Implemented auto port detection

This commit is contained in:
2025-09-19 11:14:13 +02:00
parent d298db44d2
commit 1dbbaab197
5 changed files with 129 additions and 13 deletions

View File

@@ -216,7 +216,17 @@ fn main() {
let start = SystemTime::now();
let mut target = PhysicalTarget::init(args.port, if args.slow { 57600 } else { 312500 }).unwrap();
let port = args.port.or_else(|| {
for port in serial_enumerator::get_serial_list() {
if let Some(vendor) = port.vendor && vendor.as_str() == "TUL" {
return Some(port.name.into())
}
}
None
}).unwrap();
let mut target = PhysicalTarget::init(port, if args.slow { 57600 } else { 312500 }).unwrap();
let res = match args.command {
ArgCommand::Read(args) => read_chip(args, &mut target),