Skip to content

Commit

Permalink
Merge pull request #508 from tlevora/smoltcp-0.12.0-upgrade
Browse files Browse the repository at this point in the history
Upgrade smoltcp to 0.12.0
  • Loading branch information
richardeoin authored Dec 4, 2024
2 parents 5166da8 + 5aa5f3b commit 2857ddc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix: # All permutations of {rust, mcu}
rust:
- 1.66.1 # MSRV
- 1.80.0 # MSRV
- stable
mcu:
- stm32h743
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.74.0
toolchain: 1.80.0
target: thumbv7em-none-eabihf
components: clippy
- uses: clechasseur/rs-clippy-check@v3
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased]

* MSRV increased to Rust 1.80.0
* **Breaking** Update `smoltcp` to `0.12.0` (from `0.11.0`)

## [v0.16.0] 2024-03-12

* MSRV increased to Rust 1.66.1 [#473]
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = ["Andrew Straw <[email protected]>",
"Florian Jung <[email protected]>",
"Matt Ickstadt <[email protected]>"]
edition = "2021"
rust-version = "1.66.1"
rust-version = "1.80.0"
categories = ["embedded", "hardware-support", "no-std"]
description = "Hardware Abstraction Layer implementation for STM32H7 series microcontrollers"
keywords = ["arm", "cortex-m", "stm32h7xx", "hal", "embedded-hal"]
Expand Down Expand Up @@ -48,7 +48,7 @@ fdcan = { version = "0.2", optional = true }
embedded-storage = "0.3"

[dependencies.smoltcp]
version = "0.11.0"
version = "0.12.0"
default-features = false
features = ["medium-ethernet", "proto-ipv4", "socket-raw"]
optional = true
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ stm32h7xx-hal
[![docs.rs](https://docs.rs/stm32h7xx-hal/badge.svg)](https://docs.rs/stm32h7xx-hal)
[![CI](https://github.com/stm32-rs/stm32h7xx-hal/workflows/Continuous%20integration/badge.svg)](https://github.com/stm32-rs/stm32h7xx-hal/actions)
[![Crates.io](https://img.shields.io/crates/v/stm32h7xx-hal.svg)](https://crates.io/crates/stm32h7xx-hal)
![Minimum rustc version](https://img.shields.io/badge/rustc-1.66.1+-yellow.svg)
0[Minimum rustc version](https://img.shields.io/badge/rustc-1.80.0+-yellow.svg)

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

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

Expand Down
11 changes: 5 additions & 6 deletions src/ethernet/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,16 +332,15 @@ impl<const RD: usize> RDesRing<RD> {
///
/// Ensure that release() is called between subsequent calls to this
/// function.
#[allow(clippy::mut_from_ref)]
pub unsafe fn buf_as_slice_mut(&self) -> &mut [u8] {
pub unsafe fn buf_as_slice(&self) -> &[u8] {
let x = self.rdidx;

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

let len = core::cmp::min(len, ETH_BUF_SIZE);
core::slice::from_raw_parts_mut(addr, len)
core::slice::from_raw_parts(addr, len)
}
}

Expand Down Expand Up @@ -816,9 +815,9 @@ pub struct RxToken<'a, const RD: usize>(&'a mut RDesRing<RD>);
impl<'a, const RD: usize> phy::RxToken for RxToken<'a, RD> {
fn consume<R, F>(self, f: F) -> R
where
F: FnOnce(&mut [u8]) -> R,
F: FnOnce(&[u8]) -> R,
{
let result = f(unsafe { self.0.buf_as_slice_mut() });
let result = f(unsafe { self.0.buf_as_slice() });
self.0.release();
result
}
Expand Down

0 comments on commit 2857ddc

Please sign in to comment.