Skip to content

Commit

Permalink
Merge pull request #55 from romancardenas/master
Browse files Browse the repository at this point in the history
Use portable-atomic
  • Loading branch information
almindor authored Oct 6, 2023
2 parents 3c9d75c + 902a414 commit 057d298
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
continue-on-error: ${{ matrix.experimental || false }}
strategy:
matrix:
# All generated code should be running on stable now, MRSV is 1.59.0
rust: [nightly, stable, 1.59.0]
# All generated code should be running on stable now, MRSV is 1.60.0
rust: [nightly, stable, 1.60.0]

include:
# Nightly is only for reference and allowed to fail
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- Use `atomic-polyfill` to allow builds on riscv32imc-unknown-none-elf targets when needed.
- Use `portable-atomic` to allow builds on `riscv32imc-unknown-none-elf`` targets when needed.

## [v0.10.0] - 2023-03-28

Expand Down
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ rust-version = "1.59"
[dependencies]
embedded-hal = { version = "0.2.6", features = ["unproven"] }
nb = "1.0.0"
atomic-polyfill = "1.0.2"
riscv = { version = "0.10.1", features = ["critical-section-single-hart"] }
e310x = { version = "0.11.0", features = ["rt", "critical-section"] }

[target.'cfg(not(target_has_atomic = "32"))'.dependencies]
portable-atomic = { version = "1.4", default-features = false, features = ["unsafe-assume-single-core"] }

[features]
g002 = ["e310x/g002"]
virq = []
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This project is developed and maintained by the [RISC-V team][team].

## Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.59.0 and up. It *might*
This crate is guaranteed to compile on stable Rust 1.60.0 and up. It *might*
compile with older versions but that may change in any new patch release.

## License
Expand Down
6 changes: 5 additions & 1 deletion src/gpio.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
//! General Purpose I/O

use atomic_polyfill::{AtomicU32, Ordering};
use core::marker::PhantomData;

#[cfg(target_has_atomic = "32")]
use core::sync::atomic::{AtomicU32, Ordering};
#[cfg(not(target_has_atomic = "32"))]
use portable_atomic::{AtomicU32, Ordering};

/// GpioExt trait extends the GPIO0 peripheral.
pub trait GpioExt {
/// The parts to split the GPIO into.
Expand Down

0 comments on commit 057d298

Please sign in to comment.