bit-fields
Posted: Mon Aug 22, 2016 3:28 pm
I am porting an old project to an xmos device. The old devices configuration was stored in a bit field that is sent to another processor on startup. I would like to keep the bit-fields as they are (so I can recycle some of the old code and do not need additional processing when sending or receiving data when communicating with previous versions), but simply copying the structs from the old project leads to compilation errors:
What is correct and how do I define a bit field without compiler complaints?
I read that bit-fields are not supported in xC, what would be an explanation. Howerver, the XS1 Data types the manual says../src\Modem.h:23:37: error: parse error before ':' token
unsigned int uiTestsignalType : 5;
while this document saysThe types char, short and int may be specified in a bit-field’s declaration.
but then again i remember seeing MKMSK (or something similar) in ASM files, what seems to be well suited for bit fields.XC does not support floating point, long long arithmetic, structure bit-fields [..]
What is correct and how do I define a bit field without compiler complaints?