Skip to content

Commit

Permalink
#32 rm commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
HusseinAbdelhamid committed Dec 5, 2024
1 parent eda8e88 commit a116dfb
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,51 +87,6 @@ impl SpiDevice<u8> for ExampleSPIDevice {
}
Ok(())
}
// fn transfer(&mut self, read: &mut [u8], write: &[u8]) -> Result<(), Self::Error> {
// // write command -> returns empty buffer
// if (write[0] >> 4) == 0x2 {
// return Ok(());
// }

// // RAM read command
// if read.len() == 8 && read == [0u8; 8] {
// read.iter_mut().enumerate().for_each(|(i, val)| {
// *val += (i + 1) as u8;
// });
// return Ok(());
// }

// // SFR Read command
// if write[0] >= 0x3 {
// match write[1] {
// // addr: C1CON reg 2
// 0x2 => {
// // configuration mode
// if self.read_calls == 0 {
// self.read_calls += 1;
// read.copy_from_slice(&[0, 0, 0b1001_0100]);
// }

// // return operation mode NormalCANFD mode (called in configure and during transmission)
// read.copy_from_slice(&[0x0, 0x0, 0b0000_0000]);
// }
// // C1FIFOSTA2
// 0x6C => read.copy_from_slice(&[0, 0, 0x1]),
// // C1FIFOUA2 (2 extra bytes in beginning for cmd+addr)
// 0x70 => read.copy_from_slice(&[0, 0, 0, 0, 0x04, 0xA2]),
// // C1FIFOCON2 register 1
// 0x69 => read.copy_from_slice(&[0, 0, 0]),
// // C1FIFOSTA1
// 0x60 => read.copy_from_slice(&[0, 0, 0x1]),
// // C1FIFOUA1
// 0x64 => read.copy_from_slice(&[0, 0, 0, 0x04, 0x7C]),

// _ => {}
// };
// }

// Ok(())
// }
}

#[derive(Debug, PartialEq, Eq)]
Expand Down

0 comments on commit a116dfb

Please sign in to comment.