mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
add debug call for bio
This commit is contained in:
parent
a56ed768e8
commit
b991a54b52
4 changed files with 66 additions and 0 deletions
|
|
@ -100,6 +100,8 @@ pub trait BioApi<'a> {
|
|||
|
||||
/// Returns a version code for the underlying hardware.
|
||||
fn get_version(&self) -> u32;
|
||||
|
||||
fn debug(&self, core: BioCore);
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
|
|
@ -126,6 +128,7 @@ macro_rules! bio_code {
|
|||
}
|
||||
|
||||
core::arch::global_asm!(
|
||||
".option arch, +m",
|
||||
".align 4",
|
||||
concat!(".globl ", stringify!($name_start)),
|
||||
concat!(stringify!($name_start), ":"),
|
||||
|
|
@ -164,6 +167,8 @@ pub enum BioOp {
|
|||
ClaimDynamicPin,
|
||||
ReleaseDynamicPin,
|
||||
|
||||
Debug,
|
||||
|
||||
InvalidCall,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -218,6 +218,14 @@ impl<'a> BioApi<'a> for Bio {
|
|||
.map_err(|e| <xous::Error as Into<BioError>>::into(e))?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn debug(&self, core: BioCore) {
|
||||
send_message(
|
||||
self.conn,
|
||||
Message::new_blocking_scalar(BioOp::Debug.to_usize().unwrap(), core as usize, 0, 0, 0),
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
|
|
|
|||
|
|
@ -668,6 +668,23 @@ impl<'a> BioApi<'a> for BioSharedState {
|
|||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn debug(&self, core: BioCore) {
|
||||
match core {
|
||||
BioCore::Core0 => {
|
||||
crate::println!("DBG_{:?}: {:x}", core, self.bio.r(utralib::utra::bio_bdma::SFR_DBG0))
|
||||
}
|
||||
BioCore::Core1 => {
|
||||
crate::println!("DBG_{:?}: {:x}", core, self.bio.r(utralib::utra::bio_bdma::SFR_DBG1))
|
||||
}
|
||||
BioCore::Core2 => {
|
||||
crate::println!("DBG_{:?}: {:x}", core, self.bio.r(utralib::utra::bio_bdma::SFR_DBG2))
|
||||
}
|
||||
BioCore::Core3 => {
|
||||
crate::println!("DBG_{:?}: {:x}", core, self.bio.r(utralib::utra::bio_bdma::SFR_DBG3))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
|
|
|
|||
|
|
@ -54,6 +54,42 @@ fn bio_service(clk_freq: u32) {
|
|||
}
|
||||
}
|
||||
|
||||
BioOp::Debug => {
|
||||
if let Some(scalar) = msg_opt.as_mut().unwrap().body.scalar_message_mut() {
|
||||
let core = BioCore::from(scalar.arg1);
|
||||
match core {
|
||||
BioCore::Core0 => {
|
||||
log::info!(
|
||||
"DBG_{:?}: {:x}",
|
||||
core,
|
||||
bio_ss.bio.r(utralib::utra::bio_bdma::SFR_DBG0)
|
||||
)
|
||||
}
|
||||
BioCore::Core1 => {
|
||||
log::info!(
|
||||
"DBG_{:?}: {:x}",
|
||||
core,
|
||||
bio_ss.bio.r(utralib::utra::bio_bdma::SFR_DBG1)
|
||||
)
|
||||
}
|
||||
BioCore::Core2 => {
|
||||
log::info!(
|
||||
"DBG_{:?}: {:x}",
|
||||
core,
|
||||
bio_ss.bio.r(utralib::utra::bio_bdma::SFR_DBG2)
|
||||
)
|
||||
}
|
||||
BioCore::Core3 => {
|
||||
log::info!(
|
||||
"DBG_{:?}: {:x}",
|
||||
core,
|
||||
bio_ss.bio.r(utralib::utra::bio_bdma::SFR_DBG3)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BioOp::GetCoreHandle => {
|
||||
if let Some(scalar) = msg_opt.as_mut().unwrap().body.scalar_message_mut() {
|
||||
let index = scalar.arg1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue