From 9533682f07a5cb7d7c53457da91df81d0fb5cf99 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Mon, 12 Dec 2022 20:12:47 +0300 Subject: [PATCH] update ci, clippy & release 0.14 --- .github/workflows/ci.yml | 13 +++++-------- .github/workflows/clippy.yml | 14 +++++--------- .github/workflows/rustfmt.yml | 9 +++------ CHANGELOG.md | 9 +++++++-- Cargo.toml | 6 +++--- src/bb.rs | 2 +- src/i2c.rs | 4 ++-- src/rtc.rs | 2 +- 8 files changed, 27 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2b8ce7f..e35ba276 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,18 +37,15 @@ jobs: steps: - uses: actions/checkout@v3 - - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - target: thumbv7em-none-eabihf - override: true + - name: Use the latest ${{ matrix.rust }} rustc + run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} + - name: Add Cortex-M4F target + run: rustup target add thumbv7em-none-eabihf - name: Cache Dependencies uses: Swatinem/rust-cache@v2 with: - key: pac-v0.15.1-${{ matrix.mcu }} + key: v0.14.0-${{ matrix.mcu }} - uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 5e3a2d88..044fb3fe 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -9,19 +9,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - target: thumbv7em-none-eabihf - override: true - components: clippy + - name: Use the latest stable rustc + run: rustup update stable && rustup default stable + - name: Add Cortex-M4F target + run: rustup target add thumbv7em-none-eabihf - name: Cache Dependencies uses: Swatinem/rust-cache@v2 with: - key: pac-v0.15.1 + key: v0.14.0 - uses: actions-rs/clippy-check@v1 with: diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index 5e5fd482..2036b85f 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -11,12 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt + - name: Use the latest stable rustc + run: rustup update stable && rustup default stable + - uses: actions-rs/cargo@v1 with: command: fmt diff --git a/CHANGELOG.md b/CHANGELOG.md index 88d945eb..2332987d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [v0.14.0] - 2022-12-12 + ### Changed - Add missing timer pins [#536] @@ -70,18 +72,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/). [#515]: https://github.com/stm32-rs/stm32f4xx-hal/pull/515 [#517]: https://github.com/stm32-rs/stm32f4xx-hal/pull/517 [#519]: https://github.com/stm32-rs/stm32f4xx-hal/pull/519 +[#527]: https://github.com/stm32-rs/stm32f4xx-hal/pull/527 [#529]: https://github.com/stm32-rs/stm32f4xx-hal/pull/529 [#536]: https://github.com/stm32-rs/stm32f4xx-hal/pull/536 [#534]: https://github.com/stm32-rs/stm32f4xx-hal/pull/529 +[#535]: https://github.com/stm32-rs/stm32f4xx-hal/pull/535 [#540]: https://github.com/stm32-rs/stm32f4xx-hal/pull/540 [#542]: https://github.com/stm32-rs/stm32f4xx-hal/pull/542 -[#527]: https://github.com/stm32-rs/stm32f4xx-hal/pull/527 [#551]: https://github.com/stm32-rs/stm32f4xx-hal/pull/551 [#552]: https://github.com/stm32-rs/stm32f4xx-hal/pull/552 [#553]: https://github.com/stm32-rs/stm32f4xx-hal/pull/553 [#554]: https://github.com/stm32-rs/stm32f4xx-hal/pull/554 [#555]: https://github.com/stm32-rs/stm32f4xx-hal/pull/555 [#556]: https://github.com/stm32-rs/stm32f4xx-hal/pull/556 +[#557]: https://github.com/stm32-rs/stm32f4xx-hal/pull/557 ## [v0.13.2] - 2022-05-16 @@ -743,7 +747,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Support for stm32f407 and stm32f429. -[Unreleased]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.13.2...HEAD +[Unreleased]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.14.0...HEAD +[v0.14.0]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.13.2...v0.14.0 [v0.13.2]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.13.1...v0.13.2 [v0.13.1]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.13.0...v0.13.1 [v0.13.0]: https://github.com/stm32-rs/stm32f4xx-hal/compare/v0.12.0...v0.13.0 diff --git a/Cargo.toml b/Cargo.toml index 5f5ac868..cde093e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,10 +20,10 @@ license = "0BSD" name = "stm32f4xx-hal" readme = "README.md" repository = "https://github.com/stm32-rs/stm32f4xx-hal" -version = "0.13.2" +version = "0.14.0" [package.metadata.docs.rs] -features = ["stm32f429", "usb_fs", "can", "i2s", "fsmc_lcd", "rtic"] +features = ["stm32f429", "usb_fs", "can", "i2s", "fsmc_lcd", "rtic", "defmt"] targets = ["thumbv7em-none-eabihf"] [dependencies] @@ -62,7 +62,7 @@ optional = true [dev-dependencies] defmt = "0.3.2" -defmt-rtt = "0.3.2" +defmt-rtt = "0.4.0" panic-probe = { version = "0.3.0", features = [ "print-defmt" ] } panic-semihosting = "0.6.0" cortex-m-semihosting = "0.5.0" diff --git a/src/bb.rs b/src/bb.rs index c62c5a5c..c6de2990 100644 --- a/src/bb.rs +++ b/src/bb.rs @@ -47,5 +47,5 @@ pub unsafe fn write(register: *const T, bit: u8, set: bool) { let bit = bit as usize; let bb_addr = (PERI_BIT_BAND_BASE + (addr - PERI_ADDRESS_START) * 32) + 4 * bit; - ptr::write_volatile(bb_addr as *mut u32, if set { 1 } else { 0 }); + ptr::write_volatile(bb_addr as *mut u32, u32::from(set)); } diff --git a/src/i2c.rs b/src/i2c.rs index 852f0464..1b8271cc 100644 --- a/src/i2c.rs +++ b/src/i2c.rs @@ -551,7 +551,7 @@ impl I2c { for op in ops { // 2. Execute previous operations. match &mut prev_op { - Operation::Read(rb) => self.read_bytes(*rb)?, + Operation::Read(rb) => self.read_bytes(rb)?, Operation::Write(wb) => self.write_bytes(wb.iter().cloned())?, }; // 3. If operation changes type we must generate new start @@ -592,7 +592,7 @@ impl I2c { for op in ops { // 2. Execute previous operations. match &mut prev_op { - Operation::Read(rb) => self.read_bytes(*rb)?, + Operation::Read(rb) => self.read_bytes(rb)?, Operation::Write(wb) => self.write_bytes(wb.iter().cloned())?, }; // 3. If operation changes type we must generate new start diff --git a/src/rtc.rs b/src/rtc.rs index 98e0a0d7..d6884733 100644 --- a/src/rtc.rs +++ b/src/rtc.rs @@ -505,7 +505,7 @@ fn decode_day(dr: &dr::R) -> u8 { #[inline(always)] fn decode_month(dr: &dr::R) -> u8 { - let mt: u8 = if dr.mt().bit() { 1 } else { 0 }; + let mt = u8::from(dr.mt().bit()); bcd2_decode(mt, dr.mu().bits()) as u8 }