How would that work when you need to match a pin type with an external data structure? eg. An ethercat 16 bit long pin or a gpio structure Sometimes pins are manipulated as bit maps.
You really need to consult widely on that Rod Webster *1300 896 832* +61 435 765 611 Vehicle Modifications Network www.vehiclemods.net.au On Wed, 11 Oct 2023 at 19:10, andy pugh <bodge...@gmail.com> wrote: > General chat at the Stuttgart meetup drifted onto the subject of HAL > pin types, and a suggestion that all pins could be of type "double" > and it would still work. This may actually what the STMBL does.) > > A double can exactly represent signed integers up to 43 bits, so this > would actually be an improvement on the HAL version in 2.9 > > master currently has S64 and U64 types added, and a set of conversion > functions to suit. This means that there are a total of 7 HAL pin > types (bit, float, S32 U32, S64, U64, port) and 42(?) conversion > functions. > > My proposal, based on further discussion in Stuttgart is to replace > _all_ integer types with Signed-64. This would very much simplify > many HAL configs which are currently liberally scattered with > conv_NN_NN components. The choice of S32 or U32 in many components > appears to be based purely on the whim of the original coder. > > I anticipate this happening in a couple of steps, over a couple of > LInuxCNC major versions. > > Step 1 is simply to map all the integer hal_pin_new*_*() functions > in HAL to hal_pin_new*_S64() and to replace the integer conv_NN_NN > functions with a simple pass-through. > I think that this would be entirely transparent and would not affect > the function of custom HAL components "out in the wild" > > The task of converting the built-in HAL components could then proceed > piecemeal as the opportunity occurred. (for example increasing the > width that is processed in "bitwise") > > The other integer types and conversion functions would, at this stage, > just be marked as deprecated. > > There is the possibility of making the required HAL changes in the > update_ini script, though it might be non-trivial to get right (And > the changes _should_ be unnecessary) > > Apart from a simplification of HAL, this also addresses > https://github.com/LinuxCNC/linuxcnc/issues/2331 > > -- > atp > "A motorcycle is a bicycle with a pandemonium attachment and is > designed for the especial use of mechanical geniuses, daredevils and > lunatics." > — George Fitch, Atlanta Constitution Newspaper, 1912 > > > _______________________________________________ > Emc-developers mailing list > Emc-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/emc-developers > _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers