From 6d0d269110cc00c88c806d538ec7f6c70fffe445 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Mon, 12 Dec 2022 20:38:24 +0300 Subject: [PATCH] update ci, clippy & release 0.10 --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/clippy.yml | 13 ++++++------- .github/workflows/rustfmt.yml | 11 ++++------- CHANGELOG.md | 5 ++++- Cargo.toml | 4 ++-- src/bb.rs | 2 +- src/i2c.rs | 2 +- src/rcc.rs | 7 ++----- 8 files changed, 27 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 207df6cd..7c930ba2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,17 +24,17 @@ jobs: experimental: true steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - target: thumbv7m-none-eabi - override: true + - uses: actions/checkout@v3 + - name: Use the latest ${{ matrix.rust }} rustc + run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} + - name: Add Cortex-M3 target + run: rustup target add thumbv7m-none-eabi + - uses: actions-rs/cargo@v1 with: command: check args: --features=${{ matrix.mcu }},rt --examples + - uses: actions-rs/cargo@v1 with: command: test diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 091ee5f8..628f1166 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -5,13 +5,12 @@ jobs: clippy_check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - run: rustup component add clippy - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: thumbv7m-none-eabi - override: true + - uses: actions/checkout@v3 + - name: Use the latest stable rustc + run: rustup update stable && rustup default stable + - name: Add Cortex-M3 target + run: rustup target add thumbv7m-none-eabi + - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml index 12157253..06d134ce 100644 --- a/.github/workflows/rustfmt.yml +++ b/.github/workflows/rustfmt.yml @@ -7,13 +7,10 @@ jobs: name: Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add rustfmt + - uses: actions/checkout@v3 + - 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 800a2cbd..780daf58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [v0.10.0] - 2022-12-12 + - `Timer`: adds `get_interrupt` to `Timer` - `gpio`: port and pin generics first, then mode, `PinMode` for modes instead of pins, `HL` trait, other cleanups @@ -332,7 +334,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - First tagged version -[Unreleased]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.9.0...HEAD +[Unreleased]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.10.0...HEAD +[v0.10.0]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.9.0...v0.10.0 [v0.9.0]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.8.0...v0.9.0 [v0.8.0]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.7.0...v0.8.0 [v0.7.0]: https://github.com/stm32-rs/stm32f1xx-hal/compare/v0.6.1...v0.7.0 diff --git a/Cargo.toml b/Cargo.toml index 7fffb8ff..99e77875 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,10 +11,10 @@ name = "stm32f1xx-hal" repository = "https://github.com/stm32-rs/stm32f1xx-hal" documentation = "https://docs.rs/stm32f1xx-hal" readme = "README.md" -version = "0.9.0" +version = "0.10.0" [package.metadata.docs.rs] -features = ["stm32f103", "rt"] +features = ["stm32f103", "rtic", "high"] default-target = "x86_64-unknown-linux-gnu" [dependencies] 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 c160292c..cea6f079 100644 --- a/src/i2c.rs +++ b/src/i2c.rs @@ -243,7 +243,7 @@ where fn send_addr(&self, addr: u8, read: bool) { self.i2c .dr - .write(|w| w.dr().bits(addr << 1 | (if read { 1 } else { 0 }))); + .write(|w| w.dr().bits(addr << 1 | (u8::from(read)))); } /// Generate STOP condition diff --git a/src/rcc.rs b/src/rcc.rs index c23cdfb7..508270b7 100644 --- a/src/rcc.rs +++ b/src/rcc.rs @@ -266,12 +266,9 @@ impl CFGR { .bits(if cfg.pllmul.is_some() { // PLL 0b10 - } else if cfg.hse.is_some() { - // HSE - 0b1 } else { - // HSI - 0b0 + // HSE or HSI + u8::from(cfg.hse.is_some()) }) });