Golem  v0.1.1
Generic Operating system Libraries for Embedded Multitasking
 All Data Structures Files Functions Variables Pages
example_glm.c
1 /*
2  * Example for top-level usage of Golem
3  *
4  * This example shows how Golem could be used.
5  *
6  * It is assumed that the user has configured Golem using its configuration
7  * files, e.g. glm_conf.h and glm_conf_tasks.h
8  */
9 
10 
11 /* INCLUDES *******************************************************************/
12 #include "glm/glm.h" // Provides Golem's functions glm_init() and glm_run()
13 #include "timer.h" // Provides the required user-function timer_enable()
14 
15 int main (void)
16 {
17  // Make sure you have sufficient heap-memory to support your software system
18  // and initialize Golem.
19  if(glm_init())
20  {
21  // Initialize device and use tick_inc() as timer callback
22  timer_enable(glm_tick);
23 
24  // Hand over execution to the scheduler. Make sure you have your tasks
25  // registered in the configuration file: golem/config.h
26  glm_run();
27  }
28 
29  // This point will never be reached
30  return 0;
31 }