On 04/25/2020 01:24 PM, Jon Elson wrote:
On 04/25/2020 11:52 AM, andy pugh wrote:
So, swapping "long" for "int32_t" should make it work
like it used to.
Actually, it has to be hal_s32_t.
The next question is whether you would prefer to store
counts as 64
bits to be sure that nobody wraps an encoder while this
universe
exists.
(the other encoder counters all use 64 bit accumulators)
Yes, this is a good thought. But, since the current
version exports a signed 32-bit
raw count, changing this to 64 would make the change
visible outside the driver.
I'm not sure if anybody is actually using the exported raw
encoder counts, though,
so it might NOT make any difference.
Then, of course, I'd have to test it on a 32-bit system,
as well.
Well, there doesn't seem to be a hal type for signed 64 bit
integer! That seems to make what
I'm trying to do impossible, unless I missed it (meaning
that the full 64-bit signed integer raw count
would be exported as a hal pin (mostly for me to test the
thing!))
I did figure out a way to update the extended bits easily.
instead of dealing with the extended
40-bit field as some separate entity, I just address the
long form (64-bit) of the union
like this : pos.l += 16777216;
Jon
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers