add code to the server

this is the actual handler inside the Xous service which, when
receiving the opcode, dereferences its exclusive pointer to the
IRQ bank and then returns the result to the caller.
This commit is contained in:
bunnie 2025-06-07 02:48:58 +08:00
parent f3e7eec6cf
commit 76a45ff47d

View file

@ -5,6 +5,7 @@ use bitfield::*;
use cramium_api::*;
use cramium_hal::{iox::Iox, udma::GlobalConfig};
use num_traits::*;
use udma::UdmaGlobalConfig;
use utralib::CSR;
#[cfg(feature = "quantum-timer")]
use utralib::utra;
@ -526,6 +527,13 @@ fn main() {
udma_global.map_event_with_offset(periph, event_offset, to_channel);
}
}
HalOpcode::UdmaIrqStatusBits => {
if let Some(scalar) = msg.body.scalar_message_mut() {
let bank = num_traits::FromPrimitive::from_usize(scalar.arg1)
.expect("Bad argument to UdmaIrqStatusBits");
scalar.arg1 = udma_global.irq_status_bits(bank) as usize;
}
}
HalOpcode::PeriphReset => {
if let Some(scalar) = msg.body.scalar_message() {
let periph: PeriphId = num_traits::FromPrimitive::from_usize(scalar.arg1).unwrap();