aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEmil Fresk <emil.fresk@gmail.com>2024-01-29 20:56:15 +0100
committerEmil Fresk <emil.fresk@gmail.com>2024-02-27 12:22:18 +0100
commit27985009579e82673dcaf7a6a715fcf50c184863 (patch)
tree8ae8f1cc9e8c6d2c2581467a4a537d8b84ae6552 /examples
parentd2e84799c743eeb4b827d8da576be45ed43d6ece (diff)
Make RTIC 2 work on stable by using `main`'s stack as an allocator
Diffstat (limited to 'examples')
-rw-r--r--examples/nrf52840_blinky/src/bin/blinky_rtc.rs1
-rw-r--r--examples/nrf52840_blinky/src/bin/blinky_timer.rs1
-rw-r--r--examples/rp2040_local_i2c_init/src/main.rs1
-rw-r--r--examples/stm32f3_blinky/README.md4
-rw-r--r--examples/stm32f3_blinky/src/main.rs1
-rw-r--r--examples/stm32f411_rtc_interrupt/Cargo.lock175
-rw-r--r--examples/stm32f411_rtc_interrupt/Cargo.toml4
-rw-r--r--examples/stm32f411_rtc_interrupt/README.md2
-rw-r--r--examples/stm32f411_rtc_interrupt/src/main.rs1
-rw-r--r--examples/teensy4_blinky/examples/with_logs.rs1
-rw-r--r--examples/teensy4_blinky/src/main.rs1
11 files changed, 75 insertions, 117 deletions
diff --git a/examples/nrf52840_blinky/src/bin/blinky_rtc.rs b/examples/nrf52840_blinky/src/bin/blinky_rtc.rs
index e515659..dbdd0b0 100644
--- a/examples/nrf52840_blinky/src/bin/blinky_rtc.rs
+++ b/examples/nrf52840_blinky/src/bin/blinky_rtc.rs
@@ -2,7 +2,6 @@
#![deny(warnings)]
#![no_main]
#![no_std]
-#![feature(type_alias_impl_trait)]
use nrf52840_blinky::hal;
diff --git a/examples/nrf52840_blinky/src/bin/blinky_timer.rs b/examples/nrf52840_blinky/src/bin/blinky_timer.rs
index 53ccf4e..c1342f4 100644
--- a/examples/nrf52840_blinky/src/bin/blinky_timer.rs
+++ b/examples/nrf52840_blinky/src/bin/blinky_timer.rs
@@ -2,7 +2,6 @@
#![deny(warnings)]
#![no_main]
#![no_std]
-#![feature(type_alias_impl_trait)]
use nrf52840_blinky::hal;
diff --git a/examples/rp2040_local_i2c_init/src/main.rs b/examples/rp2040_local_i2c_init/src/main.rs
index a7ec08d..97049dc 100644
--- a/examples/rp2040_local_i2c_init/src/main.rs
+++ b/examples/rp2040_local_i2c_init/src/main.rs
@@ -1,6 +1,5 @@
#![no_std]
#![no_main]
-#![feature(type_alias_impl_trait)]
#[rtic::app(
device = rp_pico::hal::pac,
diff --git a/examples/stm32f3_blinky/README.md b/examples/stm32f3_blinky/README.md
index 5152661..1994dd3 100644
--- a/examples/stm32f3_blinky/README.md
+++ b/examples/stm32f3_blinky/README.md
@@ -6,12 +6,12 @@ Working example of simple LED blinking application for STM32 F303 Nucleo-64 boar
### Build
-Run `cargo +nightly build` to compile the code. If you run it for the first time, it will take some time to download and compile dependencies.
+Run `cargo build --release` to compile the code. If you run it for the first time, it will take some time to download and compile dependencies.
After that, you can use for example the cargo-embed tool to flash and run it
```bash
-$ cargo +nightly embed
+$ cargo embed
```
### Setup environment, flash and run program
diff --git a/examples/stm32f3_blinky/src/main.rs b/examples/stm32f3_blinky/src/main.rs
index b6da714..28dc7c2 100644
--- a/examples/stm32f3_blinky/src/main.rs
+++ b/examples/stm32f3_blinky/src/main.rs
@@ -2,7 +2,6 @@
#![deny(warnings)]
#![no_main]
#![no_std]
-#![feature(type_alias_impl_trait)]
use panic_rtt_target as _;
use rtic::app;
diff --git a/examples/stm32f411_rtc_interrupt/Cargo.lock b/examples/stm32f411_rtc_interrupt/Cargo.lock
index 8401900..08bf790 100644
--- a/examples/stm32f411_rtc_interrupt/Cargo.lock
+++ b/examples/stm32f411_rtc_interrupt/Cargo.lock
@@ -4,15 +4,6 @@ version = 3
[[package]]
name = "atomic-polyfill"
-version = "0.1.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28"
-dependencies = [
- "critical-section",
-]
-
-[[package]]
-name = "atomic-polyfill"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4"
@@ -21,18 +12,12 @@ dependencies = [
]
[[package]]
-name = "autocfg"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
-
-[[package]]
name = "bare-metal"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5deb64efa5bd81e31fcd1938615a6d98c82eafcbcd787162b6f63b91d6bac5b3"
dependencies = [
- "rustc_version 0.2.3",
+ "rustc_version",
]
[[package]]
@@ -124,7 +109,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -148,14 +133,23 @@ dependencies = [
[[package]]
name = "deranged"
-version = "0.3.9"
+version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3"
+checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
dependencies = [
"powerfmt",
]
[[package]]
+name = "document-features"
+version = "0.2.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95"
+dependencies = [
+ "litrs",
+]
+
+[[package]]
name = "embedded-dma"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -176,25 +170,25 @@ dependencies = [
[[package]]
name = "embedded-hal"
-version = "1.0.0-rc.1"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2894bc2f0457b8ca3d6b8ab8aad64d9337583672494013457f86c5a9146c0e22"
+checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89"
[[package]]
name = "embedded-hal-nb"
-version = "1.0.0-rc.1"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "257e3bb0163c69195acb0ebe0083b017b963235861d5ea9741626abdc55f39c9"
+checksum = "fba4268c14288c828995299e59b12babdbe170f6c6d73731af1b4648142e8605"
dependencies = [
- "embedded-hal 1.0.0-rc.1",
+ "embedded-hal 1.0.0",
"nb 1.1.0",
]
[[package]]
name = "embedded-storage"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "156d7a2fdd98ebbf9ae579cbceca3058cff946e13f8e17b90e3511db0508c723"
+checksum = "a21dea9854beb860f3062d10228ce9b976da520a73474aed3171ec276bc0c032"
[[package]]
name = "enumflags2"
@@ -213,7 +207,7 @@ checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
@@ -243,21 +237,21 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c"
+checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
[[package]]
name = "futures-task"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2"
+checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
[[package]]
name = "futures-util"
-version = "0.3.29"
+version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104"
+checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
dependencies = [
"futures-core",
"futures-task",
@@ -273,9 +267,9 @@ checksum = "1d758ba1b47b00caf47f24925c0074ecb20d6dfcffe7f6d53395c0465674841a"
[[package]]
name = "hash32"
-version = "0.2.1"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67"
+checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"
dependencies = [
"byteorder",
]
@@ -288,36 +282,29 @@ checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
[[package]]
name = "heapless"
-version = "0.7.16"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743"
+checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad"
dependencies = [
- "atomic-polyfill 0.1.11",
"hash32",
- "rustc_version 0.4.0",
- "spin",
"stable_deref_trait",
]
[[package]]
name = "indexmap"
-version = "2.1.0"
+version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
+checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b"
dependencies = [
"equivalent",
"hashbrown",
]
[[package]]
-name = "lock_api"
-version = "0.4.11"
+name = "litrs"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
-dependencies = [
- "autocfg",
- "scopeguard",
-]
+checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5"
[[package]]
name = "nb"
@@ -353,6 +340,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
+name = "portable-atomic"
+version = "1.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
+
+[[package]]
name = "powerfmt"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -384,18 +377,18 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.70"
+version = "1.0.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
+checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
-version = "1.0.33"
+version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
+checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [
"proc-macro2",
]
@@ -427,7 +420,7 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "857ce76a2517808a303bcb7e5b6d4a9c1d84e5de88b302aec2e53744633c0f4d"
dependencies = [
- "atomic-polyfill 1.0.3",
+ "atomic-polyfill",
"bare-metal 1.0.0",
"cortex-m",
"critical-section",
@@ -466,33 +459,34 @@ dependencies = [
[[package]]
name = "rtic-monotonics"
-version = "1.3.0"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75936ddc03d8946dd256c89270501186916db5505692e1207912404231a05774"
+checksum = "058c2397dbd5bb4c5650a0e368c3920953e458805ff5097a0511b8147b3619d7"
dependencies = [
- "atomic-polyfill 1.0.3",
+ "atomic-polyfill",
"cfg-if",
- "embedded-hal 1.0.0-rc.1",
+ "embedded-hal 1.0.0",
"fugit",
"rtic-time",
]
[[package]]
name = "rtic-sync"
-version = "1.0.2"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adc586db4c7ee4a85482ebb0542f34ffaee16bd8b8c552081f07492f531aca9f"
+checksum = "5a243123bcfb0bbbbf27b89c13de35670875a8725ec69763062e8a5903e69e93"
dependencies = [
"critical-section",
"heapless",
+ "portable-atomic",
"rtic-common",
]
[[package]]
name = "rtic-time"
-version = "1.0.0"
+version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55127cfa37ad32522eca2b70a12298bdb035c75ee3a4e403af8773ffe1a64bd3"
+checksum = "75b232e7aebc045cfea81cdd164bc2727a10aca9a4568d406d0a5661cdfd0f19"
dependencies = [
"critical-section",
"futures-util",
@@ -505,25 +499,10 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
dependencies = [
- "semver 0.9.0",
+ "semver",
]
[[package]]
-name = "rustc_version"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
-dependencies = [
- "semver 1.0.20",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
-
-[[package]]
name = "semver"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -533,27 +512,12 @@ dependencies = [
]
[[package]]
-name = "semver"
-version = "1.0.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
-
-[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]]
-name = "spin"
-version = "0.9.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
-dependencies = [
- "lock_api",
-]
-
-[[package]]
name = "stable_deref_trait"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -573,16 +537,17 @@ dependencies = [
[[package]]
name = "stm32f4xx-hal"
-version = "0.18.0"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80faf7c1b60e623f84584c5eddb634618e11afb5634eb871b678ef9251cef0a1"
+checksum = "10c41454f262c0be0c35b8cfc0d971e598281f7a9be32e894dc97a0b21deadfe"
dependencies = [
"bare-metal 1.0.0",
"cortex-m",
"cortex-m-rt",
+ "document-features",
"embedded-dma",
"embedded-hal 0.2.7",
- "embedded-hal 1.0.0-rc.1",
+ "embedded-hal 1.0.0",
"embedded-hal-nb",
"embedded-storage",
"enumflags2",
@@ -609,9 +574,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.39"
+version = "2.0.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
+checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
dependencies = [
"proc-macro2",
"quote",
@@ -620,29 +585,29 @@ dependencies = [
[[package]]
name = "thiserror"
-version = "1.0.50"
+version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
+checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.50"
+version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
+checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.39",
+ "syn 2.0.48",
]
[[package]]
name = "time"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5"
+checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e"
dependencies = [
"deranged",
"powerfmt",
diff --git a/examples/stm32f411_rtc_interrupt/Cargo.toml b/examples/stm32f411_rtc_interrupt/Cargo.toml
index 90053a2..e8ccbf2 100644
--- a/examples/stm32f411_rtc_interrupt/Cargo.toml
+++ b/examples/stm32f411_rtc_interrupt/Cargo.toml
@@ -18,8 +18,8 @@ defmt-rtt = { version = "0.4.0"}
rtic-sync = "1.0.2"
[dependencies.stm32f4xx-hal]
-version = "0.18.0"
-features = ["rt", "stm32f411"] # replace the model of your microcontroller here
+version = "0.20.0"
+features = ["stm32f411"] # replace the model of your microcontroller here
# this lets you use `cargo fix`!
[[bin]]
diff --git a/examples/stm32f411_rtc_interrupt/README.md b/examples/stm32f411_rtc_interrupt/README.md
index 55b7a7d..689ea9d 100644
--- a/examples/stm32f411_rtc_interrupt/README.md
+++ b/examples/stm32f411_rtc_interrupt/README.md
@@ -6,7 +6,7 @@ After configured, it will listen to periodic wake-up interrupts happening every
## How-to
### Build
-Run `cargo +nightly build` to compile the code. If you run it for the first time, it will take some time to download and compile dependencies.
+Run `cargo build --release` to compile the code. If you run it for the first time, it will take some time to download and compile dependencies.
### Run
Install `probe-rs` and configure it using the [debugging extension for VScode](https://probe.rs/docs/tools/debugger/).
diff --git a/examples/stm32f411_rtc_interrupt/src/main.rs b/examples/stm32f411_rtc_interrupt/src/main.rs
index 71ce96f..55bebee 100644
--- a/examples/stm32f411_rtc_interrupt/src/main.rs
+++ b/examples/stm32f411_rtc_interrupt/src/main.rs
@@ -2,7 +2,6 @@
#![deny(warnings)]
#![no_main]
#![no_std]
-#![feature(type_alias_impl_trait)]
use panic_halt as _;
diff --git a/examples/teensy4_blinky/examples/with_logs.rs b/examples/teensy4_blinky/examples/with_logs.rs
index e844246..82c7154 100644
--- a/examples/teensy4_blinky/examples/with_logs.rs
+++ b/examples/teensy4_blinky/examples/with_logs.rs
@@ -1,7 +1,6 @@
#![deny(warnings)]
#![no_main]
#![no_std]
-#![feature(type_alias_impl_trait)]
use bsp::pins::common::{P0, P1};
imxrt_uart_panic::register!(LPUART6, P1, P0, 115200, teensy4_panic::sos);
diff --git a/examples/teensy4_blinky/src/main.rs b/examples/teensy4_blinky/src/main.rs
index fad088c..443e605 100644
--- a/examples/teensy4_blinky/src/main.rs
+++ b/examples/teensy4_blinky/src/main.rs
@@ -2,7 +2,6 @@
#![deny(warnings)]
#![no_main]
#![no_std]
-#![feature(type_alias_impl_trait)]
#[panic_handler]
fn panic(_: &::core::panic::PanicInfo) -> ! {