[En-Nut-Discussion] Configuration: Is there something like a "forced" macro?

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Wed Oct 3 23:37:54 CEST 2012


Hello,

I miss a functionality in the configurator: 
Write out a macro name "XXX" if some requirement is fullfilled,
even if "XXX" is _not_ defined in the conf file.

E.g. I think something like
    --
    -- Board Initialization
    --
    {
        name = "nutarch_avr_bs",
        brief = "Board Support",
        sources =
            function()
                return {
        "avr/board/"..string.lower(c_macro_edit("PLATFORM"))..".c" };
            end,
        requires = { "HW_BOARD_SUPPORT" },
        option =
        {
           forced_macro = "HW_BOARD_HEADER",
           requires = { "HW_BOARD_SUPPORT" },
            value = function()
                return {
                "<arch/avr/board/"..string.lower(c_macro_edit("PLATFORM"))..".h>" };
           file = "include/cfg/arch.h"
        },
    },
(please excuse any syntactic errors)

and the include/cfg/arch.h would contain for platform "XXX"
<arch/avr/board/xxx.h>

dev/board.h could do
#if defined(HW_BOARD_HEADER)
#include HW_BOARD_HEADER
#endif

instead of our long and growing list of conditional includes.

It would help too with defining a chip. For a STM Chip we have in the config
file

LDSCRIPT = "stm32f405xG_flash"
MCU_STM32F405 = ""
MCU_STM32 = "1"
STM32F4xx = ""
MCU_STM32F4XX = "1024"

If I have 
CHIP = STM32F405xG 
and such forced macros, all other needed values could be derived.

Do others see the usefullness? Anybody willing to implement or to give hints
how to implement. Any other thoughts?

Thanks 

-- 
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