Skip to content

Commit 182b5db

Browse files
authored
Merge branch 'stm32-rs:master' into master
2 parents 0c6c397 + 67ca8de commit 182b5db

33 files changed

+189
-203
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
**/*.orig
33
**/*.rs.bk
44
Cargo.lock
5+
6+
# VS Code
7+
/.vscode

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ features = ["stm32f746", "rt"]
1818
as-slice = "0.1.0"
1919
cortex-m = "0.6.0"
2020
cortex-m-rt = "0.6.8"
21+
embedded-time = "0.12.0"
2122
nb = "0.1.2"
2223
rtcc = "0.2"
2324
stm32f7 = "0.11.0"

examples/blinky_delay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn main() -> ! {
2222
let rcc = p.RCC.constrain();
2323

2424
// Configure clock and freeze it
25-
let clocks = rcc.cfgr.sysclk(216.mhz()).freeze();
25+
let clocks = rcc.cfgr.sysclk(216_000_000.Hz()).freeze();
2626

2727
// Get delay provider
2828
let mut delay = Delay::new(cp.SYST, clocks);

examples/can-echo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ fn main() -> ! {
2727
// Other boards might have a crystal with another frequency or none at all.
2828
let _clocks = rcc
2929
.cfgr
30-
.hse(HSEClock::new(25.mhz(), HSEClockMode::Bypass))
31-
.sysclk(216.mhz())
32-
.hclk(216.mhz())
30+
.hse(HSEClock::new(25_000_000.Hz(), HSEClockMode::Bypass))
31+
.sysclk(216_000_000.Hz())
32+
.hclk(216_000_000.Hz())
3333
.freeze();
3434

3535
let gpioa = dp.GPIOA.split();

examples/can-loopback.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ fn main() -> ! {
2929
// resonator must be used.
3030
let _clocks = rcc
3131
.cfgr
32-
.hse(HSEClock::new(25.mhz(), HSEClockMode::Bypass))
33-
.sysclk(216.mhz())
34-
.hclk(216.mhz())
32+
.hse(HSEClock::new(25_000_000.Hz(), HSEClockMode::Bypass))
33+
.sysclk(216_000_000.Hz())
34+
.hclk(216_000_000.Hz())
3535
.freeze();
3636

3737
let gpioa = dp.GPIOA.split();

examples/exti_button.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn main() -> ! {
4545
button.enable_interrupt(&mut exti);
4646

4747
// Freeze clocks
48-
rcc.constrain().cfgr.sysclk(216.mhz()).freeze();
48+
rcc.constrain().cfgr.sysclk(216_000_000.Hz()).freeze();
4949

5050
// Save information needed by the interrupt handler to the global variable
5151
free(|cs| {

examples/fmc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn main() -> ! {
4343
let dp = pac::Peripherals::take().unwrap();
4444

4545
// Get the delay provider.
46-
let clocks = dp.RCC.constrain().cfgr.sysclk(216.mhz()).freeze();
46+
let clocks = dp.RCC.constrain().cfgr.sysclk(216_000_000.Hz()).freeze();
4747
let mut delay = Delay::new(cp.SYST, clocks);
4848

4949
// IO

examples/serial_delay.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn main() -> ! {
2525
let cp = cortex_m::Peripherals::take().unwrap();
2626

2727
let rcc = p.RCC.constrain();
28-
let clocks = rcc.cfgr.sysclk(216.mhz()).freeze();
28+
let clocks = rcc.cfgr.sysclk(216_000_000.Hz()).freeze();
2929

3030
let mut delay = Delay::new(cp.SYST, clocks);
3131

@@ -40,7 +40,7 @@ fn main() -> ! {
4040
(tx, rx),
4141
clocks,
4242
serial::Config {
43-
baud_rate: 115_200.bps(),
43+
baud_rate: 115_200.Bps(),
4444
oversampling: serial::Oversampling::By16,
4545
character_match: None,
4646
},

examples/serial_dma.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn main() -> ! {
3535

3636
let dma = dma.handle.enable(&mut rcc.ahb1);
3737

38-
let clocks = rcc.cfgr.sysclk(216.mhz()).freeze();
38+
let clocks = rcc.cfgr.sysclk(216_000_000.Hz()).freeze();
3939

4040
let gpiod = p.GPIOD.split();
4141

@@ -47,7 +47,7 @@ fn main() -> ! {
4747
(tx, rx),
4848
clocks,
4949
serial::Config {
50-
baud_rate: 115_200.bps(),
50+
baud_rate: 115_200.Bps(),
5151
oversampling: serial::Oversampling::By16,
5252
character_match: None,
5353
},

examples/serial_echo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn main() -> ! {
2323
let p = pac::Peripherals::take().unwrap();
2424

2525
let rcc = p.RCC.constrain();
26-
let clocks = rcc.cfgr.sysclk(216.mhz()).freeze();
26+
let clocks = rcc.cfgr.sysclk(216_000_000.Hz()).freeze();
2727

2828
let gpioa = p.GPIOA.split();
2929
let gpiob = p.GPIOB.split();
@@ -36,7 +36,7 @@ fn main() -> ! {
3636
(tx, rx),
3737
clocks,
3838
serial::Config {
39-
baud_rate: 115_200.bps(),
39+
baud_rate: 115_200.Bps(),
4040
oversampling: serial::Oversampling::By16,
4141
character_match: None,
4242
},

0 commit comments

Comments
 (0)