R
Rich
Suppose the following:
typedef void (*funcptrs)(void);
typedef struct {
unsigned int *in;
unsigned int *out;
unsigned int *overrun;
funcptrs myptrs[1]; /* >=1 for ansi */
} yada;
Is it possible to write a #define in which I can vary the storage array
size? What I mean is suppose you had:
mystruc(10, name)
mystruc(20, name)
and a #define mystruc(A,B) ...
The A would set the size of the myptrs array and the B would be the name of
the declared structure. Perhaps a union might allow the define to create
the appropriate size array? The issues is that for the hardware I'm
targeting the unsigned int *s will be 2 bytes (point to RAM) and the void
(*)(void) will be 3 bytes (point to code space in flash). If they were
both two bytes it would be easier (at least for me!). Any good ideas on
this?
Thanks
PS: I cross posted this to the moderated forum inadvertantly...sorry!
typedef void (*funcptrs)(void);
typedef struct {
unsigned int *in;
unsigned int *out;
unsigned int *overrun;
funcptrs myptrs[1]; /* >=1 for ansi */
} yada;
Is it possible to write a #define in which I can vary the storage array
size? What I mean is suppose you had:
mystruc(10, name)
mystruc(20, name)
and a #define mystruc(A,B) ...
The A would set the size of the myptrs array and the B would be the name of
the declared structure. Perhaps a union might allow the define to create
the appropriate size array? The issues is that for the hardware I'm
targeting the unsigned int *s will be 2 bytes (point to RAM) and the void
(*)(void) will be 3 bytes (point to code space in flash). If they were
both two bytes it would be easier (at least for me!). Any good ideas on
this?
Thanks
PS: I cross posted this to the moderated forum inadvertantly...sorry!