Hi William

William wrote:

> Thank you. I've put the SPI module up there, so we'll see how it
> goes.

I have currently no use for it, but out of curiosity I browsed your 
library and it looks OK to me! I'm sure Jallib users will appreciate 
your contribution.

Nevertheless a comment on programming style. To my opinion 'var v' in
procedure _spi_init_mode00() could be eliminated, the bits / subfields 
of registers can be accessed individually.

> procedure _spi_init_mode00() is
>    SSPCON = 0
>    SSPSTAT_SMP = 0
>    SSPSTAT_CKE = 1
>    SSPCON_SSPM = 2      -- CKP=0, Master mode, OSC/64
>    SSPCON_SSPEN = 1
> end procedure

Don't you agree this is better readable (and more 'elegant')? Keep in 
mind that libraries might have to be maintained later by others.
Note: I couldn't check if it (still) works! And maybe some more comments 
explaining why might be useful.


I think JSG does not enforce it, but all libraries (should) have at 
least one sample program to show its use and to prove that it works. 
Could you provide a sample program?  It is also used to check if library 
and sample compile without errors or warnings.


> Next up is a CAN module for the external MCP2515 controller.  It is
> an SPI slave, but I figure it should go under 'external', in a new
> directory named 'can' ?

In general: when a library uses a peripheral module of the PIC it should 
go into directory peripheral.  The external library is for external 
devices which are controlled 'directly' (without the use of any special 
module of the PIC).

Regards.

-- 
Rob Hamerling, Vianen, NL (http://www.robh.nl/)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to