diff options
| author | Timo Kröger <[email protected]> | 2021-07-23 14:24:38 +0200 |
|---|---|---|
| committer | Timo Kröger <[email protected]> | 2021-07-23 17:54:13 +0200 |
| commit | 5ac91933ff0e4643823c77b357d90e82007fc9fb (patch) | |
| tree | 5f252cde081a002f09659059bf746bf2896a3d16 /examples/stm32f4/src/bin | |
| parent | ec5d44333ab6c0711424699efb2e782baf0124c7 (diff) | |
stm32: No need to enable GPIO clocks manually
Diffstat (limited to 'examples/stm32f4/src/bin')
| -rw-r--r-- | examples/stm32f4/src/bin/blinky.rs | 9 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/button.rs | 9 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/button_exti.rs | 9 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/spi.rs | 11 | ||||
| -rw-r--r-- | examples/stm32f4/src/bin/usart.rs | 9 |
5 files changed, 1 insertions, 46 deletions
diff --git a/examples/stm32f4/src/bin/blinky.rs b/examples/stm32f4/src/bin/blinky.rs index 0e411d782..da512dcec 100644 --- a/examples/stm32f4/src/bin/blinky.rs +++ b/examples/stm32f4/src/bin/blinky.rs | |||
| @@ -25,15 +25,6 @@ fn main() -> ! { | |||
| 25 | w.set_dbg_standby(true); | 25 | w.set_dbg_standby(true); |
| 26 | w.set_dbg_stop(true); | 26 | w.set_dbg_stop(true); |
| 27 | }); | 27 | }); |
| 28 | |||
| 29 | pac::RCC.ahb1enr().modify(|w| { | ||
| 30 | w.set_gpioaen(true); | ||
| 31 | w.set_gpioben(true); | ||
| 32 | w.set_gpiocen(true); | ||
| 33 | w.set_gpioden(true); | ||
| 34 | w.set_gpioeen(true); | ||
| 35 | w.set_gpiofen(true); | ||
| 36 | }); | ||
| 37 | } | 28 | } |
| 38 | 29 | ||
| 39 | let p = embassy_stm32::init(Default::default()); | 30 | let p = embassy_stm32::init(Default::default()); |
diff --git a/examples/stm32f4/src/bin/button.rs b/examples/stm32f4/src/bin/button.rs index 901fce418..395ec4847 100644 --- a/examples/stm32f4/src/bin/button.rs +++ b/examples/stm32f4/src/bin/button.rs | |||
| @@ -24,15 +24,6 @@ fn main() -> ! { | |||
| 24 | w.set_dbg_standby(true); | 24 | w.set_dbg_standby(true); |
| 25 | w.set_dbg_stop(true); | 25 | w.set_dbg_stop(true); |
| 26 | }); | 26 | }); |
| 27 | |||
| 28 | pac::RCC.ahb1enr().modify(|w| { | ||
| 29 | w.set_gpioaen(true); | ||
| 30 | w.set_gpioben(true); | ||
| 31 | w.set_gpiocen(true); | ||
| 32 | w.set_gpioden(true); | ||
| 33 | w.set_gpioeen(true); | ||
| 34 | w.set_gpiofen(true); | ||
| 35 | }); | ||
| 36 | } | 27 | } |
| 37 | 28 | ||
| 38 | let p = embassy_stm32::init(Default::default()); | 29 | let p = embassy_stm32::init(Default::default()); |
diff --git a/examples/stm32f4/src/bin/button_exti.rs b/examples/stm32f4/src/bin/button_exti.rs index 63c273b1a..bccd3870d 100644 --- a/examples/stm32f4/src/bin/button_exti.rs +++ b/examples/stm32f4/src/bin/button_exti.rs | |||
| @@ -48,15 +48,6 @@ fn main() -> ! { | |||
| 48 | w.set_dbg_stop(true); | 48 | w.set_dbg_stop(true); |
| 49 | }); | 49 | }); |
| 50 | 50 | ||
| 51 | pac::RCC.ahb1enr().modify(|w| { | ||
| 52 | w.set_gpioaen(true); | ||
| 53 | w.set_gpioben(true); | ||
| 54 | w.set_gpiocen(true); | ||
| 55 | w.set_gpioden(true); | ||
| 56 | w.set_gpioeen(true); | ||
| 57 | w.set_gpiofen(true); | ||
| 58 | }); | ||
| 59 | |||
| 60 | // EXTI clock | 51 | // EXTI clock |
| 61 | pac::RCC.apb2enr().modify(|w| { | 52 | pac::RCC.apb2enr().modify(|w| { |
| 62 | w.set_syscfgen(true); | 53 | w.set_syscfgen(true); |
diff --git a/examples/stm32f4/src/bin/spi.rs b/examples/stm32f4/src/bin/spi.rs index f8c9997ed..40b0748d7 100644 --- a/examples/stm32f4/src/bin/spi.rs +++ b/examples/stm32f4/src/bin/spi.rs | |||
| @@ -14,11 +14,11 @@ use embedded_hal::digital::v2::OutputPin; | |||
| 14 | use example_common::*; | 14 | use example_common::*; |
| 15 | 15 | ||
| 16 | use cortex_m_rt::entry; | 16 | use cortex_m_rt::entry; |
| 17 | use embassy_stm32::dbgmcu::Dbgmcu; | ||
| 17 | use embassy_stm32::pac; | 18 | use embassy_stm32::pac; |
| 18 | use embassy_stm32::spi::{Config, Spi}; | 19 | use embassy_stm32::spi::{Config, Spi}; |
| 19 | use embassy_stm32::time::Hertz; | 20 | use embassy_stm32::time::Hertz; |
| 20 | use embedded_hal::blocking::spi::Transfer; | 21 | use embedded_hal::blocking::spi::Transfer; |
| 21 | use embassy_stm32::dbgmcu::Dbgmcu; | ||
| 22 | 22 | ||
| 23 | #[entry] | 23 | #[entry] |
| 24 | fn main() -> ! { | 24 | fn main() -> ! { |
| @@ -26,15 +26,6 @@ fn main() -> ! { | |||
| 26 | 26 | ||
| 27 | unsafe { | 27 | unsafe { |
| 28 | Dbgmcu::enable_all(); | 28 | Dbgmcu::enable_all(); |
| 29 | |||
| 30 | pac::RCC.ahb1enr().modify(|w| { | ||
| 31 | w.set_gpioaen(true); | ||
| 32 | w.set_gpioben(true); | ||
| 33 | w.set_gpiocen(true); | ||
| 34 | w.set_gpioden(true); | ||
| 35 | w.set_gpioeen(true); | ||
| 36 | w.set_gpiofen(true); | ||
| 37 | }); | ||
| 38 | } | 29 | } |
| 39 | 30 | ||
| 40 | let p = embassy_stm32::init(Default::default()); | 31 | let p = embassy_stm32::init(Default::default()); |
diff --git a/examples/stm32f4/src/bin/usart.rs b/examples/stm32f4/src/bin/usart.rs index dbe17c910..51a2e0fd0 100644 --- a/examples/stm32f4/src/bin/usart.rs +++ b/examples/stm32f4/src/bin/usart.rs | |||
| @@ -47,15 +47,6 @@ fn main() -> ! { | |||
| 47 | w.set_dbg_standby(true); | 47 | w.set_dbg_standby(true); |
| 48 | w.set_dbg_stop(true); | 48 | w.set_dbg_stop(true); |
| 49 | }); | 49 | }); |
| 50 | |||
| 51 | pac::RCC.ahb1enr().modify(|w| { | ||
| 52 | w.set_gpioaen(true); | ||
| 53 | w.set_gpioben(true); | ||
| 54 | w.set_gpiocen(true); | ||
| 55 | w.set_gpioden(true); | ||
| 56 | w.set_gpioeen(true); | ||
| 57 | w.set_gpiofen(true); | ||
| 58 | }); | ||
| 59 | } | 50 | } |
| 60 | 51 | ||
| 61 | let executor = EXECUTOR.put(Executor::new()); | 52 | let executor = EXECUTOR.put(Executor::new()); |
