The unsigned integer question #4526
grandixximo
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
@rene-dev about the signed and unsigned integer use, these are what I found.
encoder.N.counts => joint.N.jog-counts(s32 to s32): every MPG pendant configuration. In-tree alone: woodpecker mpg.hal, touchy, shuttle, xhc-hb04, and pico pendant.hal (rawcounts via ilowpass, s32 throughout). Motion's jog protocol is an exact per-cycle count delta (control.c:1066).iocontrol.0.tool-prep-number: axis_manualtoolchange.hal is pulled in by 50 in-tree inis, and smithy/924.hal nets it into classicladder s32 word logic on shipped commercial machines.Unsigned: hm2_modbus (in 2.9) maps raw device registers to pins, including 64-bit unsigned compounds (
hal_pin_u64_newf, plus a u64.offsettare doing modulo-2^64 subtraction). A totalizer register above 2^53 loses bits on a float pin; the range [2^63, 2^64) reads negative on s64. The pin is the user-facing register image, so "keep it driver-internal" does not apply.Bit patterns: hm2
raw.write-dataand bitwise (u32 pins), plus lut5 (stepconf generatessetp lut5.0.function 0x10000, a u32 param). On an integer pin, NaN and 2.5 are unrepresentable; todaysetp <int-pin> nanis rejected whilesetp <float-pin> nansucceeds, and(int32_t)NaNis 0x80000000 straight into an FPGA register. No driver checks isnan; the type is the guard.All reactions