Skip to content

Commit

Permalink
update stm32g0 dependency and add new chip variant features
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpolo committed Oct 13, 2021
1 parent be92697 commit 33fcaeb
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 9 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ jobs:
- stable
feature:
- stm32g030
- stm32g050
- stm32g070
- stm32g0b0
- stm32g031
- stm32g041
- stm32g070
- stm32g051
- stm32g061
- stm32g071
- stm32g081
- stm32g0b1
- stm32g0c1

steps:
- uses: actions/checkout@v2
Expand All @@ -28,4 +34,4 @@ jobs:
override: true

- name: Regular build
run: cargo check --features ${{ matrix.feature }}
run: cargo check --features ${{ matrix.feature }}
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cortex-m = "0.7.1"
nb = "1.0.0"

[dependencies.stm32g0]
version = "0.13.0"
version = "0.14.0"
features = ["rt"]

[dependencies.bare-metal]
Expand Down Expand Up @@ -50,11 +50,17 @@ ws2812-spi = { version = "0.3.0", features = [] }
[features]
rt = ["stm32g0/rt"]
stm32g030 = ["stm32g0/stm32g030", "stm32g0x0"]
stm32g050 = ["stm32g0/stm32g050", "stm32g0x0"]
stm32g070 = ["stm32g0/stm32g070", "stm32g0x0"]
stm32g0b0 = ["stm32g0/stm32g0b0", "stm32g0x0"]
stm32g031 = ["stm32g0/stm32g031", "stm32g0x1"]
stm32g041 = ["stm32g0/stm32g041", "stm32g0x1"]
stm32g051 = ["stm32g0/stm32g051", "stm32g0x1"]
stm32g061 = ["stm32g0/stm32g061", "stm32g0x1"]
stm32g071 = ["stm32g0/stm32g071", "stm32g0x1"]
stm32g081 = ["stm32g0/stm32g081", "stm32g0x1"]
stm32g0b1 = ["stm32g0/stm32g0b1", "stm32g0x1"]
stm32g0c1 = ["stm32g0/stm32g0c1", "stm32g0x1"]

stm32g0x0 = []
stm32g0x1 = []
Expand Down
36 changes: 30 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
#![allow(non_camel_case_types)]

#[cfg(not(any(
feature = "stm32g070",
feature = "stm32g071",
feature = "stm32g030",
feature = "stm32g050",
feature = "stm32g070",
feature = "stm32g0b0",
feature = "stm32g031",
feature = "stm32g041",
feature = "stm32g081"
feature = "stm32g051",
feature = "stm32g061",
feature = "stm32g071",
feature = "stm32g081",
feature = "stm32g0b1",
feature = "stm32g0c1",
)))]
compile_error!(
"This crate requires one of the following features enabled: stm32g030, stm32g070, stm32g031, stm32g041, stm32g071, stm32g081"
"This crate requires one of the following features enabled: stm32g030, stm32g050, stm32g070, stm32g0b0, stm32g031, stm32g041, stm32g051, stm32g061, stm32g071, stm32g081, stm32g0b1, stm32g0c1"
);

extern crate bare_metal;
Expand All @@ -26,20 +32,38 @@ pub use nb::block;
#[cfg(feature = "stm32g030")]
pub use stm32g0::stm32g030 as stm32;

#[cfg(feature = "stm32g050")]
pub use stm32g0::stm32g050 as stm32;

#[cfg(feature = "stm32g070")]
pub use stm32g0::stm32g070 as stm32;

#[cfg(feature = "stm32g0b0")]
pub use stm32g0::stm32g0b0 as stm32;

#[cfg(feature = "stm32g031")]
pub use stm32g0::stm32g031 as stm32;

#[cfg(feature = "stm32g041")]
pub use stm32g0::stm32g041 as stm32;

#[cfg(feature = "stm32g051")]
pub use stm32g0::stm32g051 as stm32;

#[cfg(feature = "stm32g061")]
pub use stm32g0::stm32g061 as stm32;

#[cfg(feature = "stm32g071")]
pub use stm32g0::stm32g071 as stm32;

#[cfg(feature = "stm32g081")]
pub use stm32g0::stm32g081 as stm32;

#[cfg(feature = "stm32g070")]
pub use stm32g0::stm32g070 as stm32;
#[cfg(feature = "stm32g0b1")]
pub use stm32g0::stm32g0b1 as stm32;

#[cfg(feature = "stm32g0c1")]
pub use stm32g0::stm32g0c1 as stm32;

#[cfg(feature = "rt")]
pub use crate::stm32::interrupt;
Expand Down

0 comments on commit 33fcaeb

Please sign in to comment.