Show Posts
Pages: 1 [2] 3 4 ... 6
16  Forum 2005-2010 (read only) / Troubleshooting / Re: undefined references and static keyword on: May 19, 2008, 06:53:28 am
mmm i'll try later, thanks!
17  Forum 2005-2010 (read only) / Troubleshooting / Re: undefined references and static keyword on: May 19, 2008, 06:13:31 am
no, updateSystemLED() is a function out of the class. I'm just declaring an Alarm object as static.

The problem happened on two different linux distros so it must be something with the avr compiler i think.

If I declare the same object without "static", it just works. But i need to declare it static for what i need.

[mem] can you try it with the Servo library for example?

void example() {
   static Servo s;
}

If it won't happen, may be it's related to my Alarm library. I'm now at work and can't try it right now.
18  Forum 2005-2010 (read only) / Troubleshooting / undefined references and static keyword on: May 19, 2008, 05:00:38 am
Hi, i'm just curious about this error:

o: In function `updateSystemLED()':
undefined reference to `__cxa_guard_acquire'

void updateSystemLED() {
  static Alarm x;
}

If i drop the static keyword, it works. This only happens when i declare static a selfmade class object, it will work with int, char, and so on.

Do you know why?
19  Forum 2005-2010 (read only) / Troubleshooting / Re: Problem with buzzer + flex sensor on: May 09, 2008, 03:38:42 am
how are you interfacing the flex sensors?

check my draw on flex sensor:


in my case, i get values within this range: 700-850.
20  Forum 2005-2010 (read only) / Troubleshooting / Re: Including libs inside other libs on: October 01, 2007, 08:19:32 am
my solution right now is including Servo.h both in my library and my sketch.
that way, it'll compile
21  Forum 2005-2010 (read only) / Troubleshooting / Including libs inside other libs on: September 30, 2007, 03:14:31 pm
Hi again, i'm trying to include the library "Servo.h" in one of my libraries, but the compilation fail with:

lib/targets/libraries/ServoController/ServoController.h:12:19: Servo.h: No such file or directory

How can i include it? (the best way)

thanks!
22  Forum 2005-2010 (read only) / Troubleshooting / Re: Problems with va_start, va_end, and so on on: September 26, 2007, 05:32:16 pm
oops i got it, the problem goes out if i comment the for code.

va_start and va_end compile fine, something happens with the for.

edit:

ok, it's the va_arg function. without it all compile nicely.
23  Forum 2005-2010 (read only) / Troubleshooting / Re: Problems with va_start, va_end, and so on on: September 26, 2007, 05:27:09 pm
thanks for your quick responses, it's of great help to know it smiley
24  Forum 2005-2010 (read only) / Troubleshooting / Re: Problems with va_start, va_end, and so on on: September 26, 2007, 03:13:30 pm
Quote
The va_... functions aren't really supported in Arduino - sometimes we do some magic behind the scenes, but I don't know we want to document it for standard use.

and what about using "calloc"?

anything avr-gcc can compile will work in arduino?
25  Forum 2005-2010 (read only) / Troubleshooting / Problems with va_start, va_end, and so on on: September 26, 2007, 02:14:00 pm
Hi again,

i'm having problems with functions without an exact number of parameters. This is my code:

Code:
byte *add_position(const char *fmt, ...) {
    va_list ap;
    int size, index;
    byte *posarray;
    
    size = get_fmt_size(fmt);
    posarray = (byte *)calloc(size, 1);
    
    va_start(ap, fmt);
    for(index=0; index<size; index++) {
        posarray[index] = va_arg(ap, byte);
    }
    va_end(ap);
    
    return posarray;
}

You can see that I use calloc and va_xxx family of functions. I really didn't know i could use them since i saw on Matrix.cpp shipped with arduino distribution. What are all the libraries i can use with arduino? Is it documented?

My problem is compiling that code, it gives the following message:

Code:
In function `byte* add_position(const char*, ...)':
note: if this code is reached, the program will abort

and "va_start(ap, fmt);" is highlighted.

What's the problem?
26  Forum 2005-2010 (read only) / Troubleshooting / Re: Who did the Gentoo tutorial? on: September 23, 2007, 11:48:18 am
i use gentoo too!
27  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: arduino svn compile bug on: April 19, 2008, 05:46:37 am
ok, i got it working my default 0011 installation.
All i did was downloading arduino-svn and compiling with the -F param patch.
Then copied pde.jar to my 0011 lib directory and that's all.

 ;D
28  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: arduino svn compile bug on: April 18, 2008, 12:33:57 pm
ahh it would be great, i can't get arduino-0012 working, but only 0009.
I'll try this guide tonight and let's see.
29  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: LCD Library on: May 15, 2008, 05:43:56 am
will this work with serial-enabled LCDs?
30  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: Clarifying millis() function call from an ISR on: May 12, 2008, 07:07:41 am
thats interesting, so millis() can be partially used in some sketchs  smiley
Pages: 1 [2] 3 4 ... 6