[an error occurred while processing this directive]
|
union {
char byte;
struct {
unsigned S1:1; // RD0 = S1
unsigned S2:1; // RD1 = S2
unsigned S3:1; // RD2 = S3
unsigned :5; // RD3...RD7
} bits;
} KeyStat; // Key statusОбращение к элементам объединения:
KeyStat.byte = 0x11;
KeyStat.bits.S2 = 1;Можно ещё #define поиграться, сократить длину обращения
E-mail: info@telesys.ru