Conversation
Contributor
Author
|
Forgot to note: Any hm2_modbus communication mbccb files need to be recompiled from the mbccs source with mesambccc. The file version was increased because of the HAL type changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the long awaited HAL API break. The main update is that all 32-bit HAL pins/params/signals are gone and everything is now 64-bit with backing storage access completely opaque with the previous getter/setter update.
This PR does not include the docs. The PR is already large enough without having to go filter the docs while reviewing. The docs will follow in the next PR and is also quite a large patch set.
If you wonder about the HAL type name change... It was done to make a clean break. It is a clear sign that "from this point on we have a new HAL interface".
What changed:
HAL_{S32,U32}have been removed. All places where they were used have been updated to use the new abstractHAL_{SINT,UINT}.HAL_{BIT,FLOAT,S64,U64}have been renamed toHAL_{BOOL,REAL,SINT,UINT}. Using any old types will result in a deprecation compiler warning.hal_data_u,hal_{bit,float,s32,u32,s64,u64}_t,real_tandireal_thave been removed. There is no longer direct access to the underlying data. The new HAL types arehal_{bool,real,sint,uint,port}_trequire you to use the getter/setter interface.hal_pin_dir_tandhal_param_dir_thave been unified intohal_pdir_t. The code has been updated and using the old types will result in a deprecation warning. They must be removed at a (slightly) later stage.HAL_PORTinterface has been changed to use the same interface as the other new HAL types to make the API as consistent as possible.hal_pin_XXX_new()andhal_param_XXX_new()have been removed. These were already replaced byhal_pin_new_YYYY()andhal_param_new_YYYY()hal_param_set*()and the value retrieval functionshal_get_{pin,param.signal}_value_by_name()have been removed. The query API has already replaced these in the previous updates to HAL.use_fpflag in functions and threads has been removed. It was already deprecated and fixed to true. The RTAPI has been updated as well.hal.hheader now has a version defineHAL_API_VERSIONand is set to1. It is now possible to track further changes in the API by inspecting this define to make user's code adapt more easily to future changes.tests/halmodule/comp-set-getandtests/mux). If it is required to test wrapping, then the tests may be altered at a later stage.abs_s32andabs_s64have been folded intoabs_sintconv_XXXX_YYYYhave all been removed and replaced by the new name versions{bool,real,sint,uint}.demux_genericandmux_generichave been updated to handle any-to-any conversion for the new types. The pins that included the old names were also renamed.scaled_s32_sumsgot renamed toscaled_sint_sums.si32andui32pins/params upgraded tosintanduint. However, there are still many components that need to be made 64-bit clean. This is a larger effort that will follow after integration of the PR. The[su]i32types do create the correct[su]inttyped pins and access through the getter/setter interface. The type marker is present as a reminder that they need updating. However, you cannot change thehal_[gs]et_[su]i32()getters/setters without properly inspecting the code where it is used. Every use needs to be inspected and traced to prevent intermediate variable truncation problems.s32oru32name is used in variables or pin/param/signal names. Not all can be changed easily while others may be replaced. Renaming must be a process that can be done after integrating these changes.halcmdandhalrmtnow issue a warning when the old HAL types are used. Printing/output data all uses the new types.halshowwill properly show the new typeshal.Type.XXXXandhal.Dir.YYY. All code has been updated to use the new types.HAL_XXXnames will result in a deprecation warning. The old 32-bit versions will map to the new types.pyvcpnow uses tagssint,uint,image_boolandimage_uint. The old tags{s32,u32,image_u32,image_bit}are still recognized for compatibility. All in-tree xml files have been updated. The old names are still recognized but will emit a deprecation warning (only once for each type).pyuipanelui now recognize{BOOL,REAL,SINT,UINT}as output type names. All in-tree examples have been updated. The old names are still recognized but will emit a deprecation warning (only once for each type).The changes have been successfully tested on a RPi5+Mesa-7I96S+Modbus.
If you can, you should pull this branch (https://github.com/BsAtHome/linuxcnc/tree/hal64_break-hal-api-nodocs) from my repo and test on your machine/hardware and report back. Not that problems are expected, but testing this is necessary.