Friday, 9 August 2013

Defining a bit, but without a name?

Defining a bit, but without a name?

So I have some code for the iodefine of my board. I see a lot of these in
structs. What exactly is it doing? Is it just a placeholder for the last 4
bits? Why doesn't it cause a compiler error and what is it used for?
union {
unsigned char BYTE;
struct {
unsigned char OVRF:1;
unsigned char IDLNF:1;
unsigned char MODF:1;
unsigned char PERF:1;
unsigned char :4; <------------
} BIT;
} SPSR;
I hope thats not too many questions, I just found this very interesting.

No comments:

Post a Comment