Stephen Wille Padnos wrote:
> Sebastian Kuzminsky wrote:
>> It should be something like this:
>>
>>      loadrt hm2_5i20 config="firmware=SVST8_4.BIT num_stepgens=2"
>>  
>>
> Hmmm.
> 
> These variables really should be split out into separate parameters, 
> using arrays where practical.  It's kind of silly to do your own string 
> parsing when there are facilities to do it for you already.  The 
> firmware option still needs to be a string of course, but anything else 
> that's an int of some sort should be done with the existing parameter 
> parsing mechanism.
> 
> Doing this will change the module loading syntax, but if you have no 
> objection, I'll make those changes and commit them in the next few days 
> (along with changes to any sample configs).
> 
> I think it would end up something like this:
> loadrt hm2_5i20 firmware="unchanged" num_stepgens=0,2 num_pwmgens=4 ...
> 
> In that example, there are two boards, the first gets 0 stepgens and 4 
> pwmgens.  The second gets 2 stepgens and 0 pwmgens.  All other settings 
> are left at default.

I agree what's there now is a bit silly...  I considered doing it like 
you suggest, but decided against it.  The reason why is that the config 
info get told to the llio drivers but handled (exclusively) by the 
generic hostmot2 driver.  These things get passed to hm2_register() by 
the llio init functions.  Having a single argument seems simpler and 
more flexible than having five (currently) different ones, and changing 
all the llios whenever the set of config parameters changes.  The llios 
dont know and they dont care, and i like that.

My plan is to eventually add a field to the config parameter like 
"stepgen=on,off,on:width=2", which would mean: enable stepgen.00, 
disable stepgen.01, and enable stepgen.02 and make it just 2 bits wide 
(instead of the default 6).  Similar for pwmgen and encoder.


-- 
Sebastian Kuzminsky
       Theo: "Julian? I haven't seen you in twenty years. You look good.
              The picture the police have of you doesn't do you justice."
     Julian: "What do the police know about justice?"

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to