aboutsummaryrefslogtreecommitdiff
path: root/examples/generics.rs
diff options
context:
space:
mode:
authorGravatar Henrik Tjäder <henrik@tjaders.com> 2020-04-22 10:58:14 +0000
committerGravatar Henrik Tjäder <henrik@tjaders.com> 2020-09-25 14:29:34 +0000
commit8df2ec11b0ee3209678dcc1b1a5baa479fa1dfe5 (patch)
tree832c0e11695545449904835f2fb8f57bf086407a /examples/generics.rs
parent4d61437bb4debea5adc578ee072bff3619d8077b (diff)
downloadrtic-8df2ec11b0ee3209678dcc1b1a5baa479fa1dfe5.tar.gz
rtic-8df2ec11b0ee3209678dcc1b1a5baa479fa1dfe5.tar.zst
rtic-8df2ec11b0ee3209678dcc1b1a5baa479fa1dfe5.zip
Examples using mod instead of const
Diffstat (limited to 'examples/generics.rs')
-rw-r--r--examples/generics.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/generics.rs b/examples/generics.rs
index 40ab81ac..b67ed9ca 100644
--- a/examples/generics.rs
+++ b/examples/generics.rs
@@ -11,7 +11,7 @@ use panic_semihosting as _;
use rtic::{Exclusive, Mutex};
#[rtic::app(device = lm3s6965)]
-const APP: () = {
+mod APP {
struct Resources {
#[init(0)]
shared: u32,
@@ -49,7 +49,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>) {