Trampolines not supported - Help needed please!

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bear with me - I'm an occasional programmer - .. plenty of cutting and pasting from working projects when it works, great - when it doesn't it's a pain.

I've NEVER come across this INTERNAL compiler error before and it occurs when I use my timer routine which uses function pointers.

I've been using this function/method for ages and it works fine with a MEGA168 and others .. but I've just ported to a MEGA32 and the compilation fails.

Here's the call which causes the error:

setup_timer (timer_no,time_value,calledfunction,callingparam );

Here's the Definition:

void setup_timer (unsigned char,unsigned short, void(*)(unsigned int),unsigned int);

The function stores the data in a table and starts a timer.
A timer function is then regularly called and uses the data to execute the function when the timer expires.

I'm stuck for a solution unless somebody can assist or give some clues.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And the error message is?

Are you by any chance using nested functions? (You can't do that in avr-gcc).

This looks strange:

void(*)(unsigned int)

And lastly a minor terminology thing:

Quote:
Here's the Definition:

Actually, that is a declaration. A definition requires a function body. (A prototype/function header is a declaration. An implementation is a definition.)

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Begs yer pardon ...

Declaration indeed ..

The error message was ' Trampolines not supported' as per the message title.

Declarations I find tricky - what with the function calls etc. That was from an old project - used many times and works.

However, I'm happy to be told the correct declatarion for my function. ..

Interestingly enough .. I have a mega32 project that worked with it.. then cutting it down and editing in an attempt to make it the same as the required project - eventually the error returned.

So, clearly there's somethign in the whole code structure which the compiler hates .. incidentally - it does message with somethign like 'make a bug report', so I guess the compiler is loosing it somewhere.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In a java group that I used to follow they would often ask you to provide an SSCCE. Some things in that article are not necessarily applicable to other languages/C/embedded/etc. But in general it summarizes pretty well what people should normally do when reporting a problem or asking for help.

Eugene