Go Down

Topic: Modifying wiring.c / Custom wiring.c (Read 1 time) previous topic - next topic


I am using the Arduino toolset on my own custom designed target board. I would like to make changes to the wiring.c file to support my board but still be able to use the toolset with my standard Arduino boards.

It seems like wiring.c is a universal resource in common with all boards. What is the generally accepted way of using my own custom wiring.c file for my board ? In other words use a custom wiring.c with my board and the standard wiring.c with everything else ?

I am programming my board directly through the ICSP interface thus I am not using the standard bootloader. So I have added an entry in the boards.txt file and that all works fine.  I just can't figure out the wiring.c part.

Many Thanks,


I have been poking around some more and it looks to me like you can use 'add file' to add your own local copy of wiring.c and it will get included in the build. Then function calls will get resolved locally. Seems to work pretty well although I have to experiment with it a little more.


Spoke to soon, sure you can drop a copy of wiring.c into your sketch but then during the link process you get a bunch of duplicate references. So the original wiring.c is still included in the make :(

So I still can't figure out how to do this.  I suppose I could hack the makefile.... if I could find it !!! It's built into the sketch somewhere.


I suppose I could hack the makefile.... if I could find it !!!

The Makefile isn't used by the IDE. The commands used to build the sketch are hard-coded into the IDE.



Apr 03, 2009, 12:26 pm Last Edit: Apr 03, 2009, 02:16 pm by jcw Reason: 1
The Illuminato by liquidware has an example of how to set up a separate area for alternative code bases. See this page:
Whoops, silly me, I meant this page:
(@mem thanks)

You need to pick a new name and create a copy of the "arduino" folder in hardware/cores/, and twiddle the "boards.txt" file a bit to add a new environment. Then you can make changes to that copy as much as you like and switch to either as needed by selecting the proper board.

Haven't tried this myself. The seeeduino sanguino probably also does something like this.


jcw, I don't think that pde link is what you intended to post.

Yes, the sanguino distribution does illustrate how to add support for a new board.


Very Slick !

Works like a charm,  I had already added a new section to the boards.txt file so all I had to do was make a copy of the arduino directory under hardware/cores and rename it to my board name and then update the build.core directive in my section of the  boards.txt file.

Thanks !

Go Up