Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Jump from variable

2006-02-23 by marko.panger@siol.net

Hi,

Define a function pointer:
STATUS (*ptrghigh_fxn)(uint8 evt, void *parg1, void *parg2); /* Pointer to the trigger function */

Initi it:
ptrghigh_fxn = &TriggerFxn;

Call it:
ptrghigh_fxn(1,2,3);

----------------------------------------------------------
Function:
STATUS TriggerFxn(uint8 ucEvent, void *pArg1, void *pArg2) {
   /* do something */
}

Hope it helps,
marko

---- Marko Pavlin <mp@...> piše: 
> How can I call function where address is in pointer? Something like this:
> 
> 
> void test1(void){
>    puts("blah");
> }
> 
> 
> void *exec;
> 
> void main(void) {
>     exec = (void *)test1;
>     __asm
>     {
>     	BL 		exec
>     }
> 
> ...
> 
> It's out of context. There will be more pointers and *exec can be constant:
> const void *exec = (void *)test1;
> 
> 
> Thanks!
> 
> Marko
> 
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.