On 10/29/25 12:33, andy pugh wrote:
On Wed, 29 Oct 2025 at 17:00, Jon Elson <[email protected]> wrote:
Yes, this is what I'm concerned about. How does a negative
signed 32-bit value get converted to 64-bit? There are
32-bit encoder counts
There won't be when I have finished.
At least not inside LinuxCNC drivers.
There may be 32-bit input sources, but I am not aware of any. ppmc
appears to sign-extend 24 bits to 32. That will be expanded to 64.
There are 16-bit input sources (Modbus and Smart-serial for example)
but those are already sign-extended (and in many cases are _already_
internally 64-bit)
Specifically in my ppmc encoder driver section, I remember
some fancy footwork looking at the sign of the 24-bit values
and the sign and next bit of the 32-bit extension, to decide
when a rollover is required. This took some hard thinking
and testing to get right.
Jon
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers