Is volatile needed when variable is only read during interrupt
问题 The C standard states that the volatile keyword should be used in the definition of a variable when there's a chance that the variable's value could change outside the normal flow of execution of the program. If a global variable is changed (written) during normal execution flow and only read outside this normal flow (in an interrupt). Does this variable need to be volatile ? And why ? 回答1: If a global variable is changed (written) during normal execution flow and only read outside this