Hi,
> The main diff between the pic18fXX and pic18fXXX are that those with 4
> number have ADCON0-2 while those with 3 number only have ADCON0-1 to
> control the ad channels. Sadly even thos with 4 numbers differ in their
> way to configure the ad parts of the chip.
I am not sure whether adding special cases for each device/device class
is a good idea. This will easily become unmaintainable, I fear.
If the devices differed only inthe number of ADCs, one could add
something like
#define HASADCON0 1
#undef HASADCON1
to the device headers, provide copies of the adc routines for all
classes and select the correct one from additional defines from within
the device headers, a la
#define adc_close adc_close2
where adc_close2 is the current adc_close() referencing ADCON0...
However, if the configuration requirements change even within a device
category, many more defines are required to accomodate for that...
Unfortunately I am not really familiar with ADC on even one of the pic16
devices to be able to estimate the effort required; any proposals are
welcome.
@Vangelis: Shall I commit the patch (see previous mail in this thread)?
> Is it possible to add possible to add a warning in the #else path when
> using a function which is not directly programmed for the give chip?
A preprocessor construct like
#warning my message
should do the trick, but this will trigger a warning only when the
library is built, not when the user builds his/her program... The latter
would require the #warning to reside in at least one ADC header file
(which is doubtlessly a viable option).
Regards,
Raphael
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user