avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Syntax: Function pointer hell... newbee lost ! ;-)


From: Vincent Trouilliez
Subject: Re: [avr-gcc-list] Syntax: Function pointer hell... newbee lost ! ;-)
Date: Tue, 20 Jan 2009 00:54:35 +0100

On Mon, 19 Jan 2009 23:35:26 +0100
Georg-Johann Lay <address@hidden> wrote:

> >     int f_call;
> >     f_call = fptr;  //load the function via the pointer
> 
> Just call it:
>       fptr(); //call function indirect

Oh thanks, it works now ! :-)
So I had only that part wrong, the declaration and initialisation of
the pointer were correct then, better than nothing ;-)

> Here, you have to do integer arithmetic, so cast the pointer to an int 
> and conpute on (unsigned) integer level.

Thanks again, that did the trick, it now displays the pointer content
on the LCD just fine. It reports 0x01BC when the map file says 0x0378.
But 1BC times 2 makes 378 so...
I am still not quite clear why the map file reports Flash adresses
twice that of what the memory pointer of the AVR chip actually holds
physically ?


--
Vince




reply via email to

[Prev in Thread] Current Thread [Next in Thread]