halconf.h, mcuconf.h, HALCONF

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
nikiwaibel
Posts: 22
Joined: Sat Mar 17, 2018 2:51 pm
Has thanked: 4 times
Been thanked: 12 times

halconf.h, mcuconf.h, HALCONF

Postby nikiwaibel » Sat Mar 17, 2018 3:33 pm

hi, i am new here. hope i chose the right section.

halconf.h includes mcuconf.h. the contents of halconf.h (all those "#if !defined()") indicate that all changes can be / should be made in mcuconf.h.

this works correct until it comes to os/hal/ports/*/*/platform.mk.
HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h | egrep -e "\#define"))
quite efficient to bring settings from header files to makefiles, but breaks setting (some) things in mcuconf.h (to keep halconf.h as it is) :shock:

i bet, settings things in mcuconf.h works for all non-HAL_USE_* defines.

i don't have a solution (gcc -E may help in some way), but i'd like to mention this. a comment in the header file would make things clear.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: halconf.h, mcuconf.h, HALCONF

Postby Giovanni » Sat Mar 17, 2018 4:20 pm

Hi,

Changes to portable HAL settings have to be done in halconf.h, mcuconf.h is for non-portable settings. Note that there is a copy of xxxconf.h files in each project, those are meant to be edited.

The "#if !defined" are there in case you want to override a setting from the Makefile, in that case you need also to disable the "smart build".

"gcc -e" would work too.

Giovanni


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 14 guests