Hi Andy,
On 2/9/21 9:35 PM, andy pugh wrote:
On Tue, 9 Feb 2021 at 13:28, Thomas J Powderly <[email protected]> wrote:
loadrt hal_pi_gpio pi_pins={,,,}{,,,}{,,,}
each 'quad' consists of braces enclosed data
I think that the modparam handling struggles with embedded commas
inside a single element.
I would suggest:
loadrt hal_gpio config=12or0,1i,23i,...
compared to...
loadrt hal_gpio config={03,>,0,Y}(05,>,0,Y}
wellm I can pick out each pin description easily
and < and > are handy for in and out
the stilted format is dumb but works
I have no problem with the commas or braces
its all hardcoded cp += sizeof(blah)
ie, don't force the format too hard, but work on leading numbers
leading numbers?
specify a header number,
I use pin header numbers, thats the first 2 chars inside the left brace
the user talks about number he has in his hands ( not wiring pi or gpio
or BCM numbers)
other code letters (in any order) modify the
behaviour.
the user can input the 'quads' in any order
CAVEAT: i do take the last definition found for a pin though,
so a whole page of quads redefining the same pin only makes one pin (
with the last quad)
Maybe R for reset high and r for reset low?
hmm thats 2 ideas in 1 char... idea 1= I want a reset pin and idea 2
= the value i want it to reset to
the current scheme allows seperation of the 2 ideas
so the pin can have an 'initial' value but not neccesarily have a reset
function
IF the pin has the reset feature then the 'initial' value becomes the
value AFTER the reset too.
The user may want an intial conditon without having the reset feature.
I'm thinking devices that need a high or low when first powered on.
FWIW a parser like this exists in mux_generic.
https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/mux_generic.c#L105
(note how each successive digit multiples the current number
(initially 0) by 10, and adds the new value, so 1, 01, 001 all mean 1)
uhm, i can look at it, ( thats several days usually ;-)
because i first re indent it
then comment it a lot
then write several test pgms trying the ideas found...
( I have several commented drivers here now, esp the very hairy
hal_parport, did you see the size of that structure?)
I think the existing parsing is really minimal because it is so strict
( my notes reiterate my old ideas of "user-hostile interfaces" (TM tjp))
BTW i have invert pins working now
Thx Andy
TomP
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers