Skip to content
Simon Benoit edited this page May 26, 2018 · 5 revisions

Home

nOS_Start

Definition

nOS_Error nOS_Start (void);

Description

Unlock context switching, call user callback and do first scheduling.

Parameters

Parameter Description

Return

Return Description
NOS_OK Kernel started successfully.
NOS_E_RUNNING Kernel already started.

Notes

  1. It is suggested to start your systick timer in callback.
  2. User callback is called outside of critical section, then interrupts can be re-enabled in callback.

Example

#include "nOS.h"

void Systick_Start(void)
{
    // Initialise timer that will be used as system tick at *NOS_CONFIG_TICKS_PER_SECOND* frequency
    // Start timer
}

void main(void)
{
    disable_interrupts();

    nOS_Init();
    // Application specific init

    // nOS objects creation

    nOS_Start(Systick_Start);

    enable_interrupts();

    // ...

    while (1) {
        // Idle

        // ...
    }
}
Clone this wiki locally