Skip to content

Commit 28a56a6

Browse files
authored
Merge branch 'master' into master
2 parents c204490 + 8b3a356 commit 28a56a6

10 files changed

+28
-20
lines changed

CHANGELOG.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10-
### Added
11-
- `restore` for `ErasedPin` and `PartiallyErasedPin`
12-
1310
### Changed
11+
12+
- Bump `synopsys-usb-otg` to 0.3.2 (bug fix)
1413
- Update readme, clippy fixes
14+
15+
### Added
16+
1517
- `OutPortX` (X = 2..8) and `OutPortArray` structures which can handle several pins at once [#426]
18+
- `restore` for `ErasedPin` and `PartiallyErasedPin`
1619

1720
### Fixed
18-
- Fix alternate function pin definitions for FMPI2C1 [#572]
1921

22+
- Fix alternate function pin definitions for FMPI2C1 [#572]
2023

2124
[#426]: https://github.com/stm32-rs/stm32f4xx-hal/pull/426
2225
[#572]: https://github.com/stm32-rs/stm32f4xx-hal/pull/572
2326

27+
2428
## [v0.14.0] - 2022-12-12
2529

2630
### Changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cortex-m-rt = "0.7.1"
3434
nb = "1"
3535
rand_core = "0.6.3"
3636
stm32f4 = "0.15.1"
37-
synopsys-usb-otg = { version = "0.3.1", features = ["cortex-m"], optional = true }
37+
synopsys-usb-otg = { version = "0.3.2", features = ["cortex-m"], optional = true }
3838
sdio-host = { version = "0.6.0", optional = true }
3939
embedded-dma = "0.2.0"
4040
bare-metal = { version = "1" }
@@ -74,7 +74,7 @@ usb-device = "0.2.9"
7474
usbd-serial = "0.1.1"
7575
micromath = "2"
7676
cortex-m-rtic = "1.1.3"
77-
dwt-systick-monotonic = "1.0"
77+
dwt-systick-monotonic = "1.1"
7878
st7789 = "0.7.0"
7979
panic-rtt-target = { version = "0.1.2", features = ["cortex-m"] }
8080
rtt-target = { version = "0.3.1", features = ["cortex-m"] }

examples/analog-stopwatch-with-spi-ssd1306.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ fn format_elapsed(buf: &mut String<10>, elapsed: u32) {
323323
let minutes = elapsed_to_m(elapsed);
324324
let seconds = elapsed_to_s(elapsed);
325325
let millis = elapsed_to_ms(elapsed);
326-
write!(buf, "{}:{:02}.{:03}", minutes, seconds, millis).unwrap();
326+
write!(buf, "{minutes}:{seconds:02}.{millis:03}").unwrap();
327327
}
328328

329329
fn elapsed_to_ms(elapsed: u32) -> u32 {

examples/rng-display.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use ssd1306::{prelude::*, I2CDisplayInterface, Ssd1306};
3535
use hal::{i2c::I2c, pac, prelude::*};
3636
use rand_core::RngCore;
3737

38-
use core::fmt;
38+
use core::fmt::Write;
3939
use heapless::String;
4040

4141
// dimensions of SSD1306 OLED display known to work
@@ -93,7 +93,7 @@ fn main() -> ! {
9393
let rand_val = rand_source.next_u32();
9494

9595
format_buf.clear();
96-
if fmt::write(&mut format_buf, format_args!("{}", rand_val)).is_ok() {
96+
if write!(&mut format_buf, "{rand_val}").is_ok() {
9797
let text_style = MonoTextStyleBuilder::new()
9898
.font(&FONT_5X8)
9999
.text_color(BinaryColor::On)

examples/serial.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn main() -> ! {
3434

3535
loop {
3636
// print some value every 500 ms, value will overflow after 255
37-
writeln!(tx, "value: {:02}\r", value).unwrap();
37+
writeln!(tx, "value: {value:02}\r").unwrap();
3838
value = value.wrapping_add(1);
3939
delay.delay(2.secs());
4040
}

examples/stopwatch-with-ssd1306-and-interrupts-and-dma-i2c.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//!
1515
//! Video of this example running: https://imgur.com/a/lQTQFLy
1616
17-
#![allow(clippy::empty_loop)]
17+
#![allow(clippy::empty_loop, clippy::new_without_default)]
1818
#![no_std]
1919
#![no_main]
2020

@@ -100,7 +100,9 @@ impl DMAI2cInterface {
100100

101101
impl WriteOnlyDataCommand for DMAI2cInterface {
102102
fn send_commands(&mut self, cmd: DataFormat<'_>) -> Result<(), DisplayError> {
103-
while COMMAND_SEND.load(Ordering::SeqCst) {}
103+
while COMMAND_SEND.load(Ordering::SeqCst) {
104+
core::hint::spin_loop()
105+
}
104106

105107
match cmd {
106108
DataFormat::U8(slice) => {
@@ -129,7 +131,9 @@ impl WriteOnlyDataCommand for DMAI2cInterface {
129131
}
130132

131133
fn send_data(&mut self, buf: DataFormat<'_>) -> Result<(), DisplayError> {
132-
while DRAWING.load(Ordering::SeqCst) {}
134+
while DRAWING.load(Ordering::SeqCst) {
135+
core::hint::spin_loop()
136+
}
133137

134138
match buf {
135139
DataFormat::U8(slice) => {
@@ -352,7 +356,7 @@ fn format_elapsed(buf: &mut String<10>, elapsed: u32) {
352356
let minutes = elapsed_to_m(elapsed);
353357
let seconds = elapsed_to_s(elapsed);
354358
let millis = elapsed_to_ms(elapsed);
355-
write!(buf, "{}:{:02}.{:03}", minutes, seconds, millis).unwrap();
359+
write!(buf, "{minutes}:{seconds:02}.{millis:03}").unwrap();
356360
}
357361

358362
fn elapsed_to_ms(elapsed: u32) -> u32 {

examples/stopwatch-with-ssd1306-and-interrupts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ fn format_elapsed(buf: &mut String<10>, elapsed: u32) {
217217
let minutes = elapsed_to_m(elapsed);
218218
let seconds = elapsed_to_s(elapsed);
219219
let millis = elapsed_to_ms(elapsed);
220-
write!(buf, "{}:{:02}.{:03}", minutes, seconds, millis).unwrap();
220+
write!(buf, "{minutes}:{seconds:02}.{millis:03}").unwrap();
221221
}
222222

223223
fn elapsed_to_ms(elapsed: u32) -> u32 {

src/i2c.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,10 @@ impl<I2C: Instance, PINS> I2c<I2C, PINS> {
575575
Ok(())
576576
}
577577

578-
pub fn transaction_slice<'a>(
578+
pub fn transaction_slice(
579579
&mut self,
580580
addr: u8,
581-
ops_slice: &mut [Operation<'a>],
581+
ops_slice: &mut [Operation<'_>],
582582
) -> Result<(), Error> {
583583
let mut ops = ops_slice.iter_mut();
584584

src/i2c/hal_1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ mod blocking {
5757
self.write_iter_read(addr, bytes, buffer)
5858
}
5959

60-
fn transaction<'a>(
60+
fn transaction(
6161
&mut self,
6262
addr: u8,
63-
operations: &mut [Operation<'a>],
63+
operations: &mut [Operation<'_>],
6464
) -> Result<(), Self::Error> {
6565
self.transaction_slice(addr, operations)
6666
}

src/spi/hal_02.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ mod blocking {
161161
{
162162
type Error = Error;
163163

164-
fn exec<'a>(&mut self, operations: &mut [Operation<'a, W>]) -> Result<(), Error> {
164+
fn exec(&mut self, operations: &mut [Operation<'_, W>]) -> Result<(), Error> {
165165
for op in operations {
166166
match op {
167167
Operation::Write(w) => self.write(w)?,

0 commit comments

Comments
 (0)