[an error occurred while processing this directive]
|
Забудь про номера бит и работай только с именами
file ---------- *.h
#define SET 1
#define CLR 0
typedef union {
unsigned int word;
struct {
unsigned int terminal_mode : 1,
console_mode : 1,
echo_mode : 1;
};
} cons_stat;
file ----------- *.c
cons_stat console_status;
В программе:
console_status.word = 0; //Очистка всей структуры
console_status.echo_mode = SET; // Установка одного бита
if(console_status.terminal_mode == SET) // Проверка одного бита
ну и т.д.
Только так.