Skip to content

Commit 9e1f32a

Browse files
committed
Bump dependencies and ensure build success with minimal dependencies
1 parent dac205e commit 9e1f32a

File tree

11 files changed

+73
-58
lines changed

11 files changed

+73
-58
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,28 @@ jobs:
7070
command: check
7171
args: --features=stm32f303xc,stm32-usbd,rt,can,ld --lib --examples
7272

73+
check-min-deps:
74+
name: Check Minimal Dependency Versions
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v2
78+
- uses: actions-rs/toolchain@v1
79+
with:
80+
toolchain: stable
81+
target: thumbv7em-none-eabihf
82+
override: true
83+
profile: minimal
84+
- uses: actions-rs/toolchain@v1
85+
with:
86+
toolchain: nightly
87+
target: thumbv7em-none-eabihf
88+
profile: minimal
89+
- run: cargo +nightly update -Z minimal-versions
90+
- uses: actions-rs/cargo@v1
91+
with:
92+
command: check
93+
args: --features=stm32f303xc,stm32-usbd,rt,can,ld --lib --examples
94+
7395
check-tests:
7496
name: Check Tests
7597
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111

1212
- Make `Clocks` `ppre1()` and `ppre2()` methods public, to get the current
1313
Prescaler value. ([#210])
14+
- Support for more CAN bit rates and modes. ([#186])
1415
- Implement `into_xxx` methods for partially erased pins ([#189])
1516
- Enable better GPIO internal resistor configuration ([#189])
1617
- Support for GPIO output slew rate configuration ([#189])
@@ -19,7 +20,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1920

2021
### Changed
2122

22-
- Added support for more CAN bit rates and modes. ([#186])
2323
- The structure of `gpio.rs` is greatly changed. Generic `Pin` struct is used
2424
for every GPIO pin now ([#189])
2525

@@ -31,14 +31,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3131

3232
### Breaking Changes
3333

34-
- The MSVR was bumped to 1.51 ([#227])
34+
- The MSRV was bumped to 1.51 ([#227])
3535
- Replace custom time based units with types defined in the [embedded-time][]
3636
crate ([#192])
3737
- The `rcc` public API now expects time based units in `Megahertz`.
3838
If the supplied frequency cannot be converted to `Hertz` the code
3939
will `panic`. This will occur if the supplied `Megahertz` frequency
4040
cannot fit into `u32::MAX` when converting to `Hertz` ([#192])
41-
- You always required to select a sub-target for target chips ([#216])
4241

4342
```rust
4443
// The supplied frequencies must be in `MHz`.
@@ -51,12 +50,15 @@ let clocks = rcc
5150
.pclk2(12u32.MHz())
5251
```
5352

54-
- Bump dependencies: ([#211])
55-
- `stm32f3` dependency to 0.13
56-
- `nb` to 1
57-
- `cortex-m` to 0.7
58-
- `stm32-usbd` to 0.6
59-
- `defmt` to 0.2
53+
- You always required to select a sub-target for target chips ([#216])
54+
- Bump dependencies: ([#229])
55+
- `cortex-m` to 0.7.2
56+
- `cortex-m-rt` to 0.6.4
57+
- `defmt` to 0.2.2
58+
- `embedded-hal` to 0.2.5
59+
- `nb` to 1.0.0
60+
- `stm32f3` to 0.13.2
61+
- `stm32-usbd` to 0.6.0
6062
- `into_afx` methods are splitted into `into_afx_push_pull` and
6163
`into_afx_open_drain` ([#189])
6264
- GPIO output mode (`PushPull` or `OpenDrain`) is encoded into pin typestate
@@ -320,11 +322,11 @@ let clocks = rcc
320322
[defmt]: https://github.com/knurling-rs/defmt
321323
[filter]: https://defmt.ferrous-systems.com/filtering.html
322324

325+
[#229]: https://github.com/stm32-rs/stm32f3xx-hal/pull/229
323326
[#227]: https://github.com/stm32-rs/stm32f3xx-hal/pull/227
324327
[#220]: https://github.com/stm32-rs/stm32f3xx-hal/pull/220
325328
[#217]: https://github.com/stm32-rs/stm32f3xx-hal/pull/217
326329
[#216]: https://github.com/stm32-rs/stm32f3xx-hal/pull/216
327-
[#211]: https://github.com/stm32-rs/stm32f3xx-hal/pull/211
328330
[#210]: https://github.com/stm32-rs/stm32f3xx-hal/pull/210
329331
[#208]: https://github.com/stm32-rs/stm32f3xx-hal/pull/208
330332
[#203]: https://github.com/stm32-rs/stm32f3xx-hal/issues/203

Cargo.toml

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,39 @@ exclude = [
1818
"codegen",
1919
".markdownlint.yml"
2020
]
21+
resolver = "2"
2122

2223
[package.metadata.docs.rs]
2324
features = ["stm32f303xc", "rt", "stm32-usbd", "can"]
2425
targets = ["thumbv7em-none-eabihf"]
2526
rustc-args = ["--cfg", "docsrs"]
2627

2728
[dependencies]
28-
cfg-if = "1"
29-
cortex-m = "0.7"
30-
cortex-m-rt = "0.6"
31-
embedded-dma = "0.1"
32-
embedded-hal = "0.2"
33-
embedded-time = "0.10"
34-
nb = "1"
35-
paste = "1"
36-
rtcc = "0.2"
37-
stm32f3 = "0.13"
38-
39-
[dependencies.embedded-hal-can]
40-
version = "0.1.0"
41-
optional = true
42-
43-
[dependencies.stm32-usbd]
44-
version = "0.6"
45-
optional = true
46-
47-
[dependencies.void]
48-
version = "1"
49-
default-features = false
50-
51-
[dependencies.defmt]
52-
version = "0.2"
53-
optional = true
29+
cfg-if = "1.0.0"
30+
cortex-m = "0.7.2"
31+
cortex-m-rt = "0.6.14"
32+
defmt = { version = "0.2.2", optional = true }
33+
embedded-dma = "0.1.2"
34+
embedded-hal = "0.2.5"
35+
embedded-hal-can = { version = "0.1.0", optional = true }
36+
embedded-time = "0.12.0"
37+
nb = "1.0.0"
38+
paste = "1.0.5"
39+
rtcc = "0.2.1"
40+
stm32f3 = "0.13.2"
41+
stm32-usbd = { version = "0.6.0", optional = true }
42+
void = { version = "1.0.2", default-features = false }
5443

5544
[dev-dependencies]
56-
panic-semihosting = "0.5"
57-
usb-device = "0.2"
58-
usbd-serial = "0.1"
59-
cortex-m-semihosting = "0.3"
60-
panic-probe = "0.2"
61-
defmt-rtt = "0.2"
62-
defmt-test = "0.2"
45+
cortex-m = "0.7.2"
46+
cortex-m-rt = { version = "0.6.13", features = ["device"] }
47+
cortex-m-semihosting = "0.3.7"
48+
defmt-rtt = "0.2.0"
49+
defmt-test = "0.2.3"
50+
panic-probe = "0.2.0"
51+
panic-semihosting = "0.5.6"
52+
usbd-serial = "0.1.1"
53+
usb-device = "0.2.8"
6354

6455
[build-dependencies]
6556
cargo_metadata = "0.13.1"

examples/gpio_interrupts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use stm32f3xx_hal as hal;
88
use core::cell::RefCell;
99
use cortex_m::asm;
1010
use cortex_m::interrupt::Mutex;
11+
use cortex_m::peripheral::NVIC;
1112
use cortex_m_rt::entry;
1213
use hal::gpio::{gpioa, gpioe, Edge, Input, Output, PushPull};
1314
use hal::interrupt;
1415
use hal::pac;
15-
use hal::pac::NVIC;
1616
use hal::prelude::*;
1717

1818
type LedPin = gpioe::PE9<Output<PushPull>>;

src/i2c.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<I2C, SCL, SDA> I2c<I2C, (SCL, SDA)> {
116116
SCL: SclPin<I2C>,
117117
SDA: SdaPin<I2C>,
118118
{
119-
crate::assert!(*freq.integer() <= 1_000_000);
119+
crate::assert!(freq.integer() <= 1_000_000);
120120

121121
I2C::enable_clock(apb1);
122122

@@ -129,16 +129,16 @@ impl<I2C, SCL, SDA> I2c<I2C, (SCL, SDA)> {
129129
// t_SYNC1 + t_SYNC2 > 4 * t_I2CCLK
130130
// t_SCL ~= t_SYNC1 + t_SYNC2 + t_SCLL + t_SCLH
131131
let i2cclk = I2C::clock(&clocks).0;
132-
let ratio = i2cclk / *freq.integer() - 4;
133-
let (presc, scll, sclh, sdadel, scldel) = if *freq.integer() >= 100_000 {
132+
let ratio = i2cclk / freq.integer() - 4;
133+
let (presc, scll, sclh, sdadel, scldel) = if freq.integer() >= 100_000 {
134134
// fast-mode or fast-mode plus
135135
// here we pick SCLL + 1 = 2 * (SCLH + 1)
136136
let presc = ratio / 387;
137137

138138
let sclh = ((ratio / (presc + 1)) - 3) / 3;
139139
let scll = 2 * (sclh + 1) - 1;
140140

141-
let (sdadel, scldel) = if *freq.integer() > 400_000 {
141+
let (sdadel, scldel) = if freq.integer() > 400_000 {
142142
// fast-mode plus
143143
let sdadel = 0;
144144
let scldel = i2cclk / 4_000_000 / (presc + 1) - 1;

src/pwm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ macro_rules! pwm_timer_private {
285285
// It might make sense to move into the clocks as a crate-only property.
286286
// TODO: ppre1 is used in timer.rs (never ppre2), should this be dynamic?
287287
let clock_freq = clocks.$pclkz().0 * if clocks.ppre1() == 1 { 1 } else { 2 };
288-
let prescale_factor = clock_freq / res as u32 / *freq.integer();
288+
let prescale_factor = clock_freq / res as u32 / freq.integer();
289289
// NOTE(write): uses all bits of this register.
290290
tim.psc.write(|w| w.psc().bits(prescale_factor as u16 - 1));
291291

src/rcc.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl CFGR {
343343
/// Panics if conversion from `Megahertz` to `Hertz` produces a value greater then `u32::MAX`.
344344
pub fn use_hse(mut self, freq: Megahertz) -> Self {
345345
let freq: Hertz = crate::expect!(freq.try_into(), "ConversionError");
346-
self.hse = Some(*freq.integer());
346+
self.hse = Some(freq.integer());
347347
self
348348
}
349349

@@ -376,7 +376,7 @@ impl CFGR {
376376
/// Panics if conversion from `Megahertz` to `Hertz` produces a value greater then `u32::MAX`.
377377
pub fn hclk(mut self, freq: Megahertz) -> Self {
378378
let freq: Hertz = crate::expect!(freq.try_into(), "ConversionError");
379-
self.hclk = Some(*freq.integer());
379+
self.hclk = Some(freq.integer());
380380
self
381381
}
382382

@@ -392,7 +392,7 @@ impl CFGR {
392392
/// Panics if conversion from `Megahertz` to `Hertz` produces a value greater then `u32::MAX`.
393393
pub fn pclk1(mut self, freq: Megahertz) -> Self {
394394
let freq: Hertz = crate::expect!(freq.try_into(), "ConversionError");
395-
self.pclk1 = Some(*freq.integer());
395+
self.pclk1 = Some(freq.integer());
396396
self
397397
}
398398

@@ -414,7 +414,7 @@ impl CFGR {
414414
/// Panics if conversion from `Megahertz` to `Hertz` produces a value greater then `u32::MAX`.
415415
pub fn pclk2(mut self, freq: Megahertz) -> Self {
416416
let freq: Hertz = crate::expect!(freq.try_into(), "ConversionError");
417-
self.pclk2 = Some(*freq.integer());
417+
self.pclk2 = Some(freq.integer());
418418
self
419419
}
420420

@@ -439,7 +439,7 @@ impl CFGR {
439439
/// Panics if conversion from `Megahertz` to `Hertz` produces a value greater then `u32::MAX`.
440440
pub fn sysclk(mut self, freq: Megahertz) -> Self {
441441
let freq: Hertz = crate::expect!(freq.try_into(), "ConversionError");
442-
self.sysclk = Some(*freq.integer());
442+
self.sysclk = Some(freq.integer());
443443
self
444444
}
445445

src/serial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ macro_rules! hal {
128128
apb.rstr().modify(|_, w| w.$usartXrst().set_bit());
129129
apb.rstr().modify(|_, w| w.$usartXrst().clear_bit());
130130

131-
let brr = clocks.$pclkX().0 / *baud_rate.integer();
131+
let brr = clocks.$pclkX().0 / baud_rate.integer();
132132
crate::assert!(brr >= 16, "impossible baud rate");
133133
// NOTE(write): uses all bits of this register.
134134
usart.brr.write(|w| unsafe { w.bits(brr) });

src/spi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ macro_rules! hal {
503503

504504
fn compute_baud_rate(clocks: Hertz, freq: Hertz) -> spi1::cr1::BR_A {
505505
use spi1::cr1::BR_A;
506-
match clocks.0 / *freq.integer() {
506+
match clocks.0 / freq.integer() {
507507
0 => crate::unreachable!(),
508508
1..=2 => BR_A::DIV2,
509509
3..=5 => BR_A::DIV4,

src/timer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ macro_rules! hal {
9595
{
9696
self.stop();
9797

98-
let frequency = *timeout.into().integer();
98+
let frequency = timeout.into().integer();
9999
let timer_clock = $TIMX::get_clk(&self.clocks);
100100
let ticks = timer_clock.0 * if self.clocks.ppre1() == 1 { 1 } else { 2 }
101101
/ frequency;

0 commit comments

Comments
 (0)