diff --git a/src/at_commands.rs b/src/at_commands.rs index f33aff9..e556a45 100644 --- a/src/at_commands.rs +++ b/src/at_commands.rs @@ -141,8 +141,6 @@ impl<'a, 'd> ATCommands<'a, 'd> { .find(|(_, l)| l.starts_with(start)) .map(|(i, _)| i); - log::info!("{:?}", self.lines); - if let Some(start_idx) = start_idx { let mut response = Vec::new(); diff --git a/src/state.rs b/src/state.rs index eaabf04..eae09b0 100644 --- a/src/state.rs +++ b/src/state.rs @@ -79,14 +79,16 @@ pub struct StateManager<'a> { impl<'a> StateManager<'a> { pub fn update(&mut self) { - match self.curr_state.update(&mut self.data) { - Some(next_state) => { - self.curr_state = next_state; - self.curr_state.init(&mut self.data); + critical_section::with(|_| { + match self.curr_state.update(&mut self.data) { + Some(next_state) => { + self.curr_state = next_state; + self.curr_state.init(&mut self.data); + } + None => {} } - None => {} - } - self.data.io.keypad.clear(); + self.data.io.keypad.clear(); + }) } pub fn draw(&mut self) { diff --git a/src/states.rs b/src/states.rs index b54b6f2..630e69e 100644 --- a/src/states.rs +++ b/src/states.rs @@ -95,7 +95,7 @@ where Some(response) => { return Some((self.fun.clone())(response)); } - None => self.promise = None, + None => {} } return None; }