U
userblue
Hi
Does anyone know if there is a way to define what is effectively a
single globally visible, enumerated list whilst actually defining the
entries across several different modules?
or somehow do a similar thing with macros.
Details:
I have a c project to fit into a small microprocessor and need to save
some ram. I have a significant number of flags all over the place that
currently use whole byte storage. I thought if I had a way to define a
list of numerically sequential flag names, I could assign a single
chunk of ram and a simple function to access the relevant flags as
single bits. I need to be able to define the different flag names
within their relevent modules because some modules may be removed at
compile time using pre-processor directives.
This code is subject to continuous updating and I just can't find a
bomb proof way of ensuring the values are unique and sequential with no
gaps.
Any ideas?
Thanks
Cliff
Does anyone know if there is a way to define what is effectively a
single globally visible, enumerated list whilst actually defining the
entries across several different modules?
or somehow do a similar thing with macros.
Details:
I have a c project to fit into a small microprocessor and need to save
some ram. I have a significant number of flags all over the place that
currently use whole byte storage. I thought if I had a way to define a
list of numerically sequential flag names, I could assign a single
chunk of ram and a simple function to access the relevant flags as
single bits. I need to be able to define the different flag names
within their relevent modules because some modules may be removed at
compile time using pre-processor directives.
This code is subject to continuous updating and I just can't find a
bomb proof way of ensuring the values are unique and sequential with no
gaps.
Any ideas?
Thanks
Cliff