Fix xtask for async

This commit is contained in:
Emil Fresk 2022-08-05 11:43:50 +02:00
parent 46a3f2befd
commit bf54d4dc2b
8 changed files with 42 additions and 18 deletions

View file

@ -25,7 +25,7 @@ jobs:
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal
toolchain: stable toolchain: nightly
override: true override: true
components: rustfmt components: rustfmt
@ -49,7 +49,7 @@ jobs:
- thumbv6m-none-eabi - thumbv6m-none-eabi
- x86_64-unknown-linux-gnu - x86_64-unknown-linux-gnu
toolchain: toolchain:
- stable - nightly
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -82,12 +82,13 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install Rust stable - name: Install Rust nightly
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: nightly
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
override: true override: true
components: clippy
- name: Fail on warnings - name: Fail on warnings
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs macros/src/lib.rs run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs macros/src/lib.rs
@ -111,7 +112,7 @@ jobs:
- thumbv7m-none-eabi - thumbv7m-none-eabi
- thumbv6m-none-eabi - thumbv6m-none-eabi
toolchain: toolchain:
- stable - nightly
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -144,7 +145,7 @@ jobs:
- thumbv7m-none-eabi - thumbv7m-none-eabi
- thumbv6m-none-eabi - thumbv6m-none-eabi
toolchain: toolchain:
- stable - nightly
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -188,7 +189,7 @@ jobs:
target: target:
- x86_64-unknown-linux-gnu - x86_64-unknown-linux-gnu
toolchain: toolchain:
- stable - nightly
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -224,7 +225,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: nightly
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
override: true override: true
@ -252,7 +253,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: nightly
target: x86_64-unknown-linux-gnu target: x86_64-unknown-linux-gnu
override: true override: true

View file

@ -0,0 +1,7 @@
init
hello from bar
hello from baz
hello from foo
bye from foo
bye from bar
bye from baz

View file

@ -0,0 +1,6 @@
init
hello from async 0
hello from async 1
hello from async 2
hello from async 3
hello from async 4

View file

@ -0,0 +1,5 @@
init
hello from normal 2
hello from async 2
hello from normal 1
hello from async 1

View file

@ -0,0 +1,3 @@
init
hello from normal
hello from async

View file

@ -0,0 +1,5 @@
init
hello from bar
hello from foo
foo no timeout
bar timeout

View file

@ -43,7 +43,7 @@ pub fn app(app: &App, _analysis: &Analysis) -> parse::Result<Extra> {
let need = priorities let need = priorities
.iter() .iter()
// Only count if not 0 // Only count if not 0
.filter_map(|prio| if *prio > 0 { Some(prio) } else { None }) .filter(|prio| **prio > 0)
.count(); .count();
let given = app.args.extern_interrupts.len(); let given = app.args.extern_interrupts.len();
if need > given { if need > given {

View file

@ -183,14 +183,11 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
} }
)); ));
for name in channel.tasks.iter().filter_map(|name| { for name in channel
let task = &app.software_tasks[name]; .tasks
if task.is_async { .iter()
Some(name) .filter(|name| app.software_tasks[*name].is_async)
} else { {
None
}
}) {
let exec_name = util::internal_task_ident(name, "EXEC"); let exec_name = util::internal_task_ident(name, "EXEC");
let executor_run_ident = util::executor_run_ident(name); let executor_run_ident = util::executor_run_ident(name);