Fix bug with input handling

This commit is contained in:
Sofia 2026-06-03 20:47:55 +03:00
parent 3ad6892578
commit 9c582a4de1
3 changed files with 10 additions and 10 deletions

View File

@ -141,8 +141,6 @@ impl<'a, 'd> ATCommands<'a, 'd> {
.find(|(_, l)| l.starts_with(start)) .find(|(_, l)| l.starts_with(start))
.map(|(i, _)| i); .map(|(i, _)| i);
log::info!("{:?}", self.lines);
if let Some(start_idx) = start_idx { if let Some(start_idx) = start_idx {
let mut response = Vec::new(); let mut response = Vec::new();

View File

@ -79,6 +79,7 @@ pub struct StateManager<'a> {
impl<'a> StateManager<'a> { impl<'a> StateManager<'a> {
pub fn update(&mut self) { pub fn update(&mut self) {
critical_section::with(|_| {
match self.curr_state.update(&mut self.data) { match self.curr_state.update(&mut self.data) {
Some(next_state) => { Some(next_state) => {
self.curr_state = next_state; self.curr_state = next_state;
@ -87,6 +88,7 @@ impl<'a> StateManager<'a> {
None => {} None => {}
} }
self.data.io.keypad.clear(); self.data.io.keypad.clear();
})
} }
pub fn draw(&mut self) { pub fn draw(&mut self) {

View File

@ -95,7 +95,7 @@ where
Some(response) => { Some(response) => {
return Some((self.fun.clone())(response)); return Some((self.fun.clone())(response));
} }
None => self.promise = None, None => {}
} }
return None; return None;
} }