write
can now open a monitor right after flashing
This commit is contained in:
@@ -21,8 +21,9 @@ impl Monitor {
|
||||
Self { hooks }
|
||||
}
|
||||
|
||||
pub fn add_hook(&mut self, key: Key, desc: &'static str) {
|
||||
pub fn add_hook(&mut self, key: Key, desc: &'static str) -> &mut Self {
|
||||
self.hooks.push((key, desc));
|
||||
self
|
||||
}
|
||||
|
||||
pub fn run(&mut self, port: &mut SerialPort) -> Result<Key, Error> {
|
||||
@@ -32,6 +33,7 @@ impl Monitor {
|
||||
port.set_dtr(false)?;
|
||||
port.set_rts(false)?;
|
||||
|
||||
println!();
|
||||
println!("Monitor controls:");
|
||||
|
||||
for (key, desc) in &self.hooks {
|
||||
|
Reference in New Issue
Block a user