Книга: Advanced PIC Microcontroller Projects in C

3.1.12 Volatile Variables

3.1.12 Volatile Variables

Volatile variables are especially important in interrupt-based programs and input-output routines. Using the keyword volatile indicates that the value of the variable may change during the lifetime of the program independent of the normal flow of the program. Variables declared as volatile are not optimized by the compiler, since their values can change unexpectedly. In the following example, variable Led is declared as a volatile unsigned char:

volatile unsigned char Led;

Оглавление книги


Генерация: 0.034. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз