Merge pull request #694 from betrusted-io/fix-baremetal

Fix baremetal
This commit is contained in:
bunnie 2025-10-06 14:19:14 +08:00 committed by GitHub
commit b87c2dfa50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 1 deletions

View file

@ -89,7 +89,7 @@ pub unsafe extern "C" fn rust_entry() -> ! {
let iox = Iox::new(utra::iox::HW_IOX_BASE as *mut u32); let iox = Iox::new(utra::iox::HW_IOX_BASE as *mut u32);
#[cfg(feature = "bao1x-usb")] #[cfg(feature = "bao1x-usb")]
let (mut last_usb_state, mut portsc) = crate::platform::usb::glue::hotplug_usb(&iox); let (mut last_usb_state, mut portsc) = crate::platform::usb::glue::hotplug_usb(&iox);
#[cfg(feature = "bao1x-usb")]
crate::println!( crate::println!(
" [usb connected {:?}] [tx idle {:?}]", " [usb connected {:?}] [tx idle {:?}]",
USB_CONNECTED.load(Ordering::SeqCst), USB_CONNECTED.load(Ordering::SeqCst),

View file

@ -205,8 +205,10 @@ pub fn setup_rx(perclk: u32) -> bao1x_hal::udma::Uart {
// ==== DUART-only debug print ==== -> this is used for USB feedback to avoid Tx loops on USB // ==== DUART-only debug print ==== -> this is used for USB feedback to avoid Tx loops on USB
/// Placeholder for debug /// Placeholder for debug
#[allow(dead_code)]
pub struct Duart {} pub struct Duart {}
#[allow(dead_code)]
impl Duart { impl Duart {
/// Print a character /// Print a character
pub fn putc(&self, c: u8) { pub fn putc(&self, c: u8) {

View file

@ -111,6 +111,7 @@ pub fn usb_ep3_bulk_out_complete(
this.bulk_xfer(3, USB_RECV, acm_buf.as_ptr() as usize, acm_buf.len(), 0, 0); this.bulk_xfer(3, USB_RECV, acm_buf.as_ptr() as usize, acm_buf.len(), 0, 0);
} }
#[allow(dead_code)]
pub fn flush() { pub fn flush() {
unsafe { unsafe {
if let Some(ref mut usb_ref) = crate::platform::usb::USB { if let Some(ref mut usb_ref) = crate::platform::usb::USB {