aboutsummaryrefslogtreecommitdiff
path: root/examples/generics.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2020-10-05 18:25:15 +0200
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2020-10-05 18:25:15 +0200
commiteec0908024d9b4127ed496b4781adc08000cc2c2 (patch)
treef128b3d91ea4ac0f171ab334d4517552a6803d01 /examples/generics.rs
parent9d2598dc071882a94b813ab1d9ddf49092546257 (diff)
parentf493f21359ccb3ab4643d9470f3581532f47593a (diff)
downloadrtic-eec0908024d9b4127ed496b4781adc08000cc2c2.tar.gz
rtic-eec0908024d9b4127ed496b4781adc08000cc2c2.tar.zst
rtic-eec0908024d9b4127ed496b4781adc08000cc2c2.zip
Merge branch 'master' into always_late_resources
Diffstat (limited to 'examples/generics.rs')
-rw-r--r--examples/generics.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/generics.rs b/examples/generics.rs
index 65c5db02..3107dd11 100644
--- a/examples/generics.rs
+++ b/examples/generics.rs
@@ -11,7 +11,8 @@ use panic_semihosting as _;
use rtic::{Exclusive, Mutex};
#[rtic::app(device = lm3s6965)]
-const APP: () = {
+mod app {
+ #[resources]
struct Resources {
#[init(0)]
shared: u32,
@@ -51,7 +52,7 @@ const APP: () = {
// second argument has type `Exclusive<u32>`
advance(STATE, Exclusive(c.resources.shared));
}
-};
+}
// the second parameter is generic: it can be any type that implements the `Mutex` trait
fn advance(state: &mut u32, mut shared: impl Mutex<T = u32>) {