Skip to content

Commit 285db5e

Browse files
committed
derive Default implementation for MdmaBurstSize
1 parent 0c1c9e7 commit 285db5e

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/dma/mdma.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,11 @@ impl Default for MdmaIncrement {
228228
}
229229

230230
/// MDMA burst size. This type contains the _register_ value, thus the burst
231-
/// size is equal to 2^N where N is the register value
232-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
231+
/// size is equal to 2^N where N is the register value.
232+
///
233+
/// The derived Default implementation gives a burst size of 2^0 = 1
234+
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord)]
233235
pub struct MdmaBurstSize(pub(crate) u8);
234-
impl Default for MdmaBurstSize {
235-
fn default() -> Self {
236-
MdmaBurstSize(0)
237-
}
238-
}
239236
impl MdmaBurstSize {
240237
// TODO: add const to make this a const fn
241238
fn from_size(mut v: usize) -> Self {

0 commit comments

Comments
 (0)