Skip to content

Commit

Permalink
Not sure if sram sections get nulled out during initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
datdenkikniet committed Feb 4, 2023
1 parent 9b7dc07 commit 3f1554e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/dma/rx/h_desc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ impl RxDescriptor {

pub(super) fn setup(&mut self, buffer: &[u8]) {
self.set_owned(buffer);
unsafe {
for i in 0..4 {
self.inner_raw.write(i, 0);
}
}
}

/// Pass ownership to the DMA engine
Expand Down
9 changes: 7 additions & 2 deletions src/dma/tx/h_desc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,13 @@ impl TxDescriptor {
(self.inner_raw.read(3) & TXDESC_3_LD) == TXDESC_3_LD
}

// Placeholder for API parity with f-series descriptor.
pub(super) fn setup(&mut self, _: &[u8]) {}
pub(super) fn setup(&mut self, _: &[u8]) {
unsafe {
for i in 0..4 {
self.inner_raw.write(i, 0);
}
}
}

pub(super) fn is_owned(&self) -> bool {
(self.inner_raw.read(3) & TXDESC_3_OWN) == TXDESC_3_OWN
Expand Down

0 comments on commit 3f1554e

Please sign in to comment.