ESkopal / USB-Power-Gauge

Code for the Adafruit USB Power Gauge mini kit
http://www.adafruit.com/products/1549
3 stars 1 forks source link

Problems compiling #1

Closed asmagill closed 9 years ago

asmagill commented 9 years ago

Just recently got this little device and want to see about making it more accurate with higher powered devices, and came across your pull...

Compiling this I get the following:

In file included from /Applications/Development/Electronics/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:29:0,
                 from /Applications/Development/Electronics/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:26,
                 from /Applications/Development/Electronics/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Stream.h:26,
                 from /var/folders/t1/98d__2cx6j3d1b3zws9n2csw0000gn/T/build3861436463000155196.tmp/sketch/TimerSerial.h:5,
                 from adafruit_usbpowergauge.ino:87:
/Applications/Development/Electronics/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:38:74: error: __c causes a section type conflict with __c
 #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
                                                                          ^
adafruit_usbpowergauge.ino:277:12: note: in expansion of macro 'F'
/Applications/Development/Electronics/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/WString.h:38:74: note: '__c' was declared here
 #define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))
                                                                          ^
adafruit_usbpowergauge.ino:491:12: note: in expansion of macro 'F'
Error compiling.

Now I should note that I'm running Mac OSX 10.11 Beta 3, Arduino 1.6.6 Build 2015/28/08 with ATTiny support from https://github.com/damellis/attiny/tree/ide-1.6.x, so there are a whole lot of places for me to look, but I thought I'd just check to see if you're still watching this and ask what specific environment you were using when you last compiled this code. I'll be able to try this under Linux with Arduino IDE (1.6.4 or 5 I think... definitely not the latest at any rate) in a couple of days, but on the off chance you have any thoughts...

Thanks!

asmagill commented 9 years ago

NVM... when I actually got around to reading the source code comments, I saw that you redefine PROGMEM for use with avr-gcc... Haven't worked with that yet myself, but commenting out your #define seems to have worked for now.

ESkopal commented 9 years ago

I haven't looked at this in quite awhile. I am glad you were able to get it to work and that it is useful for you.