I am using the SPI to access a couple of 20 & 24 bit A/D converters which have some digital status bits preceding the reading. I already have some C code written (for another CPU) that defines the incoming data structure as a unsigned long. The Keil compiler, however, says I must use char or integer size bit fields. Is there an easy way around this without having to hand code the byte manipulation code manually?
ISO C says the bit fields must support up to size of int, not long. On 32-bit platforms they are usually one in the same. C51 implements int's as 16-bits so that's as big as your bit-fields can be. Sorry. - Mark