Skip to content

hal: Update the remaining user component VFDs to getter/setter - #4319

Merged
grandixximo merged 1 commit into
LinuxCNC:masterfrom
BsAtHome:halgs_vfd-user-comps
Aug 2, 2026
Merged

hal: Update the remaining user component VFDs to getter/setter#4319
grandixximo merged 1 commit into
LinuxCNC:masterfrom
BsAtHome:halgs_vfd-user-comps

Conversation

@BsAtHome

@BsAtHome BsAtHome commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

These are the remaining VFD user components. They are not especially complex, but they do have many lines changed.

Unfortunately, you need to have the hardware and modbus setup to test these VFD drivers. Not something many of us have at hand. So, we need to have some eyes on the code to see if anything got missed.

Note, a lot of the content is badly indented. A few places were corrected (like parts of the hal structs), but most of it needs to be done another time. Altering too much will just confuse the blame and make tracking any potential problems hard. So, mostly left as is.

@grandixximo grandixximo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through all four components and built the branch clean. I also ran the binaries with --help and exercised a minimal repro for the handle-vs-value cases below.

There are three places where a HAL handle is tested directly instead of the pin value. hal_bool_t is an opaque pointer into shared memory; after a successful hal_pin_new_bool it is always non-NULL, so if (!handle) is always false and if (handle) is always true, regardless of the pin state. These need hal_get_bool().

The rest looks like the expected mechanical migration. I agree with leaving the existing indentation alone; reindenting now would only pollute the blame.

Comment thread src/hal/user_comps/vfdb_vfd/vfdb_vfd.c Outdated
Comment thread src/hal/user_comps/vfs11_vfd/vfs11_vfd.c Outdated
Comment thread src/hal/user_comps/vfdb_vfd/vfdb_vfd.c Outdated
Comment thread src/hal/user_comps/vfs11_vfd/vfs11_vfd.c Outdated
@BsAtHome
BsAtHome force-pushed the halgs_vfd-user-comps branch from 3dc0571 to 0154223 Compare August 2, 2026 09:25
@grandixximo
grandixximo merged commit a74d308 into LinuxCNC:master Aug 2, 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