Skip to content
Snippets Groups Projects
Commit 57ed0963 authored by Jonas Schievink's avatar Jonas Schievink
Browse files

Use `untagged_option` crate

parent c8bdb732
No related branches found
No related tags found
No related merge requests found
......@@ -14,10 +14,9 @@ version = "0.2.1"
[dependencies]
cortex-m = "0.3.1"
# TODO should this have been a `path` dep all along?
untagged-option = "0.1.1"
rtfm-core = "0.1.0"
cortex-m-rtfm-macros = { path = "macros" }
# TODO revert before merging
rtfm-core = { git = "https://github.com/jonas-schievink/rtfm-core.git", branch = "init-resources" }
[target.'cfg(target_arch = "x86_64")'.dev-dependencies]
compiletest_rs = "0.2.8"
......
......@@ -233,7 +233,7 @@ fn init(app: &App, main: &mut Vec<Tokens>, root: &mut Vec<Tokens>) {
});
late_resources.push(quote! {
#_name = #krate::LateResource { init: _late_resources.#name };
#_name = #krate::UntaggedOption { some: _late_resources.#name };
});
}
......@@ -344,7 +344,7 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
},
None => quote! {
// Resource initialized in `init`
static mut #_name: #krate::LateResource<#ty> = #krate::LateResource { uninit: () };
static mut #_name: #krate::UntaggedOption<#ty> = #krate::UntaggedOption { none: () };
},
});
}
......@@ -587,7 +587,7 @@ fn tasks(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
}
} else {
quote! {
#name: ::#krate::Static::ref_mut(&mut ::#_name.init),
#name: ::#krate::Static::ref_mut(::#_name.as_mut()),
}
});
} else {
......
......@@ -80,12 +80,14 @@
extern crate cortex_m;
extern crate cortex_m_rtfm_macros;
extern crate rtfm_core;
extern crate untagged_option;
use core::u8;
pub use rtfm_core::{Resource, LateResource, Static, Threshold};
pub use rtfm_core::{Resource, Static, Threshold};
pub use cortex_m::asm::{bkpt, wfi};
pub use cortex_m_rtfm_macros::app;
pub use untagged_option::UntaggedOption;
use cortex_m::interrupt::{self, Nr};
#[cfg(not(armv6m))]
use cortex_m::register::basepri;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment