mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
cleanup bit-rot in I2C API in this branch
This commit is contained in:
parent
06b095a2bb
commit
d91b7843cc
3 changed files with 12 additions and 3 deletions
|
|
@ -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()))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue