when usb is disconnected, toggle the correct flag

was turning off console altogether
we actually just want to turn off printing to USB.
This commit is contained in:
bunnie 2026-01-19 02:41:47 +08:00
parent 18a58c7d18
commit 6bb94a148e

View file

@ -145,7 +145,7 @@ pub fn setup() -> (UsbDeviceState, u32) {
}
pub fn shutdown() {
crate::debug::USE_CONSOLE.store(false, core::sync::atomic::Ordering::SeqCst);
crate::USB_CONNECTED.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);