Quantcast
Channel: Tools
Viewing all articles
Browse latest Browse all 91781

Forum Post: RE: Compile/Link time initialization of union

$
0
0

[quote user="Jamie McPeek"]

The compiler in use is CL2000 for TMS320F28335 version 6.1.0.

I can't change the compile flags/pull in non-standard extensions.

I'll take a look at flipping the order of the member declarations in the union.

If that can't be touched for various reasons, is there a way to initialize the bit field directly without using explicit initialization?

[/quote]

In this case, I suppose the only option is a tedious field-per-field initialization list: The compiler should merge it in only one word, compilation time calculated initialization value:

GlobalBlock = {   { first_bitfiled_value, second_bitfield_value, ....},  //A   { ....}, //B   ... }; 

You can use a macro to build the initialization list, but this works only if all the fields are 1 btis size.


Viewing all articles
Browse latest Browse all 91781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>