turn off console printing to USB when USB is shut down

This commit is contained in:
bunnie 2025-11-23 18:05:28 +08:00
parent 428845777b
commit 9a1cd5429d

View file

@ -142,6 +142,7 @@ pub fn setup() -> (UsbDeviceState, u32) {
}
pub fn shutdown() {
crate::debug::USE_CONSOLE.store(false, core::sync::atomic::Ordering::SeqCst);
unsafe {
if let Some(ref mut usb_ref) = crate::platform::bao1x::usb::USB {
let usb = &mut *core::ptr::addr_of_mut!(*usb_ref);