Skip to content

Commit c321ec3

Browse files
committed
tx: Set the transmit buffer length correctly
1 parent 7c22c31 commit c321ec3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/dma/tx/descriptor.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ impl TxDescriptor {
135135
fn set_buffer1_len(&mut self, len: usize) {
136136
unsafe {
137137
self.desc.modify(1, |w| {
138-
(w & !TXDESC_1_TBS_MASK) | ((len as u32) << TXDESC_1_TBS_SHIFT)
138+
let masked_len = w & !TXDESC_1_TBS_MASK;
139+
let with_len = masked_len | ((len as u32) << TXDESC_1_TBS_SHIFT);
140+
with_len
139141
});
140142
}
141143
}

0 commit comments

Comments
 (0)