Skip to content

Commit a4cfabf

Browse files
bors[bot]burrbull
andauthored
Merge #481
481: pac 0.15.1 r=therealprof a=burrbull Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
2 parents 6cd069b + 89d4ea0 commit a4cfabf

File tree

16 files changed

+229
-312
lines changed

16 files changed

+229
-312
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ jobs:
4646
override: true
4747

4848
- name: Cache Dependencies
49-
uses: Swatinem/rust-cache@v1
49+
uses: Swatinem/rust-cache@v2
5050
with:
51-
key: pac-v0.14-${{ matrix.mcu }}
51+
key: pac-v0.15.1-${{ matrix.mcu }}
5252

5353
- uses: actions-rs/cargo@v1
5454
with:

.github/workflows/clippy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
components: clippy
2020

2121
- name: Cache Dependencies
22-
uses: Swatinem/rust-cache@v1
22+
uses: Swatinem/rust-cache@v2
2323
with:
24-
key: pac-v0.14
24+
key: pac-v0.15.1
2525

2626
- uses: actions-rs/clippy-check@v1
2727
with:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1616
[#507]: https://github.com/stm32-rs/stm32f4xx-hal/pull/507
1717

1818
### Changed
19+
- update `stm32f4` to 0.15.1
1920
- use `stm32_i2s_v12x` version 0.3, reexport it, and implements requirement for it
2021
- i2s module don't reuse marker from spi module and define its own.
2122
- `i2s-audio-out` example updated and now use pcm5102 dac module instead one from discovery board.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ cortex-m = "0.7.4"
3333
cortex-m-rt = "0.7"
3434
nb = "1"
3535
rand_core = "0.6"
36-
stm32f4 = "0.14.0"
36+
stm32f4 = "0.15.1"
3737
synopsys-usb-otg = { version = "0.3.0", features = ["cortex-m"], optional = true }
3838
sdio-host = { version = "0.6.0", optional = true }
3939
embedded-dma = "0.2.0"

examples/blinky-timer-irq.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fn TIM2() {
5858
})
5959
});
6060

61-
let _ = led.toggle();
61+
led.toggle();
6262
let _ = tim.wait();
6363
}
6464

@@ -72,7 +72,7 @@ fn main() -> ! {
7272
// Configure PA5 pin to blink LED
7373
let gpioa = dp.GPIOA.split();
7474
let mut led = gpioa.pa5.into_push_pull_output();
75-
let _ = led.set_high(); // Turn off
75+
led.set_high(); // Turn off
7676

7777
// Move the pin into our global storage
7878
cortex_m::interrupt::free(|cs| *G_LED.borrow(cs).borrow_mut() = Some(led));

src/adc.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,10 +836,24 @@ macro_rules! adc {
836836
/// Sets which external trigger to use and if it is disabled, rising, falling or both
837837
pub fn set_external_trigger(&mut self, (edge, extsel): (config::TriggerMode, config::ExternalTrigger)) {
838838
self.config.external_trigger = (edge, extsel);
839+
#[cfg(any(
840+
feature = "stm32f401",
841+
feature = "stm32f410",
842+
feature = "stm32f411",
843+
))] // TODO: fix pac
839844
self.adc_reg.cr2.modify(|_, w| unsafe { w
840845
.extsel().bits(extsel.into())
841846
.exten().bits(edge.into())
842847
});
848+
#[cfg(not(any(
849+
feature = "stm32f401",
850+
feature = "stm32f410",
851+
feature = "stm32f411",
852+
)))]
853+
self.adc_reg.cr2.modify(|_, w| w
854+
.extsel().bits(extsel.into())
855+
.exten().bits(edge.into())
856+
);
843857
}
844858

845859
/// Enables and disables continuous mode

src/crc32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl Crc32 {
4747
pub fn update(&mut self, data: &[u32]) -> u32 {
4848
// Feed each word into the engine
4949
for word in data {
50-
self.periph.dr.write(|w| unsafe { w.bits(*word) });
50+
self.periph.dr.write(|w| w.bits(*word));
5151
}
5252
// Retrieve the resulting CRC
5353
self.periph.dr.read().bits()
@@ -112,7 +112,7 @@ impl Crc32 {
112112
scratch[..remainder.len()].copy_from_slice(remainder);
113113
self.periph
114114
.dr
115-
.write(|w| unsafe { w.bits(u32::from_ne_bytes(scratch)) });
115+
.write(|w| w.bits(u32::from_ne_bytes(scratch)));
116116
}
117117

118118
self.periph.dr.read().bits()

src/dma/traits.rs

Lines changed: 109 additions & 188 deletions
Large diffs are not rendered by default.

src/dwt.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ impl MonoTimer {
245245
dwt.enable_cycle_counter();
246246

247247
// now the CYCCNT counter can't be stopped or reset
248-
drop(dwt);
249248

250249
MonoTimer {
251250
frequency: clocks.hclk(),

src/qei.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ macro_rules! hal {
9999
.cc2p()
100100
.clear_bit()
101101
});
102-
#[cfg(not(feature = "stm32f410"))]
103102
self.smcr.write(|w| w.sms().encoder_mode_3());
104-
#[cfg(feature = "stm32f410")]
105-
self.smcr.write(|w| unsafe { w.sms().bits(3) });
106103
self.set_auto_reload(<$TIM as General>::Width::MAX as u32).unwrap();
107104
self.cr1.write(|w| w.cen().set_bit());
108105
}

0 commit comments

Comments
 (0)