Hello World

The following example demonstrates how to develop a "Hello World" application utilizing Sirius RTOS.

#include <stdio.h>
#include "OS_API.h"

ERROR MainTask(PVOID Arg)
{
  /* Mark parameter as unused */
  AR_UNUSED_PARAM(Arg);

  /* Print the hello world message */
  printf("Hello world!\n");

  /* Return with success */
  return ERR_NO_ERROR;
}

int main(void)
{
  /* Initialization */
  arInit();
  stInit();
  osInit();

  /* Create a main task (default stack size, the highest priority) */
  osCreateTask(MainTask, NULL, 0, 0, FALSE);

  /* Start operating system */
  osStart();

  /* Deinitialization */
  osDeinit();
  arDeinit();

  return 0;
}
SpaceShadow documentation