This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Wallclock device driver structure?


Grant Edwards wrote:
> 
> I'm looking into writing a driver for a Dallas DS1511W RTC and
> I've noticed that the other Dallas drivers are done in two
> different ways: one is a C++ file that's compiled and linked,
> and the other is an ".inl" file that is apparently included by
> the wallclock wrapper functions.
> 
> Is there any reason to prefer one method over the other?

The C++ files are used when the driver is completely board specific. The
.inl files are used when trying to write a generic driver, i.e. a driver
that can be instantiated slightly differently on different platforms.

Ideally most drivers would start off as "generic" just in case that chipset
is reused, but that doesn't often happen. Jesper is our hero for stepping
up to do this type of stuff normally.

If you are intending to contribute this back, base it off the .inl style,
with a generic package, and a separate instantiation. If your doing it
purely for yourself, you'll probably find the .cxx version a little
simpler, although not that much frankly.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]