View Single Post
  #6   Spotlight this post!  
Unread 23-01-2008, 17:54
ericand's Avatar
ericand ericand is offline
Registered User
AKA: Eric Anderson
FRC #3765 (Terrabots)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: St. Paul, MN
Posts: 148
ericand is a jewel in the roughericand is a jewel in the roughericand is a jewel in the rough
Re: Second clock/timer causes red light of death

I think volatile is correct in this context. It tells the compiler that it needs to read the memory every time it accesses a particular variable (not use a register cached value), since the variable may change outside of the compiler's ability to predict or controll. In this instance, the variable might be updated by your interrupt service routine.