[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] Table of function pointers
From: |
Guy Robinson |
Subject: |
[avr-gcc-list] Table of function pointers |
Date: |
Thu, 3 May 2001 09:43:24 +1200 |
Hi,
Can anyone explain what this error means? See source below. I can't see what
I'm doing wrong. Thanks in advance for your help.
Guy
hx_2313.c:37: declaration of `FunctionTable' as array of functions
hx_2313.c:37: Tree check: expected class 't', have 'x' (error_mark)
confused by earlier errors, bailing out
D:\AVRGCC\BIN\MAKE.EXE: *** [hx_2313.o] Error 1
#include <io.h>
#include <progmem.h>
#define pint int __attribute__ ((progmem))
void function0();
void function1();
pint *FunctionTable[2]() = {function0,function1};
char a,b,index;
void function0(){
a =b;
}
void function1(){
b =a;
}
void main(void){
PRG_RDB(FunctionTable[index]()); // call function from table at index
index++;
}
- [avr-gcc-list] Table of function pointers,
Guy Robinson <=