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
All threads now unconditionally save and restore FPU/SSE state,
making the uses_fp parameter obsolete. Rather than removing it
from the API (which would break out-of-tree components), this
commit deprecates it with a grace period:
RTAPI: uses_fp parameter is accepted but ignored; FPU state is
always saved in rtapi_task_new() regardless of the value passed.
HAL: uses_fp parameter is accepted but ignored in
hal_export_funct(), hal_export_functf(), and hal_create_thread().
All functions and threads are always marked as FP-capable
internally. The addf FP compatibility check is removed since
all threads are now FP-capable.
halcompile: fp/nofp keywords in function declarations now emit
a deprecation warning and are treated as fp (always return 1).
The keywords will be removed in a future version.
Remove fp/nofp from all in-tree .comp files, conv.comp.in
template, and mkconv.sh generator. Remove fp1= from test .hal
files. Out-of-tree .comp files will still parse but emit a
deprecation warning.
Documentation: API man pages, tutorials, and guides updated with
deprecation notices. Removed references to FP thread restrictions
that no longer apply.
No API signatures changed — out-of-tree components continue to
compile unchanged but will see warnings from halcompile if they
use fp/nofp.
Based on patch by BsAtHome.
Ref: #3895
Copy file name to clipboardExpand all lines: docs/src/hal/basic-hal.adoc
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,8 +68,13 @@ Owner CodeAddr Arg FP Users Name
68
68
69
69
You have to add a function from a HAL real time component to a thread to get the function to update at the rate of the thread.
70
70
Usually there are two threads as shown in this example.
71
-
Some components use floating point math and must be added to a thread that supports floating point math.
72
-
The `FP` indicates if floating point math is supported in that thread.
71
+
72
+
[NOTE]
73
+
====
74
+
The `FP` column and the `uses_fp` parameter are deprecated.
75
+
All threads now unconditionally save and restore floating point state.
76
+
The `fp`/`nofp` distinction will be removed in a future version.
77
+
====
73
78
74
79
----
75
80
$ halrun
@@ -78,14 +83,13 @@ halcmd: show thread
78
83
Realtime Threads:
79
84
Period FP Name ( Time, Max-Time )
80
85
995976 YES servo-thread ( 0, 0 )
81
-
55332 NO base-thread ( 0, 0 )
86
+
55332 YES base-thread ( 0, 0 )
82
87
----
83
88
84
89
- base-thread (the high-speed thread):
85
90
This thread handles items that need a fast response, like making step pulses, and reading and writing the parallel port.
86
-
Does not support floating point math.
87
91
- servo-thread (the slow-speed thread):
88
-
This thread handles items that can tolerate a slower response, like the motion controller, ClassicLadder, and the motion command handler and supports floating point math.
92
+
This thread handles items that can tolerate a slower response, like the motion controller, ClassicLadder, and the motion command handler.
89
93
90
94
.addf Syntax and Example
91
95
[source,{hal}]
@@ -94,9 +98,6 @@ addf <function> <thread>
94
98
addf mux4.0 servo-thread
95
99
----
96
100
97
-
[NOTE]
98
-
If the component requires a floating point thread that is usually the slower servo-thread.
Each function acts on all of the step pulse generators - running different generators in different threads is not supported.
164
164
165
-
* (funct) `stepgen.make-pulses` - High speed function to generate and count pulses (no floating point).
165
+
* (funct) `stepgen.make-pulses` - High speed function to generate and count pulses.
166
166
* (funct) `stepgen.update-freq` - Low speed function does position to velocity conversion, scaling and limiting.
167
167
* (funct) `stepgen.capture-position` - Low speed function for feedback, updates latches and scales position.
168
168
@@ -258,7 +258,7 @@ Each PWM generator will also have some of these pins, depending on the output ty
258
258
259
259
The component exports two functions. Each function acts on all of the PWM generators - running different generators in different threads is not supported.
260
260
261
-
* (funct) `pwmgen.make-pulses` - High speed function to generate PWM waveforms (no floating point).
261
+
* (funct) `pwmgen.make-pulses` - High speed function to generate PWM waveforms.
262
262
The high speed function `pwmgen.make-pulses` should be run in the base (fastest) thread, from 10 to 50 µs depending on the capabilities of the computer.
263
263
That thread's period determines the maximum PWM carrier frequency, as well as the resolution of the PWM or PDM signals.
264
264
If the base thread is 50,000 ns then every 50 µs the module decides if it is time to change the state of the output.
@@ -361,7 +361,7 @@ halcmd: unloadrt encoder
361
361
The component exports two functions.
362
362
Each function acts on all of the encoder counters - running different counters in different threads is not supported.
363
363
364
-
* (funct) `encoder.update-counters` - High speed function to count pulses (no floating point).
364
+
* (funct) `encoder.update-counters` - High speed function to count pulses.
365
365
* (funct) `encoder.capture-position` - Low speed function to update latches and scale position.
366
366
367
367
[[sec:pid]]
@@ -515,7 +515,7 @@ Most encoder counters will count four times during one complete cycle.
515
515
516
516
The component exports two functions. Each function affects all simulated encoders.
517
517
518
-
* (funct) `sim-encoder.make-pulses` - High speed function to generate quadrature pulses (no floating point).
518
+
* (funct) `sim-encoder.make-pulses` - High speed function to generate quadrature pulses.
519
519
* (funct) `sim-encoder.update-speed` - Low speed function to read `.speed`, do scaling, and set up `.make-pulses`.
520
520
521
521
[[sec:debounce]]
@@ -638,7 +638,7 @@ They were changed to pins to allow control by other components.]
638
638
(((lut5)))
639
639
The `lut5` component is a 5 input logic component based on a look up table.
640
640
641
-
* `lut5` does not require a floating point thread.
0 commit comments