From 412324930d8de6fb7beb7882bbd975702b16bcb1 Mon Sep 17 00:00:00 2001 From: Romain Reignier Date: Tue, 29 Apr 2025 17:50:40 +0200 Subject: [PATCH] monitor: use espflash configuration Using the default() configuration, if 'y' is answered to the question: "Remember this serial port for future use?" the program panic because the `save_path` variable of the espflash Config is not initialized to a valid directory to store a persistent configuration. Using the load() function allows to skip the questions on next use. --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index f324a87..853a73a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -226,7 +226,9 @@ fn run() -> anyhow::Result<()> { } fn run_monitor(monitor_args: MonitorArgs) -> anyhow::Result<()> { - match espflash::cli::serial_monitor(monitor_args, &espflash::cli::config::Config::default()) { + let config = + espflash::cli::config::Config::load().unwrap_or(espflash::cli::config::Config::default()); + match espflash::cli::serial_monitor(monitor_args, &config) { Ok(_) => {} Err(err) => { error!("Running serial monitor returned an error: {err}");