[En-Nut-Discussion] Disabling drivers during compile time

Thiago A. Corrêa thiago.correa at gmail.com
Mon Oct 7 17:09:09 CEST 2013


      In all of Nut/OS, we are constantly comming up with bogus driver
settings just to satisfy the build. Stuff there were not in the board
.conf file or selected by the user in the configurator but needs to
end up in one of the cfg headers.

      I'm considering using macros to disable the compilation of
drivers that don't have all necessary config information, something
along the lines of:

<settings macro handling here>


<driver code goes here>

This would expand to something like:

#ifndef NUT_DRIVER_hd44780_DISABLED

<driver code>

#warning "Driver hd44780 is disabled"

       What do you think? Does anyone have a better idea?
       I don't think it's pretty, but it's less ugly than what we have
been doing IMHO :)

Kind Regards,
     Thiago A. Correa

More information about the En-Nut-Discussion mailing list