Andes Workshop
http://forum.andestech.com/

How to Use C's volatile Keyword
http://forum.andestech.com/viewtopic.php?f=25&t=757
Page 1 of 1

Author:  cindy [ Tue Nov 26, 2013 4:18 pm ]
Post subject:  How to Use C's volatile Keyword

There are several articles to explain how to use C's volatile keyword.

How to Use C's volatile Keyword
http://www.barrgroup.com/Embedded-Syste ... le-Keyword

Chinese articles:

【C語言內"volatile"的用法和功用】
http://blog.xuite.net/jackie.xie/bluelove/8189028

簡介C語言volatile關鍵字及其陷阱
http://adrianhuang.blogspot.tw/2011/08/cvolatile.html

Author:  cindy [ Mon Dec 16, 2013 12:35 pm ]
Post subject:  Re: How to Use C's volatile Keyword

Proper use of volatile

A variable should be declared volatile whenever its value could change unexpectedly. In practice, only three types of variables could change:

1. Memory-mapped peripheral registers

2. Global variables modified by an interrupt service routine

3. Global variables accessed by multiple tasks within a multi-threaded application

We'll talk about each of these cases in the sections that follow.

Source: http://www.barrgroup.com/Embedded-Syste ... le-Keyword
There are examples in the page.

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/