add better loading feedback in various configs

This commit is contained in:
bunnie 2025-10-05 16:59:55 +08:00
parent 0f98c3bea1
commit 07ec63a1b3

View file

@ -279,15 +279,14 @@ pub fn usb_ep1_bulk_out_complete(
("none", 0) ("none", 0)
} }
}; };
if status != 0 if status != 0 && status % UX_UPDATE_INTERVAL_BYTES == 0 {
&& status % UX_UPDATE_INTERVAL_BYTES == 0 if IS_BAOSEC.load(Ordering::SeqCst) {
&& IS_BAOSEC.load(Ordering::SeqCst)
{
// conjure a pointer to the sh1107 object // conjure a pointer to the sh1107 object
let iox = Iox::new(utralib::utra::iox::HW_IOX_BASE as *mut u32); let iox = Iox::new(utralib::utra::iox::HW_IOX_BASE as *mut u32);
let (channel, _, _, _) = bao1x_hal::board::get_display_pins(); let (channel, _, _, _) = bao1x_hal::board::get_display_pins();
// these parameters are copied out of the sh1107 driver. Maybe we should just create // these parameters are copied out of the sh1107 driver. Maybe we should just
// a convenience function that "just sets these" since hardware peripherals don't // create a convenience function that "just sets
// these" since hardware peripherals don't
// spontaneously move around, and when they do you'd like to have a single spot to // spontaneously move around, and when they do you'd like to have a single spot to
// maintain the changes... // maintain the changes...
let mut sh1107 = unsafe { let mut sh1107 = unsafe {
@ -317,10 +316,14 @@ pub fn usb_ep1_bulk_out_complete(
&iox, &iox,
) )
}; };
// have to restore this because the frame buffer is lost on the raw-parts conversion // have to restore this because the frame buffer is lost on the raw-parts
// conversion
sh1107.blit_screen(&ux_api::bitmaps::baochip128x128::BITMAP); sh1107.blit_screen(&ux_api::bitmaps::baochip128x128::BITMAP);
let msg = alloc::format!("{} - {}k", partition, status / 1024); let msg = alloc::format!("{} - {}k", partition, status / 1024);
crate::marquee(&mut sh1107, &msg); crate::marquee(&mut sh1107, &msg);
} else {
crate::println_d!("{} - {}k", partition, status / 1024);
}
} }
} }
// replace the tracking block with the new one, if a new one was provided // replace the tracking block with the new one, if a new one was provided