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)]
mod app {
#[init]
fn main(_: main::Context) {
fn taskmain(_: taskmain::Context) {
assert!(cortex_m::Peripherals::take().is_none());
debug::exit(debug::EXIT_SUCCESS);
}

View file

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

View file

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

View file

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

View file

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