cleanup bit-rot in I2C API in this branch

This commit is contained in:
bunnie 2025-08-02 00:49:38 +08:00
parent 06b095a2bb
commit d91b7843cc
3 changed files with 12 additions and 3 deletions

View file

@ -19,9 +19,11 @@ impl I2cApi for I2c {
_adr: u8,
buf: &mut [u8],
_repeated_start: bool,
) -> Result<usize, xous::Error> {
Ok(buf.len())
) -> Result<I2cResult, xous::Error> {
Ok(I2cResult::Ack(buf.len()))
}
fn i2c_write(&mut self, _dev: u8, _adr: u8, data: &[u8]) -> Result<usize, xous::Error> { Ok(data.len()) }
fn i2c_write(&mut self, _dev: u8, _adr: u8, data: &[u8]) -> Result<I2cResult, xous::Error> {
Ok(I2cResult::Ack(data.len()))
}
}

View file

@ -81,6 +81,11 @@ fn main() {
log::info!("Udma configure event: {:?}/{:?}, {:x}", periph, to_channel, event_offset);
}
}
HalOpcode::UdmaIrqStatusBits => {
if let Some(scalar) = msg.body.scalar_message_mut() {
scalar.arg1 = 0;
}
}
HalOpcode::PeriphReset => {
if let Some(scalar) = msg.body.scalar_message() {
let periph: PeriphId = num_traits::FromPrimitive::from_usize(scalar.arg1).unwrap();

View file

@ -33,4 +33,6 @@ impl UdmaGlobalConfig for UdmaGlobal {
}
fn reset(&self, peripheral: PeriphId) { self.reset(peripheral); }
fn irq_status_bits(&self, _bank: IrqBank) -> u32 { 0 }
}