Skip to content

Commit

Permalink
Add panic messages to startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Guggi committed Jan 7, 2024
1 parent 08b714c commit 74fa339
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ struct Configuration {
heartbeat_pin: u8,
update_pin: u8,
heartbeat_freq: u64,
log_path: String,
}

fn main() -> ! {
let config: Configuration =
toml::from_str(&std::fs::read_to_string("./config.toml").unwrap()).unwrap();
toml::from_str(&std::fs::read_to_string("./config.toml").expect("Could not open config file")).unwrap();

create_directory_if_not_exists("archives").unwrap();
create_directory_if_not_exists("data").unwrap();
Expand All @@ -36,7 +35,7 @@ fn main() -> ! {
log::info!("Scheduler started");

// construct a wrapper for UART communication
let mut com = serialport::new(&config.uart, config.baudrate).open().unwrap();
let mut com = serialport::new(&config.uart, config.baudrate).open().expect("Could not open serial port");
com.set_timeout(&Duration::from_secs(60));

// construct a wrapper for resources that are shared between different commands
Expand Down

0 comments on commit 74fa339

Please sign in to comment.