Skip to content

Commit a673115

Browse files
committed
Removed unused address from read channel
1 parent 40e362a commit a673115

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bus.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub struct AddressBus {
77
/// This channel is used to ask the CPU to send data through the mmio_read channel
88
pub mmio_req: (crossbeam_channel::Sender<(u16, u16)>, crossbeam_channel::Receiver<(u16, u16)>),
99
/// This channel is used for RAM reading by MMIO peripherals
10-
pub mmio_read: (crossbeam_channel::Sender<(u16, Vec<u8>)>, crossbeam_channel::Receiver<(u16, Vec<u8>)>),
10+
pub mmio_read: (crossbeam_channel::Sender<Vec<u8>>, crossbeam_channel::Receiver<Vec<u8>>),
1111
/// This channel is used for RAM writing by MMIO peripherals
1212
pub mmio_write: (crossbeam_channel::Sender<(u16, u8)>, crossbeam_channel::Receiver<(u16, u8)>),
1313
/// This channel is used for non memory-mapped IO (OUT : CPU -> peripherals)
@@ -49,13 +49,13 @@ impl AddressBus {
4949
}
5050

5151
/// Send a vec of bytes of the address space via the read channel. Typical use : transfer VRAM data.
52-
pub fn mmio_send(&self, start: u16, len: u16) -> Result<(), crate::crossbeam_channel::TrySendError<(u16, Vec<u8>)>> {
52+
pub fn mmio_send(&self, start: u16, len: u16) -> Result<(), crate::crossbeam_channel::TrySendError<Vec<u8>>> {
5353
if (start + len) as usize > self.address_space.len() { panic!("Read operation after the end of address space !") }
5454
let mut d: Vec<u8> = Vec::new();
5555
for i in 0..len {
5656
d.push(self.address_space[usize::from(start + i)]);
5757
}
58-
self.mmio_read.0.try_send((start as u16, d))?;
58+
self.mmio_read.0.try_send(d)?;
5959
Ok(())
6060
}
6161

0 commit comments

Comments
 (0)