Breaking change: portable-atomic (#922)

* Atomics: Replace polyfill with portable-atomic

* Update Cargo.lock for examples

* RTIC: portable-atomic: Update changelog

* rtic-monotonics: portable-atomic: Update changelog

* lm3s6965: enable critical-section when testing

* xtask: Enable portable-atomic/critical-section

When dealing with rtic-monotonics

* rtic-monotonics: portable-atomics: Do not disable the ability to fallback

---------

Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
This commit is contained in:
Henrik Tjäder 2024-06-23 08:45:49 +02:00 committed by GitHub
parent 9aeae030e7
commit 918f9c3f13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 82 additions and 145 deletions

View file

@ -17,15 +17,6 @@ version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
[[package]]
name = "atomic-polyfill"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.1.0" version = "1.1.0"
@ -611,10 +602,10 @@ dependencies = [
name = "rtic" name = "rtic"
version = "2.1.1" version = "2.1.1"
dependencies = [ dependencies = [
"atomic-polyfill",
"bare-metal", "bare-metal",
"critical-section", "critical-section",
"esp32c3 0.22.0", "esp32c3 0.22.0",
"portable-atomic",
"riscv", "riscv",
"rtic-core", "rtic-core",
"rtic-macros", "rtic-macros",

View file

@ -2,15 +2,6 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "atomic-polyfill"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "bare-metal" name = "bare-metal"
version = "1.0.0" version = "1.0.0"
@ -268,9 +259,9 @@ dependencies = [
name = "rtic" name = "rtic"
version = "2.1.1" version = "2.1.1"
dependencies = [ dependencies = [
"atomic-polyfill",
"bare-metal", "bare-metal",
"critical-section", "critical-section",
"portable-atomic",
"riscv", "riscv",
"riscv-slic", "riscv-slic",
"rtic-core", "rtic-core",

View file

@ -2,15 +2,6 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "atomic-polyfill"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "bare-metal" name = "bare-metal"
version = "0.2.5" version = "0.2.5"
@ -309,6 +300,9 @@ name = "portable-atomic"
version = "1.6.0" version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "proc-macro-error" name = "proc-macro-error"
@ -356,10 +350,10 @@ dependencies = [
name = "rtic" name = "rtic"
version = "2.1.1" version = "2.1.1"
dependencies = [ dependencies = [
"atomic-polyfill",
"bare-metal 1.0.0", "bare-metal 1.0.0",
"cortex-m", "cortex-m",
"critical-section", "critical-section",
"portable-atomic",
"rtic-core", "rtic-core",
"rtic-macros", "rtic-macros",
] ]
@ -393,10 +387,10 @@ dependencies = [
name = "rtic-monotonics" name = "rtic-monotonics"
version = "2.0.0" version = "2.0.0"
dependencies = [ dependencies = [
"atomic-polyfill",
"cfg-if", "cfg-if",
"cortex-m", "cortex-m",
"fugit", "fugit",
"portable-atomic",
"rtic-time", "rtic-time",
] ]

View file

@ -30,7 +30,10 @@ features = ["exit"]
version = "0.6.0" version = "0.6.0"
[features] [features]
test-critical-section = ["rtic/test-critical-section"] test-critical-section = [
"rtic/test-critical-section",
"cortex-m/critical-section-single-core",
]
thumbv6-backend = ["rtic/thumbv6-backend"] thumbv6-backend = ["rtic/thumbv6-backend"]
thumbv7-backend = ["rtic/thumbv7-backend"] thumbv7-backend = ["rtic/thumbv7-backend"]
thumbv8base-backend = ["rtic/thumbv8base-backend"] thumbv8base-backend = ["rtic/thumbv8base-backend"]

View file

@ -2,15 +2,6 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "atomic-polyfill"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "az" name = "az"
version = "1.2.1" version = "1.2.1"
@ -391,9 +382,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]] [[package]]
name = "portable-atomic" name = "portable-atomic"
version = "1.5.1" version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
[[package]] [[package]]
name = "proc-macro-error" name = "proc-macro-error"
@ -445,12 +436,12 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
[[package]] [[package]]
name = "rtic" name = "rtic"
version = "2.0.1" version = "2.1.1"
dependencies = [ dependencies = [
"atomic-polyfill",
"bare-metal 1.0.0", "bare-metal 1.0.0",
"cortex-m", "cortex-m",
"critical-section", "critical-section",
"portable-atomic",
"rtic-core", "rtic-core",
"rtic-macros", "rtic-macros",
] ]
@ -471,7 +462,7 @@ checksum = "d9369355b04d06a3780ec0f51ea2d225624db777acbc60abd8ca4832da5c1a42"
[[package]] [[package]]
name = "rtic-macros" name = "rtic-macros"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"proc-macro-error", "proc-macro-error",
@ -484,13 +475,12 @@ dependencies = [
name = "rtic-monotonics" name = "rtic-monotonics"
version = "2.0.0" version = "2.0.0"
dependencies = [ dependencies = [
"atomic-polyfill",
"cfg-if", "cfg-if",
"cortex-m", "cortex-m",
"critical-section", "critical-section",
"embedded-hal 1.0.0",
"fugit", "fugit",
"nrf52840-pac", "nrf52840-pac",
"portable-atomic",
"rtic-time", "rtic-time",
] ]

View file

@ -8,15 +8,6 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]]
name = "atomic-polyfill"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c314e70d181aa6053b26e3f7fbf86d1dfff84f816a6175b967666b3506ef7289"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "bare-metal" name = "bare-metal"
version = "0.2.5" version = "0.2.5"
@ -371,6 +362,9 @@ name = "portable-atomic"
version = "1.6.0" version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "proc-macro-error" name = "proc-macro-error"
@ -503,6 +497,7 @@ dependencies = [
"embedded-hal 0.2.7", "embedded-hal 0.2.7",
"fugit", "fugit",
"panic-probe", "panic-probe",
"portable-atomic",
"rp-pico", "rp-pico",
"rtic", "rtic",
"rtic-monotonics", "rtic-monotonics",
@ -512,10 +507,10 @@ dependencies = [
name = "rtic" name = "rtic"
version = "2.1.1" version = "2.1.1"
dependencies = [ dependencies = [
"atomic-polyfill",
"bare-metal 1.0.0", "bare-metal 1.0.0",
"cortex-m", "cortex-m",
"critical-section", "critical-section",
"portable-atomic",
"rtic-core", "rtic-core",
"rtic-macros", "rtic-macros",
] ]
@ -549,10 +544,10 @@ dependencies = [
name = "rtic-monotonics" name = "rtic-monotonics"
version = "2.0.0" version = "2.0.0"
dependencies = [ dependencies = [
"atomic-polyfill",
"cfg-if", "cfg-if",
"cortex-m", "cortex-m",
"fugit", "fugit",
"portable-atomic",
"rp2040-pac", "rp2040-pac",
"rtic-time", "rtic-time",
] ]

View file

@ -24,6 +24,7 @@ embedded-hal = { version = "0.2.7", features = ["unproven"] }
fugit = "0.3" fugit = "0.3"
rp-pico = "0.9.0" rp-pico = "0.9.0"
panic-probe = "0.3" panic-probe = "0.3"
portable-atomic = { version = "1", features = ["critical-section"] }
[profile.dev] [profile.dev]
opt-level = 1 opt-level = 1

View file

@ -8,15 +8,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
[[package]]
name = "atomic-polyfill"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c314e70d181aa6053b26e3f7fbf86d1dfff84f816a6175b967666b3506ef7289"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.1.0" version = "1.1.0"
@ -453,12 +444,12 @@ dependencies = [
[[package]] [[package]]
name = "rtic" name = "rtic"
version = "2.0.1" version = "2.1.1"
dependencies = [ dependencies = [
"atomic-polyfill",
"bare-metal 1.0.0", "bare-metal 1.0.0",
"cortex-m", "cortex-m",
"critical-section", "critical-section",
"portable-atomic",
"rtic-core", "rtic-core",
"rtic-macros", "rtic-macros",
] ]
@ -479,7 +470,7 @@ checksum = "d9369355b04d06a3780ec0f51ea2d225624db777acbc60abd8ca4832da5c1a42"
[[package]] [[package]]
name = "rtic-macros" name = "rtic-macros"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"proc-macro-error", "proc-macro-error",
@ -492,11 +483,10 @@ dependencies = [
name = "rtic-monotonics" name = "rtic-monotonics"
version = "2.0.0" version = "2.0.0"
dependencies = [ dependencies = [
"atomic-polyfill",
"cfg-if", "cfg-if",
"cortex-m", "cortex-m",
"embedded-hal 1.0.0",
"fugit", "fugit",
"portable-atomic",
"rtic-time", "rtic-time",
] ]

View file

@ -2,15 +2,6 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "atomic-polyfill"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "bare-metal" name = "bare-metal"
version = "0.2.5" version = "0.2.5"
@ -298,12 +289,12 @@ dependencies = [
[[package]] [[package]]
name = "rtic" name = "rtic"
version = "2.0.1" version = "2.1.1"
dependencies = [ dependencies = [
"atomic-polyfill",
"bare-metal 1.0.0", "bare-metal 1.0.0",
"cortex-m", "cortex-m",
"critical-section", "critical-section",
"portable-atomic",
"rtic-core", "rtic-core",
"rtic-macros", "rtic-macros",
] ]
@ -324,7 +315,7 @@ checksum = "d9369355b04d06a3780ec0f51ea2d225624db777acbc60abd8ca4832da5c1a42"
[[package]] [[package]]
name = "rtic-macros" name = "rtic-macros"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"proc-macro-error", "proc-macro-error",
@ -337,11 +328,10 @@ dependencies = [
name = "rtic-monotonics" name = "rtic-monotonics"
version = "2.0.0" version = "2.0.0"
dependencies = [ dependencies = [
"atomic-polyfill",
"cfg-if", "cfg-if",
"cortex-m", "cortex-m",
"embedded-hal 1.0.0",
"fugit", "fugit",
"portable-atomic",
"proc-macro2", "proc-macro2",
"quote", "quote",
"rtic-time", "rtic-time",
@ -415,6 +405,7 @@ dependencies = [
"defmt-rtt", "defmt-rtt",
"fugit", "fugit",
"panic-probe", "panic-probe",
"portable-atomic",
"rtic", "rtic",
"rtic-monotonics", "rtic-monotonics",
"stm32g0xx-hal", "stm32g0xx-hal",

View file

@ -25,6 +25,7 @@ defmt = "0.3.4"
defmt-rtt = "0.4.0" defmt-rtt = "0.4.0"
fugit = "0.3.7" fugit = "0.3.7"
panic-probe = { version = "0.3.1", features = ["print-defmt"] } panic-probe = { version = "0.3.1", features = ["print-defmt"] }
portable-atomic = { version = "1", features = ["unsafe-assume-single-core"] }
stm32g0xx-hal = { version = "0.2.0", features = ["rt", "stm32g030"] } stm32g0xx-hal = { version = "0.2.0", features = ["rt", "stm32g030"] }

View file

@ -2,15 +2,6 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "atomic-polyfill"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
dependencies = [
"critical-section",
]
[[package]] [[package]]
name = "bare-metal" name = "bare-metal"
version = "0.2.5" version = "0.2.5"
@ -109,7 +100,7 @@ dependencies = [
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.38", "syn 2.0.59",
] ]
[[package]] [[package]]
@ -133,17 +124,17 @@ dependencies = [
[[package]] [[package]]
name = "embedded-hal" name = "embedded-hal"
version = "1.0.0-rc.3" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc402f79e1fd22731ca945b4f97b5ff37e7b3f379312595c42bb2e8811c29920" checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89"
[[package]] [[package]]
name = "embedded-hal-async" name = "embedded-hal-async"
version = "1.0.0-rc.3" version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa1fba2ef2ffb35d614acc6fb323ddf7facc45c069f24544d49ea54e5043626d" checksum = "0c4c685bbef7fe13c3c6dd4da26841ed3980ef33e841cddfa15ce8a8fb3f1884"
dependencies = [ dependencies = [
"embedded-hal 1.0.0-rc.3", "embedded-hal 1.0.0",
] ]
[[package]] [[package]]
@ -358,9 +349,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]] [[package]]
name = "portable-atomic" name = "portable-atomic"
version = "1.5.1" version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
[[package]] [[package]]
name = "proc-macro-error" name = "proc-macro-error"
@ -388,18 +379,18 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.69" version = "1.0.80"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" checksum = "a56dea16b0a29e94408b9aa5e2940a4eedbd128a1ba20e8f7ae60fd3d465af0e"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.33" version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
@ -412,12 +403,12 @@ checksum = "46b71a9d9206e8b46714c74255adcaea8b11e0350c1d8456165073c3f75fc81a"
[[package]] [[package]]
name = "rtic" name = "rtic"
version = "2.0.1" version = "2.1.1"
dependencies = [ dependencies = [
"atomic-polyfill",
"bare-metal 1.0.0", "bare-metal 1.0.0",
"cortex-m", "cortex-m",
"critical-section", "critical-section",
"portable-atomic",
"rtic-core", "rtic-core",
"rtic-macros", "rtic-macros",
] ]
@ -438,25 +429,24 @@ checksum = "d9369355b04d06a3780ec0f51ea2d225624db777acbc60abd8ca4832da5c1a42"
[[package]] [[package]]
name = "rtic-macros" name = "rtic-macros"
version = "2.0.1" version = "2.1.0"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 1.0.109", "syn 2.0.59",
] ]
[[package]] [[package]]
name = "rtic-monotonics" name = "rtic-monotonics"
version = "2.0.0" version = "2.0.0"
dependencies = [ dependencies = [
"atomic-polyfill",
"cfg-if", "cfg-if",
"cortex-m", "cortex-m",
"embedded-hal 1.0.0-rc.3",
"fugit", "fugit",
"imxrt-ral", "imxrt-ral",
"portable-atomic",
"rtic-time", "rtic-time",
] ]
@ -465,7 +455,7 @@ name = "rtic-time"
version = "2.0.0" version = "2.0.0"
dependencies = [ dependencies = [
"critical-section", "critical-section",
"embedded-hal 1.0.0-rc.3", "embedded-hal 1.0.0",
"embedded-hal-async", "embedded-hal-async",
"fugit", "fugit",
"futures-util", "futures-util",
@ -509,9 +499,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.38" version = "2.0.59"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" checksum = "4a6531ffc7b071655e4ce2e04bd464c4830bb585a61cabb96cf808f05172615a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -574,7 +564,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.38", "syn 2.0.59",
] ]
[[package]] [[package]]

View file

@ -17,6 +17,7 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top!
### Changed ### Changed
- Replace `atomic-polyfill` with `portable-atomic`
- Rework all timers based on `rtic-time 2.0.0` - Rework all timers based on `rtic-time 2.0.0`
- Most timer tick rates are now configurable - Most timer tick rates are now configurable
- Tweak `build.rs` to avoid warnings in Nightly 1.78+ - Tweak `build.rs` to avoid warnings in Nightly 1.78+

View file

@ -36,7 +36,7 @@ rustdoc-flags = ["--cfg", "docsrs"]
[dependencies] [dependencies]
rtic-time = { version = "2.0.0", path = "../rtic-time" } rtic-time = { version = "2.0.0", path = "../rtic-time" }
fugit = { version = "0.3.6" } fugit = { version = "0.3.6" }
atomic-polyfill = "1" portable-atomic = { version = "1" }
cfg-if = "1.0.0" cfg-if = "1.0.0"
cortex-m = { version = "0.7.6", optional = true } cortex-m = { version = "0.7.6", optional = true }
critical-section = { version = "1", optional = true } critical-section = { version = "1", optional = true }

View file

@ -26,7 +26,7 @@
//! } //! }
//! ``` //! ```
use atomic_polyfill::{AtomicU32, Ordering}; use portable_atomic::{AtomicU32, Ordering};
use rtic_time::{ use rtic_time::{
half_period_counter::calculate_now, half_period_counter::calculate_now,
timer_queue::{TimerQueue, TimerQueueBackend}, timer_queue::{TimerQueue, TimerQueueBackend},

View file

@ -61,7 +61,7 @@ pub use nrf5340_net_pac::{self as pac, RTC0_NS as RTC0, RTC1_NS as RTC1};
#[doc(hidden)] #[doc(hidden)]
pub use nrf9160_pac::{self as pac, RTC0_NS as RTC0, RTC1_NS as RTC1}; pub use nrf9160_pac::{self as pac, RTC0_NS as RTC0, RTC1_NS as RTC1};
use atomic_polyfill::{AtomicU32, Ordering}; use portable_atomic::{AtomicU32, Ordering};
use rtic_time::{ use rtic_time::{
half_period_counter::calculate_now, half_period_counter::calculate_now,
timer_queue::{TimerQueue, TimerQueueBackend}, timer_queue::{TimerQueue, TimerQueueBackend},

View file

@ -71,7 +71,7 @@ pub use nrf5340_net_pac::{
#[doc(hidden)] #[doc(hidden)]
pub use nrf9160_pac::{self as pac, TIMER0_NS as TIMER0, TIMER1_NS as TIMER1, TIMER2_NS as TIMER2}; pub use nrf9160_pac::{self as pac, TIMER0_NS as TIMER0, TIMER1_NS as TIMER1, TIMER2_NS as TIMER2};
use atomic_polyfill::{AtomicU32, Ordering}; use portable_atomic::{AtomicU32, Ordering};
use rtic_time::{ use rtic_time::{
half_period_counter::calculate_now, half_period_counter::calculate_now,
timer_queue::{TimerQueue, TimerQueueBackend}, timer_queue::{TimerQueue, TimerQueueBackend},

View file

@ -51,7 +51,7 @@ pub mod prelude {
pub use fugit::{self, ExtU64, ExtU64Ceil}; pub use fugit::{self, ExtU64, ExtU64Ceil};
} }
use atomic_polyfill::{AtomicU64, Ordering}; use portable_atomic::{AtomicU64, Ordering};
use rtic_time::{ use rtic_time::{
half_period_counter::calculate_now, half_period_counter::calculate_now,
timer_queue::{TimerQueue, TimerQueueBackend}, timer_queue::{TimerQueue, TimerQueueBackend},

View file

@ -42,17 +42,17 @@ pub mod prelude {
pub use cortex_m::peripheral::SYST; pub use cortex_m::peripheral::SYST;
use atomic_polyfill::Ordering; use portable_atomic::Ordering;
use rtic_time::timer_queue::TimerQueue; use rtic_time::timer_queue::TimerQueue;
use crate::TimerQueueBackend; use crate::TimerQueueBackend;
cfg_if::cfg_if! { cfg_if::cfg_if! {
if #[cfg(feature = "systick-64bit")] { if #[cfg(feature = "systick-64bit")] {
use atomic_polyfill::AtomicU64; use portable_atomic::AtomicU64;
static SYSTICK_CNT: AtomicU64 = AtomicU64::new(0); static SYSTICK_CNT: AtomicU64 = AtomicU64::new(0);
} else { } else {
use atomic_polyfill::AtomicU32; use portable_atomic::AtomicU32;
static SYSTICK_CNT: AtomicU32 = AtomicU32::new(0); static SYSTICK_CNT: AtomicU32 = AtomicU32::new(0);
} }
} }

View file

@ -11,6 +11,7 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top!
- Updated esp32c3 dependency to v0.22.0 - Updated esp32c3 dependency to v0.22.0
- Use `riscv-slic` from `crates.io` - Use `riscv-slic` from `crates.io`
- Replace `atomic-polyfill` with `portable-atomic`
- Remove unused dependency `rtic-monotonics` - Remove unused dependency `rtic-monotonics`
## [v2.1.1] - 2024-03-13 ## [v2.1.1] - 2024-03-13

View file

@ -30,8 +30,7 @@ esp32c3 = { version = "0.22.0", optional = true }
riscv = { version = "0.11.0", optional = true } riscv = { version = "0.11.0", optional = true }
cortex-m = { version = "0.7.0", optional = true } cortex-m = { version = "0.7.0", optional = true }
bare-metal = "1.0.0" bare-metal = "1.0.0"
# portable-atomic = { version = "0.3.19" } portable-atomic = { version = "1", default-features = false }
atomic-polyfill = "1"
rtic-macros = { path = "../rtic-macros", version = "=2.1.0" } rtic-macros = { path = "../rtic-macros", version = "=2.1.0" }
rtic-core = "1" rtic-core = "1"
critical-section = "1" critical-section = "1"
@ -68,4 +67,4 @@ riscv-clint-backend = [
] ]
# needed for testing # needed for testing
test-critical-section = ["cortex-m/critical-section-single-core"] test-critical-section = ["portable-atomic/critical-section"]

View file

@ -1,6 +1,5 @@
pub use bare_metal::CriticalSection; pub use bare_metal::CriticalSection;
//pub use portable_atomic as atomic; pub use portable_atomic as atomic;
pub use atomic_polyfill as atomic;
pub mod executor; pub mod executor;

View file

@ -73,20 +73,20 @@ impl Package {
][..] ][..]
} else { } else {
&[ &[
"cortex-m-systick", "cortex-m-systick,portable-atomic/critical-section",
"cortex-m-systick,systick-64bit", "cortex-m-systick,systick-64bit,portable-atomic/critical-section",
"rp2040", "rp2040,portable-atomic/critical-section",
"nrf52805", "nrf52805,portable-atomic/critical-section",
"nrf52810", "nrf52810,portable-atomic/critical-section",
"nrf52811", "nrf52811,portable-atomic/critical-section",
"nrf52832", "nrf52832,portable-atomic/critical-section",
"nrf52833", "nrf52833,portable-atomic/critical-section",
"nrf52840", "nrf52840,portable-atomic/critical-section",
"nrf5340-app", "nrf5340-app,portable-atomic/critical-section",
"nrf5340-net", "nrf5340-net,portable-atomic/critical-section",
"nrf9160", "nrf9160,portable-atomic/critical-section",
"imxrt_gpt1,imxrt_gpt2,imxrt-ral/imxrt1062", "imxrt_gpt1,imxrt_gpt2,imxrt-ral/imxrt1062,portable-atomic/critical-section",
"stm32_tim2,stm32_tim3,stm32_tim4,stm32_tim5,stm32_tim15,stm32h725ag", "stm32_tim2,stm32_tim3,stm32_tim4,stm32_tim5,stm32_tim15,stm32h725ag,portable-atomic/critical-section",
][..] ][..]
}; };