mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
Minor cleanup
This commit is contained in:
parent
b4509bdbfe
commit
6155f1366a
3 changed files with 16 additions and 11 deletions
11
Cargo.toml
11
Cargo.toml
|
@ -14,7 +14,7 @@ name = "cortex-m-rtic"
|
|||
readme = "README.md"
|
||||
repository = "https://github.com/rtic-rs/cortex-m-rtic"
|
||||
|
||||
version = "0.6.0-alpha.2"
|
||||
version = "0.6.0-alpha.3"
|
||||
|
||||
[lib]
|
||||
name = "rtic"
|
||||
|
@ -53,15 +53,17 @@ required-features = ["__v7"]
|
|||
|
||||
[dependencies]
|
||||
cortex-m = "0.7.0"
|
||||
cortex-m-rtic-macros = { path = "macros", version = "0.6.0-alpha.2" }
|
||||
rtic-monotonic = "0.1.0-alpha.0"
|
||||
cortex-m-rtic-macros = { path = "macros", version = "0.6.0-alpha.3" }
|
||||
# rtic-monotonic = "0.1.0-alpha.1"
|
||||
rtic-monotonic = { path = "../rtic-monotonic" }
|
||||
rtic-core = "0.3.1"
|
||||
heapless = "0.6.1"
|
||||
bare-metal = "1.0.0"
|
||||
generic-array = "0.14"
|
||||
|
||||
[dependencies.dwt-systick-monotonic]
|
||||
version = "0.1.0-alpha.0"
|
||||
# version = "0.1.0-alpha.2"
|
||||
path = "../dwt-systick-monotonic"
|
||||
optional = true
|
||||
|
||||
[build-dependencies]
|
||||
|
@ -110,3 +112,4 @@ overflow-checks = false
|
|||
|
||||
[patch.crates-io]
|
||||
lm3s6965 = { git = "https://github.com/japaric/lm3s6965" }
|
||||
# embedded-time = { path = "../../embedded-time" }
|
||||
|
|
|
@ -14,8 +14,10 @@ mod app {
|
|||
use dwt_systick_monotonic::DwtSystick;
|
||||
use rtic::time::duration::Seconds;
|
||||
|
||||
const MONO_HZ: u32 = 8_000_000; // 8 MHz
|
||||
|
||||
#[monotonic(binds = SysTick, default = true)]
|
||||
type MyMono = DwtSystick<8_000_000>; // 8 MHz
|
||||
type MyMono = DwtSystick<MONO_HZ>;
|
||||
|
||||
#[init()]
|
||||
fn init(cx: init::Context) -> (init::LateResources, init::Monotonics) {
|
||||
|
@ -25,24 +27,24 @@ mod app {
|
|||
|
||||
let mono = DwtSystick::new(&mut dcb, dwt, systick, 8_000_000);
|
||||
|
||||
hprintln!("init").unwrap();
|
||||
hprintln!("init").ok();
|
||||
|
||||
// Schedule `foo` to run 1 second in the future
|
||||
foo::spawn_after(Seconds(1_u32)).unwrap();
|
||||
foo::spawn_after(Seconds(1_u32)).ok();
|
||||
|
||||
// Schedule `bar` to run 2 seconds in the future
|
||||
bar::spawn_after(Seconds(2_u32)).unwrap();
|
||||
bar::spawn_after(Seconds(2_u32)).ok();
|
||||
|
||||
(init::LateResources {}, init::Monotonics(mono))
|
||||
}
|
||||
|
||||
#[task]
|
||||
fn foo(_: foo::Context) {
|
||||
hprintln!("foo").unwrap();
|
||||
hprintln!("foo").ok();
|
||||
}
|
||||
|
||||
#[task]
|
||||
fn bar(_: bar::Context) {
|
||||
hprintln!("bar").unwrap();
|
||||
hprintln!("bar").ok();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ license = "MIT OR Apache-2.0"
|
|||
name = "cortex-m-rtic-macros"
|
||||
readme = "../README.md"
|
||||
repository = "https://github.com/rtic-rs/cortex-m-rtic"
|
||||
version = "0.6.0-alpha.2"
|
||||
version = "0.6.0-alpha.3"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
|
Loading…
Reference in a new issue