From a77452220b0deab165363ed733272825016bdf55 Mon Sep 17 00:00:00 2001 From: Fabien ROUSSEL Date: Wed, 20 Dec 2023 00:48:14 +0100 Subject: [PATCH] Fixed the period rate to 1 second. --- serial_term/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/serial_term/src/main.rs b/serial_term/src/main.rs index 2a7fe51..1f1fb60 100644 --- a/serial_term/src/main.rs +++ b/serial_term/src/main.rs @@ -2,6 +2,7 @@ use crate::egui::Color32; use crate::egui::RichText; use eframe::egui; use std::string::String; +use std::time::Duration; #[derive(Default)] struct SerialAppCore { @@ -76,6 +77,8 @@ impl eframe::App for SerialAppCore { .unwrap() .as_mut() .read_to_string(&mut self.text_buffer); + + ctx.request_repaint_after(Duration::from_secs(1)); }); } }