Skip to content

Commit 2857ddc

Browse files
authored
Merge pull request #508 from tlevora/smoltcp-0.12.0-upgrade
Upgrade smoltcp to 0.12.0
2 parents 5166da8 + 5aa5f3b commit 2857ddc

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
matrix: # All permutations of {rust, mcu}
2323
rust:
24-
- 1.66.1 # MSRV
24+
- 1.80.0 # MSRV
2525
- stable
2626
mcu:
2727
- stm32h743

.github/workflows/clippy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: dtolnay/rust-toolchain@master
1414
with:
15-
toolchain: 1.74.0
15+
toolchain: 1.80.0
1616
target: thumbv7em-none-eabihf
1717
components: clippy
1818
- uses: clechasseur/rs-clippy-check@v3

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## [Unreleased]
44

5+
* MSRV increased to Rust 1.80.0
6+
* **Breaking** Update `smoltcp` to `0.12.0` (from `0.11.0`)
7+
58
## [v0.16.0] 2024-03-12
69

710
* MSRV increased to Rust 1.66.1 [#473]

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors = ["Andrew Straw <strawman@astraw.com>",
1111
"Florian Jung <flo@windfisch.org>",
1212
"Matt Ickstadt <mattico8@gmail.com>"]
1313
edition = "2021"
14-
rust-version = "1.66.1"
14+
rust-version = "1.80.0"
1515
categories = ["embedded", "hardware-support", "no-std"]
1616
description = "Hardware Abstraction Layer implementation for STM32H7 series microcontrollers"
1717
keywords = ["arm", "cortex-m", "stm32h7xx", "hal", "embedded-hal"]
@@ -48,7 +48,7 @@ fdcan = { version = "0.2", optional = true }
4848
embedded-storage = "0.3"
4949

5050
[dependencies.smoltcp]
51-
version = "0.11.0"
51+
version = "0.12.0"
5252
default-features = false
5353
features = ["medium-ethernet", "proto-ipv4", "socket-raw"]
5454
optional = true

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ stm32h7xx-hal
66
[![docs.rs](https://docs.rs/stm32h7xx-hal/badge.svg)](https://docs.rs/stm32h7xx-hal)
77
[![CI](https://github.com/stm32-rs/stm32h7xx-hal/workflows/Continuous%20integration/badge.svg)](https://github.com/stm32-rs/stm32h7xx-hal/actions)
88
[![Crates.io](https://img.shields.io/crates/v/stm32h7xx-hal.svg)](https://crates.io/crates/stm32h7xx-hal)
9-
![Minimum rustc version](https://img.shields.io/badge/rustc-1.66.1+-yellow.svg)
9+
0[Minimum rustc version](https://img.shields.io/badge/rustc-1.80.0+-yellow.svg)
1010

1111
[_stm32h7xx-hal_](https://github.com/stm32-rs/stm32h7xx-hal) contains
1212
a hardware abstraction layer on top of the peripheral access API for
@@ -113,7 +113,7 @@ programming interfaces are only available on the high density connectors.
113113
Minimum supported Rust version
114114
------------------------------
115115

116-
The Minimum Supported Rust Version (MSRV) at the moment is **1.66.1**. Older
116+
The Minimum Supported Rust Version (MSRV) at the moment is **1.80.0**. Older
117117
versions **may** compile, especially when some features are not used in your
118118
application.
119119

src/ethernet/eth.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,16 +332,15 @@ impl<const RD: usize> RDesRing<RD> {
332332
///
333333
/// Ensure that release() is called between subsequent calls to this
334334
/// function.
335-
#[allow(clippy::mut_from_ref)]
336-
pub unsafe fn buf_as_slice_mut(&self) -> &mut [u8] {
335+
pub unsafe fn buf_as_slice(&self) -> &[u8] {
337336
let x = self.rdidx;
338337

339338
// Write-back format
340-
let addr = ptr::addr_of!(self.rbuf[x]) as *mut u8;
339+
let addr = ptr::addr_of!(self.rbuf[x]) as *const u8;
341340
let len = (self.rd[x].rdes3 & EMAC_RDES3_PL) as usize;
342341

343342
let len = core::cmp::min(len, ETH_BUF_SIZE);
344-
core::slice::from_raw_parts_mut(addr, len)
343+
core::slice::from_raw_parts(addr, len)
345344
}
346345
}
347346

@@ -816,9 +815,9 @@ pub struct RxToken<'a, const RD: usize>(&'a mut RDesRing<RD>);
816815
impl<'a, const RD: usize> phy::RxToken for RxToken<'a, RD> {
817816
fn consume<R, F>(self, f: F) -> R
818817
where
819-
F: FnOnce(&mut [u8]) -> R,
818+
F: FnOnce(&[u8]) -> R,
820819
{
821-
let result = f(unsafe { self.0.buf_as_slice_mut() });
820+
let result = f(unsafe { self.0.buf_as_slice() });
822821
self.0.release();
823822
result
824823
}

0 commit comments

Comments
 (0)