diff --git a/CHANGELOG.md b/CHANGELOG.md index fe516ac..7e4ff5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,10 @@ All notable changes to the `Serial Monitor` crate will be documented in this fil # Unreleased 0.3.x +* Fixed sample rate issue * ... -# Unreleased 0.3.4 +# 0.3.4 * implement option to self-update the application diff --git a/README.md b/README.md index edbf87f..3a001ab 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ simultaneously. [Binary bundles](https://github.com/hacknus/serial-monitor-rust/releases) are available for Linux, macOS and Windows. -Running the apple silicon binary may result to the message "Serial Monitor is damaged and cannot be opened.", to get +Running the apple silicon binary (serial-monitor-aarch64-apple-darwin.app) may result to the message "Serial Monitor is +damaged and cannot be opened.", to get around this you first need to run: `xattr -rd com.apple.quarantine Serial\ Monitor.app` diff --git a/src/gui.rs b/src/gui.rs index ef36b84..651b7ff 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -332,9 +332,7 @@ impl MyApp { } if self.data.loaded_from_file && self.file_opened { - if let Ok(labels) = - self.load_names_rx.recv_timeout(Duration::from_millis(10)) - { + if let Ok(labels) = self.load_names_rx.try_recv() { self.labels = labels; self.colors = (0..max(self.labels.len(), 1)) .map(|i| COLORS[i % COLORS.len()]) diff --git a/src/main.rs b/src/main.rs index ce1bd0f..6c4fac8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,7 +9,6 @@ use std::cmp::max; use std::path::PathBuf; use std::sync::mpsc::{Receiver, Sender}; use std::sync::{mpsc, Arc, RwLock}; -use std::time::Duration; use std::{env, thread}; use crate::data::{DataContainer, Packet}; @@ -65,14 +64,14 @@ fn main_thread( let mut file_opened = false; loop { - if let Ok(cl) = clear_rx.recv_timeout(Duration::from_millis(1)) { + if let Ok(cl) = clear_rx.try_recv() { if cl { data = DataContainer::default(); failed_format_counter = 0; } } if !file_opened { - if let Ok(packet) = raw_data_rx.recv_timeout(Duration::from_millis(1)) { + if let Ok(packet) = raw_data_rx.try_recv() { data.loaded_from_file = false; if !packet.payload.is_empty() { sync_tx.send(true).expect("unable to send sync tx"); @@ -104,7 +103,7 @@ fn main_thread( } } } - if let Ok(fp) = load_rx.recv_timeout(Duration::from_millis(10)) { + if let Ok(fp) = load_rx.try_recv() { if let Some(file_ending) = fp.extension() { match file_ending.to_str().unwrap() { "csv" => { @@ -145,7 +144,7 @@ fn main_thread( *write_guard = data.clone(); } - if let Ok(csv_options) = save_rx.recv_timeout(Duration::from_millis(1)) { + if let Ok(csv_options) = save_rx.try_recv() { match save_to_csv(&data, &csv_options) { Ok(_) => { log::info!("saved data file to {:?} ", csv_options.file_path);