Skip to content

Commit

Permalink
Merge #236 #305
Browse files Browse the repository at this point in the history
236: Migrate to Rust 2021 as part of the public testing r=richardeoin a=hargoniX

Migration to Rust 2021 as part of the public testing.

We did actually catch one ICE bug with this \o/: rust-lang/rust#87426

305: remove release mode requirement from USB examples r=richardeoin a=newAM

This was fixed in usb-device: rust-embedded-community/usb-device#41

Co-authored-by: Henrik Böving <hargonix@gmail.com>
Co-authored-by: Richard Meadows <962920+richardeoin@users.noreply.github.com>
Co-authored-by: Alex Martens <alexmgit@protonmail.com>
  • Loading branch information
4 people committed Jan 3, 2022
3 parents 80f8676 + 2cf6553 + 522a76f commit dbb6625
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 21 deletions.
16 changes: 8 additions & 8 deletions .github/bors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ block_labels = ["wip"]
delete_merged_branches = true
status = [
"Rustfmt",
"ci (1.52.0, stm32h743)",
"ci (1.52.0, stm32h753)",
"ci (1.52.0, stm32h743v)",
"ci (1.52.0, stm32h753v)",
"ci (1.52.0, stm32h747cm7)",
"ci (1.52.0, stm32h7b3)",
"ci (1.52.0, stm32h7b0)",
"ci (1.52.0, stm32h735)",
"ci (1.56.1, stm32h743)",
"ci (1.56.1, stm32h753)",
"ci (1.56.1, stm32h743v)",
"ci (1.56.1, stm32h753v)",
"ci (1.56.1, stm32h747cm7)",
"ci (1.56.1, stm32h7b3)",
"ci (1.56.1, stm32h7b0)",
"ci (1.56.1, stm32h735)",
"ci (stable, stm32h743)",
"ci (stable, stm32h753)",
"ci (stable, stm32h743v)",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix: # All permutations of {rust, mcu}
rust:
- 1.52.0 # MSRV
- 1.56.1 # MSRV
- stable
mcu:
- stm32h743
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## [Unreleased]

* MSRV increased to 1.56.1

## [v0.11.0] 2021-12-18

* **Breaking**: Simplified API for reading device signature
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = ["Andrew Straw <strawman@astraw.com>",
"Matthew Meyer <mtthw.meyer@gmail.com>",
"Florian Jung <flo@windfisch.org>",
"Matt Ickstadt <mattico8@gmail.com>"]
edition = "2018"
edition = "2021"
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ stm32h7xx-hal
[![Bors enabled](https://bors.tech/images/badge_small.svg)](https://app.bors.tech/repositories/12691)
[![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.52.0+-yellow.svg)
![Minimum rustc version](https://img.shields.io/badge/rustc-1.56.1+-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 @@ -111,7 +111,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.52.0**. Older
The Minimum Supported Rust Version (MSRV) at the moment is **1.56.1**. Older
versions **may** compile, especially when some features are not used
in your application.

Expand Down
4 changes: 2 additions & 2 deletions examples/mdma_bursts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ fn main() -> ! {
let mut cycles = 0;
for _ in 0..10 {
cycles += {
let start = DWT::get_cycle_count();
let start = DWT::cycle_count();

// Start block
transfer.start(|_| {});

// Wait for transfer to complete
while !transfer.get_transfer_complete_flag() {}

DWT::get_cycle_count() - start
DWT::cycle_count() - start
};
}

Expand Down
4 changes: 2 additions & 2 deletions examples/sdmmc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ fn main() -> ! {
let mut buffer = [0u8; 5120];

cp.DWT.enable_cycle_counter();
let start = pac::DWT::get_cycle_count();
let start = pac::DWT::cycle_count();

for i in 0..10 {
// Read 10 blocks
sdmmc.read_blocks(10 * i, &mut buffer).unwrap();
}

let end = pac::DWT::get_cycle_count();
let end = pac::DWT::cycle_count();
let duration = (end - start) as f32 / ccdr.clocks.c_ck().0 as f32;

info!("Read 100 blocks at {} bytes/s", 5120. / duration);
Expand Down
2 changes: 0 additions & 2 deletions examples/usb_passthrough.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//! Dual CDC-ACM serial port example using polling in a busy loop.
//!
//! Characters written to one serial port appear on both.
//!
//! Note: This example must be built in release mode to work reliably
#![no_std]
#![no_main]

Expand Down
2 changes: 0 additions & 2 deletions examples/usb_serial.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
//! CDC-ACM serial port example using polling in a busy loop
//!
//! Note: This example must be built in release mode to work reliably
#![no_std]
#![no_main]

Expand Down
2 changes: 1 addition & 1 deletion src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,6 @@ pub struct Instant {
impl Instant {
/// Ticks elapsed since the `Instant` was created
pub fn elapsed(&self) -> u32 {
DWT::get_cycle_count().wrapping_sub(self.now)
DWT::cycle_count().wrapping_sub(self.now)
}
}

0 comments on commit dbb6625

Please sign in to comment.