Topic : How to get nice access to data stored in code?

Forum : 8051

Original Post
Post Information Post
July 18, 2008 - 10:00pm
Guest

Hi,

Some data is stored in code space to be accessed as a structure with:

typedef struct {
        ......
} TmyStructureType;

code TmyStructureType myCodeData = {......}
My project compiles with the NOGENERIC pragma.

How can I make some function return a generic or non-generic (preferred) pointer to my data in code space?

below code....

TmyStructureType* myGetCodeDataPointer(void){

        return &myCodeData;

}

...generates a "XDATA/CODE different mspace" error

how can I solve this?

thanks

Henk

Replies
Post Information Post
+1
0
-1
July 19, 2008 - 9:32am
Guest

Hi,

well let me aswer myself... ;-)

just put the keyword 'generic' in front like:

generic TstuImgDta* pImgGetPcbDataPointer(void){ thanks for listening anyway

Henk