fix(menu): ignore key events without an available key

Some firmware signals the key event without a key being available.
This previously aborted boot with "no key was pressed"; treat it as a
no-op and keep waiting instead.
This commit is contained in:
alex authored and Alex Zenla committed 2026-09-26 18:58:54 -07:00
1 parent 1f5bc07c22
commit f7e7a9122b
1 file changed
+4 -2
+4 -2
View File
@@ -1,6 +1,6 @@
use crate::entries::BootableEntry;
use alloc::vec;
use anyhow::{Context, Result, bail};
use anyhow::{Context, Result};
use core::time::Duration;
use eficore::bootloader_interface::BootloaderInterface;
use eficore::platform::timer::PlatformTimer;
@@ -86,8 +86,10 @@ fn read(input: &mut Input, timeout: &Duration) -> Result<MenuOperation> {
}
// If we reach here, there is a key event.
// Some firmware signals the key event without a key being available,
// in which case there is nothing to do.
let Some(key) = input.read_key().context("unable to read key")? else {
bail!("no key was pressed");
return Ok(MenuOperation::Nop);
};
match key {