Name collision with RTIC-main

With modules the scoping is different and task names collide with main generated by RTIC
This commit is contained in:
Henrik Tjäder 2020-09-25 13:36:00 +00:00
parent 224e1991e0
commit abc50d2c58
5 changed files with 7 additions and 7 deletions

View file

@ -9,7 +9,7 @@ use panic_semihosting as _;
#[rtic::app(device = lm3s6965)] #[rtic::app(device = lm3s6965)]
mod app { mod app {
#[init] #[init]
fn main(_: main::Context) { fn taskmain(_: taskmain::Context) {
assert!(cortex_m::Peripherals::take().is_none()); assert!(cortex_m::Peripherals::take().is_none());
debug::exit(debug::EXIT_SUCCESS); debug::exit(debug::EXIT_SUCCESS);
} }

View file

@ -14,7 +14,7 @@ mod app {
} }
#[task(binds = UART0)] #[task(binds = UART0)]
fn main(_: main::Context) { fn taskmain(_: taskmain::Context) {
debug::exit(debug::EXIT_SUCCESS); debug::exit(debug::EXIT_SUCCESS);
} }
} }

View file

@ -12,7 +12,7 @@ mod app {
fn init(_: init::Context) {} fn init(_: init::Context) {}
#[idle] #[idle]
fn main(_: main::Context) -> ! { fn taskmain(_: taskmain::Context) -> ! {
debug::exit(debug::EXIT_SUCCESS); debug::exit(debug::EXIT_SUCCESS);
loop { loop {
cortex_m::asm::nop(); cortex_m::asm::nop();

View file

@ -9,7 +9,7 @@ use panic_semihosting as _;
#[rtic::app(device = lm3s6965)] #[rtic::app(device = lm3s6965)]
mod app { mod app {
#[init] #[init]
fn main(_: main::Context) { fn taskmain(_: taskmain::Context) {
debug::exit(debug::EXIT_SUCCESS); debug::exit(debug::EXIT_SUCCESS);
} }
} }

View file

@ -8,13 +8,13 @@ use panic_semihosting as _;
#[rtic::app(device = lm3s6965)] #[rtic::app(device = lm3s6965)]
mod app { mod app {
#[init(spawn = [main])] #[init(spawn = [taskmain])]
fn init(cx: init::Context) { fn init(cx: init::Context) {
cx.spawn.main().ok(); cx.spawn.taskmain().ok();
} }
#[task] #[task]
fn main(_: main::Context) { fn taskmain(_: taskmain::Context) {
debug::exit(debug::EXIT_SUCCESS); debug::exit(debug::EXIT_SUCCESS);
} }