Andes Workshop

It is currently Thu Mar 28, 2024 10:41 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: How to Use C's volatile Keyword
PostPosted: Tue Nov 26, 2013 4:18 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
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


Top
 Profile Send private message E-mail  
 
 Post subject: Re: How to Use C's volatile Keyword
PostPosted: Mon Dec 16, 2013 12:35 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
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.


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group