CVS: libraries/mspgcc flash_erase_segment.c, 1.3, 1.4

Chris Liechti <[email protected]> Wed, 07 Nov 2007 18:36:53 -0800
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.cvs
Message-ID <[email protected]>
Update of /cvsroot/mspgcc/libraries/mspgcc
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1420/libraries/mspgcc

Modified Files:
	flash_erase_segment.c 
Log Message:
fix if called from RAM

Index: flash_erase_segment.c
===================================================================
RCS file: /cvsroot/mspgcc/libraries/mspgcc/flash_erase_segment.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- flash_erase_segment.c	1 May 2006 22:55:44 -0000	1.3
+++ flash_erase_segment.c	8 Nov 2007 02:36:50 -0000	1.4
@@ -10,6 +10,7 @@
     FCTL3 = FWKEY;                      // unlock
     FCTL1 = FWKEY|ERASE;                // select segment erase
     *(unsigned short*)address = 0xffff; // erase
+    while (FCTL3 & BUSY) {}             // wait until write is completed
     FCTL1 = FWKEY;                      // disable flash writing
     FCTL3 = FWKEY|LOCK;                 // lock
 }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/