Skip to content

Commit df69b65

Browse files
committed
upd deps & release 0.23
1 parent a5b7cab commit df69b65

File tree

6 files changed

+69
-44
lines changed

6 files changed

+69
-44
lines changed

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [v0.23.0] - 2025-09-22
11+
1012
- Implement `embedded_hal::i2c::I2c` for `I2cMasterDma` [#838]
1113
- Back to `stm32f4`
1214
- Implement `Ptr`, `Sealed`, `Steal` for generic `Periph` [#834]
@@ -1116,7 +1118,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
11161118

11171119
- Support for stm32f407 and stm32f429.
11181120

1119-
[Unreleased]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.22.1...HEAD
1121+
[Unreleased]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.23.0...HEAD
1122+
[v0.23.0]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.22.1...v0.23.0
11201123
[v0.22.1]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.22.0...v0.22.1
11211124
[v0.22.0]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.21.0...v0.22.0
11221125
[v0.21.0]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.20.0...v0.21.0

Cargo.toml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license = "0BSD"
1111
name = "stm32f4xx-hal"
1212
readme = "README.md"
1313
repository = "https://github.com/stm32-rs/stm32f4xx-hal"
14-
version = "0.22.1"
14+
version = "0.23.0"
1515

1616
[package.metadata.docs.rs]
1717
features = [
@@ -27,12 +27,13 @@ features = [
2727
targets = ["thumbv7em-none-eabihf"]
2828

2929
[dependencies]
30-
defmt = { version = "0.3.10", optional = true }
30+
defmt = { version = "1.0.1", optional = true }
3131
bxcan = { version = "0.8", optional = true }
3232
cortex-m = { version = "0.7.7", features = ["critical-section-single-core"] }
3333
cortex-m-rt = "0.7.5"
3434
nb = "1.1"
35-
rand_core = "0.6.4"
35+
rand_core_06 = { package = "rand_core", version = "0.6.4" }
36+
rand_core = "0.9.3"
3637
synopsys-usb-otg = { version = "0.4.0", features = [
3738
"cortex-m",
3839
], optional = true }
@@ -52,14 +53,14 @@ cortex-m-rtic = { version = "1.1.4", features = [
5253
"test-critical-section",
5354
], optional = true }
5455
# rtic2
55-
rtic-time = { version = "2.0", optional = true }
56+
rtic-time = { version = "2.0.1", optional = true }
5657
embedded-hal-async = { version = "1.0", optional = true }
57-
rtic = { version = "2.1.2", features = ["thumbv7-backend"], optional = true }
58+
rtic = { version = "2.2", features = ["thumbv7-backend"], optional = true }
5859
atomic-polyfill = { version = "1.0.3", optional = true }
5960

6061
stm32-fmc = { version = "0.4.0", optional = true }
6162

62-
enumflags2 = "0.7.11"
63+
enumflags2 = "0.7.12"
6364
embedded-storage = "0.3"
6465
document-features = "0.2"
6566

@@ -70,7 +71,7 @@ version = "0.16.0"
7071
features = ["atomics"]
7172

7273
[dependencies.time]
73-
version = "0.3.37"
74+
version = "0.3.44"
7475
default-features = false
7576

7677
[dependencies.embedded-hal-02]
@@ -92,27 +93,27 @@ version = "0.5.0"
9293
optional = true
9394

9495
[dev-dependencies]
95-
defmt = "0.3.4"
96-
defmt-rtt = "0.4.0"
97-
panic-probe = { version = "0.3.2", features = ["print-defmt"] }
96+
defmt = "1.0.1"
97+
defmt-rtt = "1.0"
98+
panic-probe = { version = "1.0", features = ["print-defmt"] }
9899
panic-semihosting = "0.6.0"
99100
cortex-m-semihosting = "0.5.0"
100-
heapless = "0.8"
101+
heapless = "0.9.1"
101102
panic-halt = "1.0.0"
102-
ssd1306 = "0.9.0"
103+
ssd1306 = "0.10.0"
103104
embedded-graphics = "0.8.1"
104105
embedded-graphics-07 = { package = "embedded-graphics", version = "0.7.1" }
105106
embedded-hal-bus = "0.3.0"
106107
usb-device = "0.3.1"
107108
usbd-serial = "0.2.0"
108-
micromath = "2"
109+
micromath = "2.1"
109110
dwt-systick-monotonic = "1.1"
110111
st7789 = "0.7.0"
111112
rtt-target = { version = "0.6.1" }
112113
display-interface-spi-04 = { package = "display-interface-spi", version = "0.4.1" }
113114
ist7920 = "0.1.1"
114-
smart-leds = "0.3.0"
115-
ws2812-spi = { version = "0.4.0", features = [] }
115+
smart-leds = "0.4.0"
116+
ws2812-spi = { version = "0.5.1", features = [] }
116117
hd44780-driver = "0.4.0"
117118
display-interface = "0.5"
118119
display-interface-04 = { package = "display-interface", version = "0.4.1" }

examples/rtic-dual-i2s-audio-in-out.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ mod app {
121121
#[local]
122122
struct Local {
123123
logs_chan: rtt_target::UpChannel,
124-
adc_p: Producer<'static, (i32, i32), 2>,
125-
process_c: Consumer<'static, (i32, i32), 2>,
126-
process_p: Producer<'static, (i32, i32), 2>,
127-
dac_c: Consumer<'static, (i32, i32), 2>,
124+
adc_p: Producer<'static, (i32, i32)>,
125+
process_c: Consumer<'static, (i32, i32)>,
126+
process_p: Producer<'static, (i32, i32)>,
127+
dac_c: Consumer<'static, (i32, i32)>,
128128
}
129129

130130
#[init(local = [queue_1: Queue<(i32,i32), 2> = Queue::new(),queue_2: Queue<(i32,i32), 2> = Queue::new()])]

examples/rtic-i2s-audio-in-out.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ mod app {
124124
#[local]
125125
struct Local {
126126
logs_chan: rtt_target::UpChannel,
127-
adc_p: Producer<'static, (i32, i32), 2>,
128-
process_c: Consumer<'static, (i32, i32), 2>,
129-
process_p: Producer<'static, (i32, i32), 2>,
130-
dac_c: Consumer<'static, (i32, i32), 2>,
127+
adc_p: Producer<'static, (i32, i32)>,
128+
process_c: Consumer<'static, (i32, i32)>,
129+
process_p: Producer<'static, (i32, i32)>,
130+
dac_c: Consumer<'static, (i32, i32)>,
131131
}
132132

133133
#[init(local = [queue_1: Queue<(i32,i32), 2> = Queue::new(),queue_2: Queue<(i32,i32), 2> = Queue::new()])]

examples/ws2812-spi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use hal::{
1010
pac::{self, SPI1},
1111
prelude::*,
1212
};
13-
use smart_leds::{brightness, hsv::RGB8, SmartLedsWrite};
13+
use smart_leds::{brightness, RGB8, SmartLedsWrite};
1414
use ws2812_spi as ws2812;
1515

1616
#[entry]

src/rng.rs

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use core::num::NonZeroU32;
2929
use core::ops::Shl;
3030
use embedded_hal_02::blocking::rng;
3131
use fugit::RateExtU32;
32-
use rand_core::RngCore;
3332

3433
/// Random number generator specific errors
3534
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
@@ -43,10 +42,10 @@ pub enum ErrorKind {
4342
SeedError = 4,
4443
}
4544

46-
impl From<ErrorKind> for rand_core::Error {
47-
fn from(err: ErrorKind) -> rand_core::Error {
48-
let err_code = NonZeroU32::new(rand_core::Error::CUSTOM_START + err as u32).unwrap();
49-
rand_core::Error::from(err_code)
45+
impl From<ErrorKind> for rand_core_06::Error {
46+
fn from(err: ErrorKind) -> rand_core_06::Error {
47+
let err_code = NonZeroU32::new(rand_core_06::Error::CUSTOM_START + err as u32).unwrap();
48+
rand_core_06::Error::from(err_code)
5049
}
5150
}
5251

@@ -135,6 +134,19 @@ impl Rng {
135134
}
136135
}
137136

137+
fn try_fill_bytes(&mut self, buffer: &mut [u8]) -> Result<(), ErrorKind> {
138+
const BATCH_SIZE: usize = 4 / mem::size_of::<u8>();
139+
let mut i = 0_usize;
140+
while i < buffer.len() {
141+
let random_word = self.next_random_word()?;
142+
let bytes = random_word.to_ne_bytes();
143+
let n = cmp::min(BATCH_SIZE, buffer.len() - i);
144+
buffer[i..i + n].copy_from_slice(&bytes[..n]);
145+
i += n;
146+
}
147+
Ok(())
148+
}
149+
138150
/// Releases ownership of the [`RNG`] peripheral object
139151
/// (after which `self` can't be used anymore).
140152
pub fn release(self) -> RNG {
@@ -143,14 +155,31 @@ impl Rng {
143155
}
144156

145157
impl rng::Read for Rng {
146-
type Error = rand_core::Error;
158+
type Error = rand_core_06::Error;
147159

148160
fn read(&mut self, buffer: &mut [u8]) -> Result<(), Self::Error> {
149-
self.try_fill_bytes(buffer)
161+
self.try_fill_bytes(buffer)?;
162+
Ok(())
163+
}
164+
}
165+
166+
impl rand_core::RngCore for Rng {
167+
fn next_u32(&mut self) -> u32 {
168+
self.next_random_word().unwrap()
169+
}
170+
171+
fn next_u64(&mut self) -> u64 {
172+
let w1 = self.next_u32();
173+
let w2 = self.next_u32();
174+
(w1 as u64).shl(32) | (w2 as u64)
175+
}
176+
177+
fn fill_bytes(&mut self, dest: &mut [u8]) {
178+
self.try_fill_bytes(dest).unwrap()
150179
}
151180
}
152181

153-
impl RngCore for Rng {
182+
impl rand_core_06::RngCore for Rng {
154183
fn next_u32(&mut self) -> u32 {
155184
self.next_random_word().unwrap()
156185
}
@@ -166,16 +195,8 @@ impl RngCore for Rng {
166195
}
167196

168197
/// Fills buffer with random values, or returns an error
169-
fn try_fill_bytes(&mut self, buffer: &mut [u8]) -> Result<(), rand_core::Error> {
170-
const BATCH_SIZE: usize = 4 / mem::size_of::<u8>();
171-
let mut i = 0_usize;
172-
while i < buffer.len() {
173-
let random_word = self.next_random_word()?;
174-
let bytes = random_word.to_ne_bytes();
175-
let n = cmp::min(BATCH_SIZE, buffer.len() - i);
176-
buffer[i..i + n].copy_from_slice(&bytes[..n]);
177-
i += n;
178-
}
198+
fn try_fill_bytes(&mut self, buffer: &mut [u8]) -> Result<(), rand_core_06::Error> {
199+
self.try_fill_bytes(buffer)?;
179200
Ok(())
180201
}
181-
}
202+
}

0 commit comments

Comments
 (0)