I'm sorry for the delay, but I'm finally taking a look at this and
trying to fix the problems you noted.

Link to my original changes:
http://cvs.linuxcnc.org/cvs/emc2/src/hal/drivers/mesa-hostmot2/encoder.c.diff?r1=1.2;r2=1.3

 
You questioned this change
+    hm2->encoder.stride = md->register_stride;
     hm2->encoder.clock_frequency = md->clock_freq;
     hm2->encoder.version = md->version;

saying 
> The register stride is global to the hm2 instance, there's no need for 
> the encoder to make a private copy.

why are clock_freq and version different?  What's the proper way to
access register_stride the read function when I need to update the
control register?



About my removal of the second 'kfree' error case, if I decide to keep
the control_reg read part of the tram read, I don't need the kmalloc'd
storage for it, and I don't need the two error exits, right?

> I'm not sure reading the latch register belongs in the TRAM.  Stuff in 
> the TRAM gets read in each call to the HAL read() function, whether 
> latch is enabled or not.  It might be better to put it as a conditional 
> llio read in a new function hm2_encoder_read(), called from the bottom 
> of hm2_read() like hm2_raw_read() is.

For now I am going to leave it this way; I think that a substantial
fraction of encoder users are using index--anyone with a lathe is, and
anyone running an axis with an encoder would benefit from using home to
index.

Jeff

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to