Modifying board.c

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Modifying board.c

Post by steved »

I have a board where board.c needs to differ from the auto-generated template using board.chcfg.
The differences include using a #define to disable GPIO setup, for example. Also adding a couple of board-specific routines.

Is there a way to achieve this within the existing structure? (I realise I can just clone the board.c and board.h files into my project, but that makes things harder to maintain, since the same board is used on several projects).
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Modifying board.c

Post by Giovanni »

You could create a template file for your modified boards then launch FMPP manually in order to generate, freemarker is not hard to learn. There is a launch script in the boards directory that rebuilds everything, you could take the launch code from in there.

Giovanni
Post Reply