Skip to content

Commit e32c8a0

Browse files
committed
hal: Break the HAL API - Move to 64-bit exclusively.
1 parent 514be4f commit e32c8a0

268 files changed

Lines changed: 2672 additions & 3881 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎configs/apps/gladevcp/complex/complex.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _hal_setup(self,halcomp, builder):
124124

125125
# standard hal pins not associated with any widget
126126
self.halcomp.newpin("example-out", hal.Type.BOOL, hal.Dir.OUT)
127-
self.halcomp.newpin("example-in", hal.HAL_S32, hal.Dir.IN)
127+
self.halcomp.newpin("example-in", hal.Type.SINT, hal.Dir.IN)
128128

129129
# hal pins with change callback. Also unrelated to any HAL widget.
130130
# When the pin's value changes the callback is executed.

‎configs/attic/unclaimed/plasma-thc/mp1000A.hal‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ loadrt or2 count=9
1616
loadrt scale
1717
loadrt sum2 count=5
1818
loadrt xor2 count=4
19-
loadrt conv_s32_float
19+
loadrt conv_sint_real
2020
loadrt edge count=2
2121

2222
# Attach realtime hal components to a realtime thread
@@ -32,7 +32,7 @@ addf and2.8 servo-thread
3232
addf comp.0 servo-thread
3333
addf comp.1 servo-thread
3434
addf comp.2 servo-thread
35-
addf conv-s32-float.0 servo-thread
35+
addf conv-sint-real.0 servo-thread
3636
addf edge.0 servo-thread
3737
addf edge.1 servo-thread
3838
addf flipflop.0 servo-thread
@@ -178,8 +178,8 @@ net FeedHold xor2.0.out => motion.feed-hold
178178
net CHLSwitched xor2.2.out => and2.1.in1
179179
net ArcOKTimer oneshot.2.out => xor2.1.in0
180180
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
181-
net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
182-
net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
181+
net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
182+
net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
183183
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
184184
net TorchOff not.2.out => flipflop.1.reset
185185
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1

‎configs/attic/unclaimed/plasma-thc/mp1000B.hal‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ loadrt or2 count=9
1616
loadrt scale
1717
loadrt sum2 count=5
1818
loadrt xor2 count=4
19-
loadrt conv_s32_float
19+
loadrt conv_sint_real
2020
loadrt edge count=2
2121

2222
# Attach realtime hal components to a realtime thread
@@ -32,7 +32,7 @@ addf and2.8 servo-thread
3232
addf comp.0 servo-thread
3333
addf comp.1 servo-thread
3434
addf comp.2 servo-thread
35-
addf conv-s32-float.0 servo-thread
35+
addf conv-sint-real.0 servo-thread
3636
addf edge.0 servo-thread
3737
addf edge.1 servo-thread
3838
addf flipflop.0 servo-thread
@@ -178,8 +178,8 @@ net FeedHold xor2.0.out => motion.feed-hold
178178
net CHLSwitched xor2.2.out => and2.1.in1
179179
net ArcOKTimer oneshot.2.out => xor2.1.in0
180180
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
181-
net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
182-
net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
181+
net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
182+
net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
183183
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
184184
net TorchOff not.2.out => flipflop.1.reset
185185
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1

‎configs/attic/unclaimed/plasma-thc/thc300.hal‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ loadrt or2 count=9
1616
loadrt scale
1717
loadrt sum2 count=5
1818
loadrt xor2 count=4
19-
loadrt conv_s32_float
19+
loadrt conv_sint_real
2020
loadrt edge count=2
2121

2222
# Attach realtime hal components to a realtime thread
@@ -32,7 +32,7 @@ addf and2.8 servo-thread
3232
addf comp.0 servo-thread
3333
addf comp.1 servo-thread
3434
addf comp.2 servo-thread
35-
addf conv-s32-float.0 servo-thread
35+
addf conv-sint-real.0 servo-thread
3636
addf edge.0 servo-thread
3737
addf edge.1 servo-thread
3838
addf flipflop.0 servo-thread
@@ -178,8 +178,8 @@ net FeedHold xor2.0.out => motion.feed-hold
178178
net CHLSwitched xor2.2.out => and2.1.in1
179179
net ArcOKTimer oneshot.2.out => xor2.1.in0
180180
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
181-
net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
182-
net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
181+
net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
182+
net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
183183
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
184184
net TorchOff not.2.out => flipflop.1.reset
185185
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1

‎configs/by_interface/mesa/hm2-modbus/bldc_and_wavebox.mbccs‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@
2828
<command device="dummy" function="W_COIL" address="0x0000" noanswer="1"><data value="0xff00" /></command>
2929
</initlist>
3030
<commands> <!-- Command function sequences and HAL pin assignments -->
31-
<command device="bldc" function="R_REGISTERS" address="0x0020" modbustype="U_AB" haltype="S32" scale="1">
31+
<command device="bldc" function="R_REGISTERS" address="0x0020" modbustype="U_AB" haltype="SINT" scale="1">
3232
<pin name="rtpwm"/>
3333
<pin name="rtcurrent"/>
3434
<pin name="comfreq" modbustype="S_AB"/>
3535
<pin skip="1" />
3636
<pin name="rtpos" modbustype="S_ABCD" scale="0"/>
3737
</command>
3838
<!-- Gives us the following pins:
39-
- hm2_modbus.0.bldc.rtpwm (out, s32) (range [0..65535])
40-
- hm2_modbus.0.bldc.rtpwm.offset (in, u64)
41-
- hm2_modbus.0.bldc.rtpwm.scale (in, float) (must be set to 0.1)
42-
- hm2_modbus.0.bldc.rtpwm.scaled (out, float)
43-
- hm2_modbus.0.bldc.rtcurrent (out, s32) (range [0..65535])
44-
- hm2_modbus.0.bldc.rtcurrent.offset (in, u64)
45-
- hm2_modbus.0.bldc.rtcurrent.scale (in, float) (must be set to 0.01)
46-
- hm2_modbus.0.bldc.rtcurrent.scaled (out, float)
47-
- hm2_modbus.0.bldc.comfreq (out, s32) (range [-32768..+32767])
48-
- hm2_modbus.0.bldc.comfreq.offset (in, s64)
49-
- hm2_modbus.0.bldc.comfreq.scale (in, float) (must be set to 0.1)
50-
- hm2_modbus.0.bldc.comfreq.scaled (out, float)
51-
- hm2_modbus.0.bldc.rtpos (out, s32) (range [-2147483648..+2147483647])
39+
- hm2_modbus.0.bldc.rtpwm (out, sint) (range [0..65535])
40+
- hm2_modbus.0.bldc.rtpwm.offset (in, uint)
41+
- hm2_modbus.0.bldc.rtpwm.scale (in, real) (must be set to 0.1)
42+
- hm2_modbus.0.bldc.rtpwm.scaled (out, real)
43+
- hm2_modbus.0.bldc.rtcurrent (out, sint) (range [0..65535])
44+
- hm2_modbus.0.bldc.rtcurrent.offset (in, uint)
45+
- hm2_modbus.0.bldc.rtcurrent.scale (in, real) (must be set to 0.01)
46+
- hm2_modbus.0.bldc.rtcurrent.scaled (out, real)
47+
- hm2_modbus.0.bldc.comfreq (out, sint) (range [-32768..+32767])
48+
- hm2_modbus.0.bldc.comfreq.offset (in, sint)
49+
- hm2_modbus.0.bldc.comfreq.scale (in, real) (must be set to 0.1)
50+
- hm2_modbus.0.bldc.comfreq.scaled (out, real)
51+
- hm2_modbus.0.bldc.rtpos (out, sint) (range [-2147483648..+2147483647])
5252
5353
The start will be suspended (see top). The .scale pins will be set in
5454
the hal-file. Offset pins are automatically initialized to zero.
@@ -58,9 +58,9 @@
5858
<command device="wavebox" function="R_INPUTS" address="0x0000" count="8" name="switch" />
5959
<!-- Gives us the following pins:
6060
- Eight switch inputs on the box are HAL output pins
61-
* hm2_modbus.0.wavebox.switch-00 (out, HAL_BIT)
61+
* hm2_modbus.0.wavebox.switch-00 (out, HAL_BOOL)
6262
* ...
63-
* hm2_modbus.0.wavebox.switch-07 (out, HAL_BIT)
63+
* hm2_modbus.0.wavebox.switch-07 (out, HAL_BOOL)
6464
-->
6565

6666
<!--
@@ -74,9 +74,9 @@
7474
<command device="wavebox" function="W_COILS" address="0x0000" count="8" name="relay" />
7575
<!-- Gives us the following pins:
7676
- Eight relay outputs on the box are HAL input pins
77-
* hm2_modbus.0.wavebox.relay-00 (in, HAL_BIT)
77+
* hm2_modbus.0.wavebox.relay-00 (in, HAL_BOOL)
7878
* ...
79-
* hm2_modbus.0.wavebox.relay-07 (in, HAL_BIT)
79+
* hm2_modbus.0.wavebox.relay-07 (in, HAL_BOOL)
8080
-->
8181
</commands>
8282
</mesamodbus>

‎configs/by_interface/mesa/hm2-modbus/brushless-dc-motor-driver.mbccs‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@
3636
<command device="dummy" function="W_COIL" address="0x0000" noanswer="1"><data value="0xff00" /></command>
3737
</initlist>
3838
<commands> <!-- Command function sequences and HAL pin assignments -->
39-
<command device="bldc" function="R_REGISTERS" address="0x0020" modbustype="U_AB" haltype="S32" scale="1">
39+
<command device="bldc" function="R_REGISTERS" address="0x0020" modbustype="U_AB" haltype="SINT" scale="1">
4040
<pin name="rtpwm"/>
4141
<pin name="rtcurrent"/>
4242
<pin name="comfreq" modbustype="S_AB"/>
4343
<pin skip="1" />
4444
<pin name="rtpos" modbustype="S_ABCD" scale="0"/>
4545
</command>
4646
<!-- Gives us the following pins:
47-
- hm2_modbus.0.bldc.rtpwm (out, s32) (range [0..65535])
48-
- hm2_modbus.0.bldc.rtpwm.offset (in, u64)
49-
- hm2_modbus.0.bldc.rtpwm.scale (in, float) (must be set to 0.1)
50-
- hm2_modbus.0.bldc.rtpwm.scaled (out, float)
51-
- hm2_modbus.0.bldc.rtcurrent (out, s32) (range [0..65535])
52-
- hm2_modbus.0.bldc.rtcurrent.offset (in, u64)
53-
- hm2_modbus.0.bldc.rtcurrent.scale (in, float) (must be set to 0.01)
54-
- hm2_modbus.0.bldc.rtcurrent.scaled (out, float)
55-
- hm2_modbus.0.bldc.comfreq (out, s32) (range [-32768..+32767])
56-
- hm2_modbus.0.bldc.comfreq.offset (in, s64)
57-
- hm2_modbus.0.bldc.comfreq.scale (in, float) (must be set to 0.1)
58-
- hm2_modbus.0.bldc.comfreq.scaled (out, float)
59-
- hm2_modbus.0.bldc.rtpos (out, s32) (range [-2147483648..+2147483647])
47+
- hm2_modbus.0.bldc.rtpwm (out, sint) (range [0..65535])
48+
- hm2_modbus.0.bldc.rtpwm.offset (in, uint)
49+
- hm2_modbus.0.bldc.rtpwm.scale (in, real) (must be set to 0.1)
50+
- hm2_modbus.0.bldc.rtpwm.scaled (out, real)
51+
- hm2_modbus.0.bldc.rtcurrent (out, sint) (range [0..65535])
52+
- hm2_modbus.0.bldc.rtcurrent.offset (in, uint)
53+
- hm2_modbus.0.bldc.rtcurrent.scale (in, real) (must be set to 0.01)
54+
- hm2_modbus.0.bldc.rtcurrent.scaled (out, real)
55+
- hm2_modbus.0.bldc.comfreq (out, sint) (range [-32768..+32767])
56+
- hm2_modbus.0.bldc.comfreq.offset (in, sint)
57+
- hm2_modbus.0.bldc.comfreq.scale (in, real) (must be set to 0.1)
58+
- hm2_modbus.0.bldc.comfreq.scaled (out, real)
59+
- hm2_modbus.0.bldc.rtpos (out, sint) (range [-2147483648..+2147483647])
6060
6161
The start will be suspended (see top). The .scale pins will be set in
6262
the hal-file. Offset pins are automatically initialized to zero.

‎configs/by_interface/mesa/hm2-modbus/rs485io.mbccs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<initlist>
77
</initlist>
88
<commands>
9-
<command device="rs485io" address="0x1000" function="R_REGISTERS" modbustype="U_ABCD" haltype="HAL_U32" name="potu" count="2" />
10-
<command device="rs485io" address="0x2000" function="R_REGISTERS" modbustype="S_ABCD" haltype="HAL_S32" name="pots" count="2" />
11-
<command device="rs485io" address="0x3000" function="R_REGISTERS" modbustype="F_ABCD" haltype="HAL_FLOAT" name="potf" count="2" />
12-
<command device="rs485io" address="0x4000" function="R_REGISTERS" modbustype="F_HGFEDCBA" haltype="HAL_FLOAT" name="potd" count="1" />
9+
<command device="rs485io" address="0x1000" function="R_REGISTERS" modbustype="U_ABCD" haltype="UINT" name="potu" count="2" />
10+
<command device="rs485io" address="0x2000" function="R_REGISTERS" modbustype="S_ABCD" haltype="SINT" name="pots" count="2" />
11+
<command device="rs485io" address="0x3000" function="R_REGISTERS" modbustype="F_ABCD" haltype="REAL" name="potf" count="2" />
12+
<command device="rs485io" address="0x4000" function="R_REGISTERS" modbustype="F_HGFEDCBA" haltype="REAL" name="potd" count="1" />
1313
<command device="rs485io" address="0x0000" function="R_INPUTS" name="button" count="4" />
1414
<command device="rs485io" address="0x0000" function="W_COILS" name="led" count="6" />
1515
</commands>

‎configs/by_interface/parport/plasma-thc-sim/thc.hal‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ loadrt or2 count=10
1919
loadrt scale
2020
loadrt sum2 count=5
2121
loadrt xor2 count=4
22-
loadrt conv_s32_float
22+
loadrt conv_sint_real
2323
loadrt edge count=2
2424

2525
# Attach realtime hal components to a realtime thread
@@ -35,7 +35,7 @@ addf and2.8 servo-thread
3535
addf comp.0 servo-thread
3636
addf comp.1 servo-thread
3737
addf comp.2 servo-thread
38-
addf conv-s32-float.0 servo-thread
38+
addf conv-sint-real.0 servo-thread
3939
addf edge.0 servo-thread
4040
addf edge.1 servo-thread
4141
addf flipflop.0 servo-thread
@@ -186,8 +186,8 @@ net FeedHold xor2.0.out => motion.feed-hold
186186
net CHLSwitched xor2.2.out => and2.1.in1
187187
net ArcOKTimer oneshot.2.out => xor2.1.in0
188188
net PierceLatch flipflop.1.out => mux2.0.sel oneshot.0.in
189-
net IgnitionCounterS32 updown.0.count => conv-s32-float.0.in
190-
net IgnitionCounterFloat conv-s32-float.0.out => comp.2.in1
189+
net IgnitionCounterS32 updown.0.count => conv-sint-real.0.in
190+
net IgnitionCounterFloat conv-sint-real.0.out => comp.2.in1
191191
net IgnitionTimerOff oneshot.1.out-not => updown.0.countup
192192
net TorchOff not.2.out => flipflop.1.reset
193193
net TorchTurnedOffOrTimeout or2.7.out => or2.6.in1

‎configs/by_interface/pico/univpwmv/univpwm_load.hal‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ loadrt not count=1
3030
loadrt estop_latch count=1
3131
loadrt and2 count=1
3232
loadrt or2 count=1
33-
loadrt conv_s32_float count=1
33+
loadrt conv_sint_real count=1
3434
loadrt mult2 count=2
3535
loadrt lowpass count=1
3636

@@ -50,7 +50,7 @@ addf pid.2.do-pid-calcs servo-thread
5050
addf pid.3.do-pid-calcs servo-thread
5151
# for spindle
5252
addf or2.0 servo-thread
53-
addf conv-s32-float.0 servo-thread
53+
addf conv-sint-real.0 servo-thread
5454
addf mult2.0 servo-thread
5555
addf mult2.1 servo-thread
5656
addf lowpass.0 servo-thread

‎configs/by_interface/pico/univpwmv/univpwm_motion.hal‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ linksp SpindleRev => or2.0.in1
9292
linkps or2.0.out => spindle-enable
9393
linksp spindle-enable ppmc.0.pwm.03.enable
9494
# spindle speed display
95-
net spinraw ppmc.0.encoder.03.delta conv-s32-float.0.in
96-
net spinfloat conv-s32-float.0.out mult2.0.in0
95+
net spinraw ppmc.0.encoder.03.delta conv-sint-real.0.in
96+
net spinfloat conv-sint-real.0.out mult2.0.in0
9797
setp mult2.0.in1 8.6805555
9898
newsig SpindleRPM real
9999
linkps mult2.0.out => SpindleRPM

0 commit comments

Comments
 (0)