From b1870e51eafcf6ead3838dc800114229aae949f6 Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 7 Apr 2026 18:03:16 +0800 Subject: [PATCH] make it so that bootwait option is skipped if warm boot this prevents warm boot hold-up in case of latent key press during wakeup option: for warm boot it's assumed that when the user presses a key the intention is to wake up and go to normal operation, not wake up and wait for an update. --- bao1x-boot/boot1/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bao1x-boot/boot1/src/main.rs b/bao1x-boot/boot1/src/main.rs index 706684cb2..1d9ff40a1 100644 --- a/bao1x-boot/boot1/src/main.rs +++ b/bao1x-boot/boot1/src/main.rs @@ -18,8 +18,8 @@ use core::{ }; use bao1x_api::{BoardTypeCoding, BootWaitCoding, bollard}; -use bao1x_hal::hardening::*; use bao1x_hal::{board::KeyPress, iox::Iox, usb::driver::UsbDeviceState}; +use bao1x_hal::{buram::BackupManager, hardening::*}; use bao1x_hal::{sh1107::Oled128x128, udma::GlobalConfig}; use critical_section::Mutex; use platform::*; @@ -175,7 +175,9 @@ pub unsafe extern "C" fn rust_entry() -> ! { // Below is our first divergence out of boot1, and thus, all security checks must happen above // this line! - if boot_wait == BootWaitCoding::Disable && current_key.is_none() { + // If warm boot, always go straight to booting - don't override with key press. + let bu = BackupManager::new(); + if bu.get_flags().warm_boot() || (boot_wait == BootWaitCoding::Disable && current_key.is_none()) { // diverges if there is code to run try_boot(false, &mut csprng); // or_die == false means the rest of this gets run if there is no valid image