Skip to content

Commit 6b3f3bc

Browse files
committed
Bumped stm32f0 dependency, changed interrupt handler, bumped version to 0.9.0
Signed-off-by: Daniel Egger <[email protected]>
1 parent 85c2c91 commit 6b3f3bc

File tree

6 files changed

+16
-18
lines changed

6 files changed

+16
-18
lines changed

Cargo.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ categories = [
77
"no-std",
88
]
99
description = "Peripheral access API for STM32F0 series microcontrollers"
10-
documentation = "https://docs.rs/stm32f0xx-hal"
10+
documentation = "https://docs.rs/crate/stm32f0xx-hal"
11+
1112
keywords = [
1213
"arm",
1314
"cortex-m",
@@ -18,15 +19,18 @@ license = "0BSD"
1819
name = "stm32f0xx-hal"
1920
readme = "README.md"
2021
repository = "https://github.com/stm32-rs/stm32f0xx-hal"
21-
version = "0.8.0"
22+
version = "0.9.0"
23+
24+
[package.metadata.docs.rs]
25+
features = ["stm32f042", "rt"]
2226

2327
[dependencies]
2428
bare-metal = { version = "0.2.4", features = ["const-fn"] }
2529
cortex-m = "0.5.8"
26-
cortex-m-rt = "0.6.6"
30+
cortex-m-rt = "0.6.7"
2731
nb = "0.1.1"
2832
void = { version = "1.0.2", default-features = false }
29-
stm32f0 = "0.4.0"
33+
stm32f0 = "0.5.0"
3034

3135
[dependencies.cast]
3236
default-features = false

examples/led_hal_button_irq.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ use crate::hal::prelude::*;
1111

1212
use cortex_m::interrupt::Mutex;
1313
use cortex_m::peripheral::Peripherals as c_m_Peripherals;
14-
use cortex_m_rt::entry;
14+
use cortex_m_rt::{entry, interrupt};
1515

16-
pub use crate::hal::interrupt;
1716
pub use crate::hal::stm32;
1817
pub use crate::hal::stm32::*;
1918

@@ -87,9 +86,10 @@ fn main() -> ! {
8786

8887
/* Define an intterupt handler, i.e. function to call when exception occurs. Here if our external
8988
* interrupt trips the flash function which will be called */
90-
interrupt!(EXTI0_1, button_press);
89+
//interrupt!(EXTI0_1, button_press);
9190

92-
fn button_press() {
91+
#[interrupt]
92+
fn EXTI0_1() {
9393
// Enter critical section
9494
cortex_m::interrupt::free(|cs| {
9595
// Obtain all Mutex protected resources

src/i2c.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::stm32::{I2C1, RCC};
33

44
use embedded_hal::blocking::i2c::{Write, WriteRead};
55

6+
use core::cmp;
67
#[cfg(feature = "stm32f042")]
78
use crate::gpio::gpioa::{PA10, PA11, PA12, PA9};
89
#[cfg(feature = "stm32f042")]
@@ -12,7 +13,6 @@ use crate::gpio::gpiof::{PF0, PF1};
1213
#[cfg(feature = "stm32f042")]
1314
use crate::gpio::{Alternate, AF1, AF4, AF5};
1415
use crate::time::{KiloHertz, U32Ext};
15-
use core::cmp;
1616

1717
/// I2C abstraction
1818
pub struct I2c<I2C, PINS> {

src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ pub use stm32f0::stm32f0x2 as stm32;
1313
#[cfg(feature = "stm32f030")]
1414
pub use stm32f0::stm32f0x0 as stm32;
1515

16-
// Enable use of interrupt macro
17-
#[cfg(feature = "rt")]
18-
pub use stm32f0::interrupt;
19-
2016
pub mod delay;
2117
pub mod gpio;
2218
pub mod i2c;

src/rcc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use core::cmp;
22

3+
use cast::u32;
34
#[cfg(any(feature = "stm32f042", feature = "stm32f030"))]
45
use crate::stm32::{FLASH, RCC};
5-
use cast::u32;
66

77
use crate::time::Hertz;
88

src/spi.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,15 @@ impl Pins<SPI1>
3939
gpioa::PA6<Alternate<AF0>>,
4040
gpioa::PA7<Alternate<AF0>>,
4141
)
42-
{
43-
}
42+
{}
4443
#[cfg(feature = "stm32f042")]
4544
impl Pins<SPI1>
4645
for (
4746
gpiob::PB3<Alternate<AF0>>,
4847
gpiob::PB4<Alternate<AF0>>,
4948
gpiob::PB5<Alternate<AF0>>,
5049
)
51-
{
52-
}
50+
{}
5351

5452
#[cfg(feature = "stm32f042")]
5553
impl<PINS> Spi<SPI1, PINS> {

0 commit comments

Comments
 (0)