Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: Anyone using Emacs with the CEDET package for project management? on: April 16, 2012, 06:23:17 am
Arduino support for CEDET is really new, as in I posted the first stable CEDET release with it included yesterday, so I'll guess I'm one of a very few people using it at the moment.

I have the Arduino 1.0 package installed for ubuntu, and had work a few shenannagans to make it happen.  My version is 1:1.0+dfsg-6.

The basic doc for the arduino support is here:

http://www.randomsample.de/cedetdocs/common/cedet/Arduino-Features.html

The error you see is from loading a version number from this file:

/usr/share/arduino/lib/version.txt

and it is expecting something like "1.0", which is needed so it can create the right kind of Makefile.

I suppose a simple solution would be to edit version.txt to "fix" the version.txt file.  Personally, it would be helpful to me if you could join the CEDET mailing list and work through how to get a reliable version number with me there so we can fix this for everyone.

Eric
2  Development / Suggestions for the Arduino Project / Patch for Arduino.mk to support errors pointing to the .ino file on: March 25, 2012, 11:48:45 am
Hi,

  I'm programming my arduino with Emacs, and using the Arduino.mk that came with the install on my Linux box (version 1.0).  A distraction is that errors from the .ino file show up pointing at the temporary cpp file.  For example, errors point at build-cli/Blink.cpp instead Blink.ino.  My patch adds a #line compile directive so that Blink.cpp reports errors from the  ino file.  The output now looks like this and is parsable by Emacs:

make
echo '#include <Arduino.h>' > build-cli/Blink.cpp
echo '#line 1 "Blink.ino"' >> build-cli/Blink.cpp
cat  Blink.ino >> build-cli/Blink.cpp
/usr/bin/avr-g++ -MM -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard  -g -Os -w -Wall -ffunction-sections -fdata-sections -fno-exceptions build-cli/Blink.cpp -MF build-cli/Blink.d -MT build-cli/Blink.o
cat build-cli/Blink.d > build-cli/depends.mk
/usr/bin/avr-g++ -c -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard  -g -Os -w -Wall -ffunction-sections -fdata-sections -fno-exceptions build-cli/Blink.cpp -o build-cli/Blink.o
Blink.ino: In function ‘void loop()’:
Blink.ino:24:3: error: ‘moose’ was not declared in this scope
Blink.ino:29:1: error: expected ‘;’ before ‘}’ token
make: *** [build-cli/Blink.o] Error 1


This was accomplished by adjusting 2 rules in Arduino.mk like this:


Code:
# the pde -> cpp -> o file
$(OBJDIR)/%.cpp: %.pde
$(ECHO) '#include "WProgram.h"' > $@
$(ECHO) '#line 1 "$<"' >> $@
$(CAT)  $< >> $@

# the ino -> cpp -> o file
$(OBJDIR)/%.cpp: %.ino
$(ECHO) '#include <Arduino.h>' > $@
$(ECHO) '#line 1 "$<"' >> $@
$(CAT)  $< >> $@

My side project lately has been automating the compilation of sketches via Emacs using the defaults tools in the Arduino development install such as the default Arduino.mk.   Here is a link to that corner of the doc for my project: http://www.randomsample.de/cedetdocs/common/cedet/Arduino-Features.html
Pages: [1]