From f68cc0ba83833507a8f75bc6e5b02deff62f0a79 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 25 Oct 2025 22:55:23 +0800 Subject: [PATCH] reorder some bao-video operation for a cleaner init sequence --- services/bao-video/src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/services/bao-video/src/main.rs b/services/bao-video/src/main.rs index 90f842981..88dcb0b76 100644 --- a/services/bao-video/src/main.rs +++ b/services/bao-video/src/main.rs @@ -180,6 +180,10 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! { // but it'll do the job 90% of the time and it's way better than having none at all. let is_panic = Arc::new(AtomicBool::new(false)); + // ---- boot logo + display.blit_screen(&ux_api::bitmaps::baochip128x128::BITMAP); + display.redraw(); + // This is safe because the SPIM is finished with initialization, and the handler is // Mutex-protected. #[cfg(feature = "board-baosec")] @@ -191,6 +195,9 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! { // ---- camera initialization #[cfg(not(feature = "hosted-baosec"))] { + // wait for other inits to finish so we can do this roughly atomically + tt.sleep_ms(1000).ok(); + // setup camera power match bao1x_hal::axp2101::Axp2101::new(&mut i2c) { Ok(mut pmic) => { @@ -298,10 +305,6 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! { irq_csr.wfo(utra::irqarray8::EV_ENABLE_CAM_RX, 1); } - // ---- boot logo - display.blit_screen(&ux_api::bitmaps::baochip128x128::BITMAP); - display.redraw(); - // ---- main loop variables let screen_clip = Rectangle::new(Point::new(0, 0), display.screen_size());