Skip to content

Commit 32a7ffd

Browse files
committed
Enable enhanced descriptors only for non-f1 parts
1 parent 86cda19 commit 32a7ffd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/desc.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ use core::ops::{Deref, DerefMut};
33
use aligned::{Aligned, A8};
44
use volatile_register::{RO, RW};
55

6+
#[cfg(not(feature = "stm32f107"))]
7+
const DESC_SIZE: usize = 8;
8+
9+
#[cfg(feature = "stm32f107")]
10+
const DESC_SIZE: usize = 4;
11+
612
#[repr(C)]
713
pub struct Descriptor {
8-
desc: Aligned<A8, [u32; 8]>,
14+
desc: Aligned<A8, [u32; DESC_SIZE]>,
915
}
1016

1117
impl Clone for Descriptor {
@@ -25,7 +31,7 @@ impl Default for Descriptor {
2531
impl Descriptor {
2632
pub const fn new() -> Self {
2733
Self {
28-
desc: Aligned([0; 8]),
34+
desc: Aligned([0; DESC_SIZE]),
2935
}
3036
}
3137

0 commit comments

Comments
 (0)