Vesrion IAP with LPC11U24_EEPROM_ONLY options

Fork of IAP by Tedd OKANO

This is IAP library from http://mbed.org/users/okano/notebook/iap-in-application-programming-internal-flash-eras/ Added option LPC11U24_EEPROM_ONLY in IAP.h that disable flash write/read functions if they not needed and working only EEPROM write/read functions. It make for clear memory allocation for flash write functions (4k).

Files at this revision

API Documentation at this revision

Comitter:
Verbix
Date:
Sat Dec 28 21:01:05 2013 +0000
Parent:
1:ff906ad52cf9
Commit message:
Added option LPC11U24_EEPROM_ONLY disabling Flash write/read functions and RAM allocation for it. Only EEPROM functions for LPC11U24 will work.

Changed in this revision

IAP.cpp Show annotated file Show diff for this revision Revisions of this file
IAP.h Show annotated file Show diff for this revision Revisions of this file
diff -r ff906ad52cf9 -r 0c7ec806673e IAP.cpp
--- a/IAP.cpp	Mon Nov 26 06:02:24 2012 +0000
+++ b/IAP.cpp	Sat Dec 28 21:01:05 2013 +0000
@@ -30,8 +30,9 @@
 #define     USER_FLASH_AREA_START_STR( x )      STR( x )
 #define     STR( x )                            #x
 
+#ifndef LPC11U24_EEPROM_ONLY
 unsigned char user_area[ USER_FLASH_AREA_SIZE ] __attribute__((section( ".ARM.__at_" USER_FLASH_AREA_START_STR( USER_FLASH_AREA_START ) ), zero_init));
-
+#endif
 
 /*
  *  Reserve of flash area is explained by Igor. Please refer next URL
@@ -102,6 +103,7 @@
  *  @return error code: CMD_SUCCESS | BUSY | SECTOR_NOT_BLANK | INVALID_SECTOR
  */
 
+#ifndef LPC11U24_EEPROM_ONLY
 int IAP::blank_check( int start, int end ) {
     IAP_command[ 0 ]    = IAPCommand_Blank_check_sector;
     IAP_command[ 1 ]    = (unsigned int)start;  //  Start Sector Number
@@ -227,6 +229,7 @@
 {
     return ( USER_FLASH_AREA_SIZE );
 }
+#endif
 
 #if defined(TARGET_LPC11U24)
 /** Copy RAM to EEPROM (LPC11U24)
diff -r ff906ad52cf9 -r 0c7ec806673e IAP.h
--- a/IAP.h	Mon Nov 26 06:02:24 2012 +0000
+++ b/IAP.h	Sat Dec 28 21:01:05 2013 +0000
@@ -29,6 +29,8 @@
 
 #include    "mbed.h"
 
+#define LPC11U24_EEPROM_ONLY
+
 #if defined(TARGET_LPC1768)
 
 #define     USER_FLASH_AREA_START   FLASH_SECTOR_29
@@ -258,7 +260,8 @@
     IAP() : iap_entry( reinterpret_cast<IAP_call>(IAP_LOCATION) ), cclk_kHz( SystemCoreClock / 1000 ) {}
     int read_ID( void );
     int read_serial( void );
-    int blank_check( int start, int end );
+#ifndef LPC11U24_EEPROM_ONLY
+        int blank_check( int start, int end );
     int erase( int start, int end );
     int prepare( int start, int end );
     int write( char *source_addr, char *target_addr, int size );
@@ -267,7 +270,8 @@
     
     char *reserved_flash_area_start( void );
     int   reserved_flash_area_size( void );
-
+#endif
+            
 #if defined(TARGET_LPC11U24)
     int write_eeprom( char *source_addr, char *target_addr, int size );
     int read_eeprom( char *source_addr, char *target_addr, int size );