Skip to content

Commit 3f1554e

Browse files
committed
Not sure if sram sections get nulled out during initialization
1 parent 9b7dc07 commit 3f1554e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/dma/rx/h_desc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ impl RxDescriptor {
137137

138138
pub(super) fn setup(&mut self, buffer: &[u8]) {
139139
self.set_owned(buffer);
140+
unsafe {
141+
for i in 0..4 {
142+
self.inner_raw.write(i, 0);
143+
}
144+
}
140145
}
141146

142147
/// Pass ownership to the DMA engine

src/dma/tx/h_desc.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,13 @@ impl TxDescriptor {
148148
(self.inner_raw.read(3) & TXDESC_3_LD) == TXDESC_3_LD
149149
}
150150

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

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

0 commit comments

Comments
 (0)