Skip to content

Commit

Permalink
Release 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
David-OConnor committed Apr 3, 2021
1 parent b6b056a commit 65e11ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "stm32-hal2"
version = "0.2.1"
version = "0.2.2"
authors = ["David O'Connor <david.alan.oconnor@gmail.com>"]
description = "Hardware abstraction layer for the stm32 chips"
keywords = ["no-std", "stm32", "embedded", "embedded-hal"]
Expand Down
5 changes: 5 additions & 0 deletions examples/syntax_overview/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use embedded_hal::spi::{Phase, Polarity, Mode};
// Import parts of this library we use. You could use this style, or perhaps import
// less here.
use stm32_hal2::{
self,
adc::{self, Adc, AdcChannel},
clocks::Clocks,
dac::{Dac, Channel as DacChannel, DacBits},
Expand All @@ -41,6 +42,10 @@ fn main() -> ! {
// Set up peripherals specific to the microcontroller you're using.
let mut dp = pac::Peripherals::take().unwrap();

// This line is required to prevent the debugger from disconnecting on entering WFI.
// This appears to be a limitation of many STM32 families. Not required in production code.
stm32_hal2::debug_workaround(&mut dp.DBGMCU, &mut dp.RCC);

// Create an initial clock configuration that uses the MCU's internal oscillator (HSI),
// sets the MCU to its maximum system clock speed.
let clock_cfg = Clocks::default();
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ pub fn debug_workaround(dbgmcu: &mut pac::DBGMCU, rcc: &mut pac::RCC) {
dbgmcu.cr.modify(|_, w| w.dbg_stop().set_bit());
dbgmcu.cr.modify(|_, w| w.dbg_standby().set_bit());

// todo Some MCUs may need the dbgmcu lines, but not DMA enabled.
// todo: Remove this part on MCUs not affected. F4 and L4 are confirmed affected.

#[cfg(feature = "f3")]
rcc.ahbenr.modify(|_, w| w.dma1en().set_bit());

Expand Down

0 comments on commit 65e11ac

Please sign in to comment.