Skip to content

Commit 720cf74

Browse files
authored
Merge pull request #20 from WGuLL/fixedUpdateRate
Fixed the period rate to 1 second.
2 parents 6d92843 + a774522 commit 720cf74

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

serial_term/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::egui::Color32;
22
use crate::egui::RichText;
33
use eframe::egui;
44
use std::string::String;
5+
use std::time::Duration;
56

67
#[derive(Default)]
78
struct SerialAppCore {
@@ -76,6 +77,8 @@ impl eframe::App for SerialAppCore {
7677
.unwrap()
7778
.as_mut()
7879
.read_to_string(&mut self.text_buffer);
80+
81+
ctx.request_repaint_after(Duration::from_secs(1));
7982
});
8083
}
8184
}

0 commit comments

Comments
 (0)