Skip to content

Async idle #50

@lachlansneff

Description

@lachlansneff

The networking and async I/O support in embedded rust is slowly getting better. For that support to be accessible in RTIC, I think it would make sense to allow the idle task to be async.

e.g.

#[idle]
async fn idle(cx: idle::Context) {
    ...
}

The regular idle would still work of course, but when the function is prefixed with async, it's allowed to return (and would return an impl Future<Output = ()>).

Users can already run an executor in the idle task of course, but having an executor built into RTIC would let it do smart things by default, like wfi when the future isn't running.

Future Possibilities

This could eventually be extended to allow for all tasks to be async, but idle seems like a safe bet first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions