You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/hal/comp.adoc
+36-15Lines changed: 36 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,7 @@ component ddt "Compute the derivative of the input function";
31
31
pin in float in;
32
32
pin out float out;
33
33
variable double old;
34
+
option period no;
34
35
function _;
35
36
license "GPL"; // indicates GPL v2 or later
36
37
;;
@@ -173,7 +174,7 @@ If neither 'count' nor 'names' is specified, a single numbered instance is creat
173
174
174
175
Functions are implicitly passed the 'period' parameter which is the time in nanoseconds of the last period to execute the component.
175
176
Functions which use floating-point can also refer to 'fperiod' which is the floating-point time in seconds, or (period*1e-9).
176
-
This can be useful in components that need the timing information.
177
+
This can be useful in components that need the timing information. See also 'option period' below.
177
178
178
179
== Syntax
179
180
@@ -292,18 +293,24 @@ r"\fIexample\fB"
292
293
293
294
The currently defined options are:
294
295
295
-
* 'option singleton yes' - (default: no)
296
-
Do not create a 'count' module parameter, and always create a single instance.
297
-
With 'singleton', items are named 'component-name.item-name' and without 'singleton', items for numbered instances are named 'component-name.<num>.item-name'.
298
-
* 'option default_count number' - (default: 1)
299
-
Normally, the module parameter 'count' defaults to 1. If specified, the 'count' will default to this value instead.
300
-
* 'option count_function yes' - (default: no)
301
-
Normally, the number of instances to create is specified in the module parameter 'count';
302
-
if 'count_function' is specified, the value returned by the function 'int get_count(void)' is used instead, and the 'count' module parameter is not defined.
303
-
* 'option rtapi_app no' - (default: yes)
296
+
* 'option singleton yes' - (default: no) +
297
+
Do not create a 'count' module parameter, and always create a single instance. With
298
+
'singleton', items are named 'component-name.item-name' and without 'singleton', items for
299
+
numbered instances are named 'component-name.<num>.item-name'.
300
+
301
+
* 'option default_count number' - (default: 1) +
302
+
Normally, the module parameter 'count' defaults to 1. If specified, the 'count' will default
303
+
to this value instead.
304
+
305
+
* 'option count_function yes' - (default: no) +
306
+
Normally, the number of instances to create is specified in the module parameter 'count'; if
307
+
'count_function' is specified, the value returned by the function 'int get_count(void)' is
308
+
used instead, and the 'count' module parameter is not defined.
309
+
310
+
* 'option rtapi_app no' - (default: yes) +
304
311
Normally, the functions `rtapi_app_main()` and `rtapi_app_exit()` are automatically defined.
305
312
With 'option rtapi_app no', they are not, and must be provided in the C code.
306
-
Use the following prototypes:
313
+
Use the following prototypes: +
307
314
+
308
315
----
309
316
`int rtapi_app_main(void);`
@@ -339,15 +346,15 @@ When implementing your own `rtapi_app_main()`, call the function `int export(cha
339
346
This function may process the commandline arguments or take other actions.
340
347
Its return type is 'void'; it may call 'exit()' if it wishes to terminate rather than create a HAL component (e.g., because the commandline arguments were invalid).
0 commit comments