embedded system library for e-puck  1.0.1
A redesigned API library for the e-puck robot platform
 All Data Structures Files Functions Variables Enumerations Enumerator Modules Pages
el_process.h
Go to the documentation of this file.
1 /*
2 
3 embedded system library for e-puck
4 
5 --------------------------------------------------------------------------------
6 
7 code distribution:
8 https://github.com/jianingchen/epucklib
9 
10 online documentation:
11 http://jianingchen.github.io/epucklib/html/
12 
13 --------------------------------------------------------------------------------
14 
15 This file is released under the terms of the MIT license (see "el.h").
16 
17 */
18 
28 #ifndef EL_PROCESS_H
29 #define EL_PROCESS_H
30 
31 #include "el_common.h"
32 #include "el_clock.h"
33 
34 #define EL_PROCESS_MAX_NUM 7
35 
36 typedef void (*el_process)(void*);
37 #define EL_PROCESS void
38 
58 el_index el_launch_process(el_process func,void*arg);
59 
60 
68 void el_process_wait(el_time t_ms);
69 
70 
79 void el_process_wait_fraction(unsigned int num,unsigned int den);
80 
81 
121 void el_process_cooperate();
122 
123 
132 void el_process_resume(el_index process_idx);
133 
134 
151 void el_kill_process(el_index process_idx);
152 
153 
161 el_index el_get_local_process_index();
162 
163 
164 /*
165 --------------------------------------------------------------------------------
166 */
167 
168 
169 #ifdef EL_INCLUDE_LIB_INTERNAL_CONTEXT
170 
171 #define EL_PROCESS_STACK_OFFSET 192
172 #define EL_PROCESS_STACK_SIZE 192
173 #define EL_PROCESS_DIM EL_PROCESS_MAX_NUM
174 
175 extern el_mct el_process_mck;
176 extern el_bool el_is_in_process;
177 extern el_bool el_is_in_process_call;
178 extern el_index el_cmt_current_process_index;
179 extern el_uint16 el_process_overwatch;
180 
181 void el_init_process();
182 void el_routine_process();
183 
184 #endif
185 
186 
187 
188 #endif
void el_process_resume(el_index process_idx)
finish the waiting period of a process immediately
void el_kill_process(el_index process_idx)
kill the process (the abnormal way to end a process)
void el_process_wait(el_time t_ms)
wait for a period of time
void el_process_wait_fraction(unsigned int num, unsigned int den)
wait for a period of time specified as a fraction
el_index el_launch_process(el_process func, void *arg)
execute a function in a process
el_index el_get_local_process_index()
get index of the process where this function is called
void el_process_cooperate()
Introduce an atomic wait so other processes can be executed.