Skip to content

hal: Update first batch of C components to use getter/setter - #4310

Merged
grandixximo merged 1 commit into
LinuxCNC:masterfrom
BsAtHome:halgs_components-simple-4
Aug 1, 2026
Merged

hal: Update first batch of C components to use getter/setter#4310
grandixximo merged 1 commit into
LinuxCNC:masterfrom
BsAtHome:halgs_components-simple-4

Conversation

@BsAtHome

Copy link
Copy Markdown
Contributor

These are the first batch of components converted to getter/setter that are partly or in whole written C. There is nothing really wild in the conversion.

Several places have had old hal types replaced with the proper rtapi types. The hal types were being abused as normal variable types, making things unnecessarily slow.

There are several places that could have been optimized or streamlined. Some places it was improved, other places it was not. A future sweep across all components should review them anyway and then can be improved.

The debounce.c component has a possible define to export the state variable as a parameter. It was opted to use the preprocessor to select a hal type or a normal type and add access-functions to wrap read/write to the state. Normally, the EXPORT_STATE is undefined and using a normal variable is faster. Otherwise it would have been unnecessarily slower going though the volatility of hal types.

Comment thread src/hal/components/counter.c
@grandixximo
grandixximo merged commit 50feac1 into LinuxCNC:master Aug 1, 2026
16 checks passed
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.

2 participants