Академический Документы
Профессиональный Документы
Культура Документы
--------Which of the following items should generally be declared using C's volatile key
word?
Choose one
A memory-mapped peripheral status register
A global variable used within an interrupt service routine
A global variable used by multiple tasks in a multi-threaded application
*
All of the above
---------Which of the following code snippets can be used to reset the least-significant
bit of x?
Choose one
x & 0x01;
x & ~0x01;
x | ~0x01;
*
x &= ~0x01;
--------Which ANSI C compilers allow a variable to be declared both volatile and const?
Choose one
*
All ANSI C compilers allow this
No ANSI C compilers allow this; it is a K&R C holdover
Most ANSI C compilers allow this
Only the GNU C compiler allows this
----------Which of the following is a correct way to write the value 0xAA55 to physical me
mory address 0x67A9?
Choose one
uint16_t * p = (uint16_t *) 0x67A9; p = 0xAA55;
uint16_t * p = (uint16_t *) 0xAA55; p = 0x67A9;
*
* (uint16_t * const) (0x67A9) = 0xAA55;
* (uint16_t * const) (0xAA55) = 0x67A9;