Pages: [1]   Go Down
Author Topic: Modifying wiring.c / Custom wiring.c  (Read 782 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
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,
Steve
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

New Zealand
Offline Offline
God Member
*****
Karma: 0
Posts: 999
Arduino pebbles
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

--Phil.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 40
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The Illuminato by liquidware has an example of how to set up a separate area for alternative code bases. See this page:
    http://jeefiles.equi4.com/muxshield.pde
Whoops, silly me, I meant this page:
    http://www.liquidware.com/wikipages/name/Illuminato_Installation
(@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.
« Last Edit: April 03, 2009, 07:16:37 am by jcw » Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: