CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

WRITE_EEPROM=ASYNC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
iukhan



Joined: 21 Oct 2013
Posts: 4

View user's profile Send private message

WRITE_EEPROM=ASYNC
PostPosted: Sat Mar 22, 2014 1:23 am     Reply with quote

I am a little bit confused about the warning about using #device WRITE_EEPROM=ASYNC, from the CCS manual:

Quote:

WRITE_EEPROM=ASYNC

Prevents WRITE_EEPROM from hanging while writing is taking place. When used, do not write to EEPROM from both ISR and outside ISR.


Here what does it means outside ISR? To my understanding if ISR is the interrupt service routine than outside ISR mean the all the remaining routines excluding ISR. That means that I cannot write any where in my code. Which of course cannot be true. Please help.
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Sat Mar 22, 2014 8:45 am     Reply with quote

You are correct - it simply means do not have routines to write to the eeprom in both the main code and the ISR (since with Murphy's law in force, while you are writing to the eeprom in your main code, the ISR will go off and try to write to the eeprom as well). Either only write to the eeprom in the ISR, or better, only write to the eeprom in your main code. Set a flag in the ISR telling the main code to update the eeprom or whatever your needs are. The thing you need to prevent is the possibility of one write taking place and having a second one start while the first one has not completed.

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
Ttelmah



Joined: 11 Mar 2010
Posts: 19432

View user's profile Send private message

PostPosted: Sat Mar 22, 2014 10:46 am     Reply with quote

Keyword in the sentence is 'both'. Either in one or the other, but not both.
iukhan



Joined: 21 Oct 2013
Posts: 4

View user's profile Send private message

PostPosted: Sun Mar 23, 2014 1:42 am     Reply with quote

Got it. Thanks
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group