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 CCS Technical Support

When does write_eeprom() return? [SOLVED]

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



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

When does write_eeprom() return? [SOLVED]
PostPosted: Thu Oct 26, 2017 2:50 pm     Reply with quote

Stupid question, but compiler's help reference is a little unclear to me. Does the write_eeprom() function return immediately, which means that the actual (slow) write to the PIC's internal EEPROM will complete at some point in the future, or does write_eeprom() block until the write has completed (several ms later)?

Last edited by newguy on Thu Oct 26, 2017 3:16 pm; edited 1 time in total
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Oct 26, 2017 3:00 pm     Reply with quote

Easiest way to figure out is cut a small program,compile and dump the listing....
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Thu Oct 26, 2017 3:17 pm     Reply with quote

You're right - that was easy.

For anyone curious, it blocks until the write is complete.
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Oct 26, 2017 4:05 pm     Reply with quote

That would be my 'assumption' but after 'assuming' my forklift wouldn't get stuck in 2 inches of mud and that the distributor cap of my tractor was fine.....I'm DONE with assuming things.....after 6 hrs of blood, sweat and tears I'm only left with a silly PC using W7 that doesn't wakep to wiggling mouse...I should have stayed with XP...

Some days it doesn't pay to get out of bed....

Glad you took the time and SAW what was going on....first hand knowledge is powerful.

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Fri Oct 27, 2017 12:43 pm     Reply with quote

#device WRITE_EEPROM=ASYNC

Will set it to not wait. Instead it'll test at the start of the write that the EEPROM is not busy writing.
By default it waits to complete as you have found.
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