Pages: [1]   Go Down
Author Topic: compiler snafu: twi.c compiles. wire.c no-scope twi_init()  (Read 642 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, world.

I'm building a distributed robotic control system using a 2560 as central control and an array of UNO 328p as stepper controllers with the 2560<->328p talking over twi.

I'm using AVRStudio4 with Project Options compiler set to WinAVR-20100110 avr-c++.exe and linker make.exe.  This setup works for a the 2560 code.  Both the 2560 and 328p have the same Project Options (except for target cpu)...same include files paths, same compilation options.

The problem occurs when I compile the 328p code.  After a make clean, the compile sequence halts at wire.cpp, which can't 'see' twi_init.  This occurs _after_ twi.c compiles.  Actual error message:

../../libraries/Wire/Wire.cpp:60: error: 'twi_init' was not declared in this scope

Suggestions?  Thanks!

--Xnloder
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm using AVRStudio4
Do you have the same issue in the Arduino IDE?
Logged

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

there are _many_ twi.h files in my system.  Using default compiler includes <> means the compiler picks whichever of these it finds first.  Apparently the one it found didn't work. 

This bug was fixed by changing the #include to contain explicit directory information.
Logged

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

The problem does not occur using the IDE.  But then you don't know what is happening 'under the hood', don't get map files, aren't able to do the stuff you came to Arduino to do...IDE is great to begin with, but is not a tool for real development. 

On the other hand, it works, so maybe it is a real tool.
Logged

Pages: [1]   Go Up
Jump to: