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 33daedf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/dma/rx/h_desc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ impl RxDescriptor {

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

/// Pass ownership to the DMA engine
Expand Down
5 changes: 3 additions & 2 deletions src/dma/tx/h_desc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ 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]) {
(0..4).for_each(|i| unsafe { 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 33daedf

Please sign in to comment.