Skip to content

refactor(hm2): drop _64 encoder pins, keep 64-bit internal#3944

Open
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:narrow-option-1-encoder
Open

refactor(hm2): drop _64 encoder pins, keep 64-bit internal#3944
grandixximo wants to merge 1 commit into
LinuxCNC:masterfrom
grandixximo:narrow-option-1-encoder

Conversation

@grandixximo
Copy link
Copy Markdown
Contributor

RFC #3286 narrow option 1: fix float position wrap on high-count encoders via 64-bit internal counters, without exposing new HAL pin types. s32 count/rawcounts/rawlatch/ count-latched remain as truncated views of the internal 64-bit counters. Float position is computed from the full 64-bit value so it does not wrap.

Avoids committing four integer pin types (s32/u32/s64/u64) into 2.10 ABI before the getter/setter direction in #3286 is decided. The overflow fix from 8a3ac3f is preserved; only the pin exposure is reverted. Unused
prev_event_rawcounts_64 dropped.

BREAKING CHANGE: count_64, rawcounts_64, rawlatch_64 and count-latched_64 pins added post-2.9 are removed. HAL surface matches 2.9.

Refs #3286 #2331

@rmu75
Copy link
Copy Markdown
Collaborator

rmu75 commented Apr 17, 2026

sounds like this should be application of #3936

@grandixximo
Copy link
Copy Markdown
Contributor Author

sounds like this should be application of #3936

Easy enough to rebase this on #3936 if that lands first

RFC LinuxCNC#3286 narrow option 1: fix float position wrap on
high-count encoders via 64-bit internal counters, without
exposing new HAL pin types. s32 count/rawcounts/rawlatch/
count-latched remain as truncated views of the internal
64-bit counters. Float position is computed from the full
64-bit value so it does not wrap.

Avoids committing four integer pin types (s32/u32/s64/u64)
into 2.10 ABI before the getter/setter direction in LinuxCNC#3286
is decided. The overflow fix from 8a3ac3f is preserved;
only the pin exposure is reverted. Unused
prev_event_rawcounts_64 dropped.

BREAKING CHANGE: count_64, rawcounts_64, rawlatch_64 and
count-latched_64 pins added post-2.9 are removed. HAL
surface matches 2.9.

Refs LinuxCNC#3286 LinuxCNC#2331
@grandixximo grandixximo force-pushed the narrow-option-1-encoder branch 2 times, most recently from 3eae1ef to 2a0b291 Compare April 27, 2026 03:10
@grandixximo grandixximo marked this pull request as ready for review May 10, 2026 11:00
@grandixximo
Copy link
Copy Markdown
Contributor Author

@pcw-mesa please have a look at this, the _64 bit pins will be deprecated eventually, this is IMO the correct stop gap, till getter/setter is ready, see #3286

@pcw-mesa
Copy link
Copy Markdown
Collaborator

It this a step on the way to moving all 32 bit hal ints to 64 bit?

So dropping back to 32 bits temporarily?

@grandixximo
Copy link
Copy Markdown
Contributor Author

Yes, but the encoder 64bit should work if you connect to the 32bit pin, it is just the 32bit count view that is truncated, position will be correct, it's a stop gap to the getter setter discussed on #3286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants