[][src]Function mynewt::kernel::os::task_init

pub fn task_init(
    arg1: Out<os_task>,
    arg2: &Strn<'_>,
    arg3: os_task_func_t,
    arg4: Ptr,
    arg5: u8,
    arg6: os_time_t,
    arg7: Out<[os_stack_t]>,
    arg8: u16
) -> MynewtResult<()>

Initialize a task.

This function initializes the task structure pointed to by t, clearing and setting it's stack pointer, provides sane defaults and sets the task as ready to run, and inserts it into the operating system scheduler.

  • t: The task to initialize
  • name: The name of the task to initialize
  • func: The task function to call
  • arg: The argument to pass to this task function
  • prio: The priority at which to run this task
  • sanity_itvl: The time at which this task should check in with the sanity task. OS_WAIT_FOREVER means never check in here.
  • stack_bottom: A pointer to the bottom of a task's stack
  • stack_size: The overall size of the task's stack.

Return: 0 on success, non-zero on failure.