Swapped out termion for crossterm
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -3,6 +3,7 @@ use std::io::{Cursor, Error, Write};
|
||||
use std::path::PathBuf;
|
||||
use std::time::{Duration, SystemTime};
|
||||
|
||||
use crossterm::event::{KeyCode, KeyModifiers};
|
||||
use pbr::ProgressBar;
|
||||
|
||||
mod args;
|
||||
@@ -16,7 +17,6 @@ use monitor::Monitor;
|
||||
|
||||
mod target;
|
||||
use target::{PhysicalTarget, Target};
|
||||
use termion::event::Key;
|
||||
|
||||
mod utils;
|
||||
|
||||
@@ -230,11 +230,13 @@ fn write_chip(args: ArgWrite, target: &mut PhysicalTarget) -> Result<(), Error>
|
||||
|
||||
if !args.monitor { break }
|
||||
|
||||
let cause = Monitor::new()
|
||||
.add_hook(Key::Ctrl('f'), if args.cmd.is_none() { "Re-flash target" } else { "Re-run command and flash target" })
|
||||
.run(target.port())?;
|
||||
let mut mon = Monitor::new();
|
||||
|
||||
if cause != Key::Ctrl('f') { break }
|
||||
let reflash_handle = mon.add_hook(KeyCode::Char('f'), KeyModifiers::CONTROL, if args.cmd.is_none() { "Re-flash target" } else { "Re-run command and flash target" });
|
||||
|
||||
let cause = mon.run(target.port())?;
|
||||
|
||||
if cause != reflash_handle { break }
|
||||
|
||||
target.resync_target()?;
|
||||
}
|
||||
|
Reference in New Issue
Block a user