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.c
1 
11 /* INCLUDES *******************************************************************/
12 #include "glm.h"
13 #include "glm_conf.h"
14 #include "glm_scheduler.h"
15 #include "glm_alarm.h"
16 #include "glm_signal.h"
17 
18 
19 /* PUBLIC FUNCTIONS ***********************************************************/
20 
21 bool
22 glm_init()
23 {
24  return alarm_init() &&
25  signal_init();
26 }
27 
28 void
29 glm_tick()
30 {
31  tick_inc();
32 }
33 
34 void
35 glm_run()
36 {
37  // Run the scheduler
38  scheduler_run();
39 
40  // When the scheduler gets aborted and returns execution here, reset the
41  // relevant Golem functionality.
42  alarm_reset();
43  signal_reset();
44  heap_reset();
45 }
46 
47 
48 void
49 glm_abort()
50 {
51  // Inform scheduler to abort execution when curent scheduling slot has
52  // finished.
53  scheduler_abort();
54 }