Skip to content

Commit 6ccd572

Browse files
author
Jonas Schievink
committed
Fix example on the f302
1 parent 112f1ff commit 6ccd572

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/dac_sine.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ fn main() -> ! {
4949
.pa15
5050
.into_push_pull_output(&mut gpioa.moder, &mut gpioa.otyper);
5151

52-
// set up dac1, data is twelve bits, alighned right
52+
// set up dac1, data is twelve bits, aligned right
53+
#[cfg(not(feature = "svd-f302"))]
5354
let mut dac1 = Dac::new(dp.DAC1, &mut rcc.apb1);
5455

56+
#[cfg(feature = "svd-f302")]
57+
let mut dac1 = Dac::new(dp.DAC, &mut rcc.apb1);
58+
5559
let mut led = true;
5660

5761
loop {

src/dac.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use crate::rcc::{Enable, Reset, APB1};
66

7-
#[cfg(any(feature = "svd-f302",))]
7+
#[cfg(feature = "svd-f302")]
88
use crate::pac::DAC;
99

1010
#[cfg(any(

0 commit comments

Comments
 (0)