Module bern_kernel::task[][src]

Expand description

Task creation and control.

Example

Create a task using the builder pattern:

let mut heartbeat = board.shield.led_1;
Task::new()
    .priority(Priority(0))
    .static_stack(kernel::alloc_static_stack!(512))
    .spawn(move || {
        loop {
            kernel::sleep(200);
            heartbeat.toggle().ok();
        }
    });

The task builder (TaskBuilder) is used to configure a task. On TaskBuilder::spawn() the information is passed to the scheduler and the task is put into ready state.

Tasks can be spawened from main() or within other tasks.

Structs

Task priority.

Task control block

Builder to create a new task

Enums

Transition for next context switch

Type Definitions

Issue with closures and static tasks