[En-Nut-Discussion] Bit banging drivers broken?

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Fri Oct 5 15:35:31 CEST 2012


>>>>> "Harald" == Harald Kipp <harald.kipp at egnite.de> writes:

    Harald> Hi Uwe, On 04.10.2012 19:15, Uwe Bonnes wrote:

    >> Okay, you got me. I cared for AVR and STM, but not the rest. How to
    >> proceed?  I think the NutGpio Api has clear advantage so reverting
    >> would be a step back.

    Harald> I fully agree.

    >> And adding #if isn't appelling too. But I don't feel like I can
    >> complete the NutGpio functions for all architecture. So perhaps split
    >> off the old file before my change with a similar name, but some
    >> addition to mark it as transitory.

    Harald> Wouldn't it be safer to do it the other way round, selecting a
    Harald> new name for the new functions and upgrade and test existing
    Harald> drivers one by one?

There are no new function in e.g. sbi_gpio.h. Only the way the functions are
implemented are different, as they rely on a more complete NutGpio API and
get rid of a lot of architecture/board specific things that tend to not work
for your setup.

And inventing a new name is hard, should it be e.g. sbi_newgpio.h? So
perhaps lets make in the nut/dev directory a subdirectory incomplete_gpio
and move the old files there. Every occurancy of the driver in the
configurator is changed form <driver_name.c> to
incomplete_gpio/<driver_name.c>. If an architecture now implments the
complete NutGpio Api, we change back incomplete_gpio/<driver_name.c> to
<driver_name.c>.

It could be implemented the other way round, but implementors then will
probaly find <driver_name.c> with the architecture/board specific cruft
first and oversee the clearer new implementation.

    Harald> Please note, that other developers (like me) have existing
    Harald> applications, which will break.

I don't see where such a setup breaks applications.

Bye
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the En-Nut-Discussion mailing list