Golem  v0.1.1
Generic Operating system Libraries for Embedded Multitasking
 All Data Structures Files Functions Variables Pages
/home/ruud/Engineering/software/projects/golem-project-code/trunk/glm.h File Reference

This file provides functions for initializing Golem and for starting the cooperative multitasking system. More...

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "glm_intbase.h"
#include "glm_tick.h"

Go to the source code of this file.

Functions

bool glm_init ()
 Initialize Golem. More...
 
void glm_tick ()
 Increment Golem's internal tick count.
 
void glm_run ()
 Pass execution to the Golem operating system. More...
 
void glm_abort ()
 Aborts execution of the Golem operating system. More...
 

Detailed Description

This file provides functions for initializing Golem and for starting the cooperative multitasking system.

Author
Ruud Beukema

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Definition in file glm.h.

Function Documentation

void glm_abort ( )

Aborts execution of the Golem operating system.

When execution is passed on to Golem by calling glm_run() this function can be be called (asynchronously) in order to inform Golem's scheduler to subsequently:

  • Finish its current scheduling slot
  • Run each task's abort-function
  • Reset Golem
  • Return execution to glm_run()'s caller.

Definition at line 49 of file glm.c.

bool glm_init ( )

Initialize Golem.

Returns
TRUE if successful or FALSE if there allocation of heap memory during initialization failed.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Examples:
example_glm.c.

Definition at line 22 of file glm.c.

void glm_run ( )

Pass execution to the Golem operating system.

This function passes on execution to Golem's scheduler and does not return execution to its caller until glm_abort() is called. When this function exits, Golem has been reset and glm_init() must be called prior to calling glm_run() again.

Examples:
example_glm.c.

Definition at line 35 of file glm.c.