changeset 1727:41dd4286cbbd

* include/flash_sst_39vfxxx.inl: Set the end address to the last valid address in flash, not the first invalid address.
author asl
date Tue, 14 Sep 2004 16:03:26 +0000
parents d2486ee206e4
children b16e2895566e
files packages/devs/flash/sst/39vfxxx/current/ChangeLog packages/devs/flash/sst/39vfxxx/current/include/flash_sst_39vfxxx.inl
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/flash/sst/39vfxxx/current/ChangeLog
+++ b/packages/devs/flash/sst/39vfxxx/current/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-14  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* include/flash_sst_39vfxxx.inl: Set the end address to the last
+	valid address in flash, not the first invalid address.
+
 2004-08-06  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* include/flash_sst_39vfxxx.inl: The structure declared by
--- a/packages/devs/flash/sst/39vfxxx/current/include/flash_sst_39vfxxx.inl
+++ b/packages/devs/flash/sst/39vfxxx/current/include/flash_sst_39vfxxx.inl
@@ -64,7 +64,6 @@
 #define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
 
-
 //----------------------------------------------------------------------------
 // Common device details.
 #define FLASH_Read_ID                   FLASHWORD( 0x90 )
@@ -170,7 +169,7 @@ sst_init(struct cyg_flash_dev *dev)
   
   // Hard wired for now
   dev->end = dev->start + 
-    (FLASH_NUM_REGIONS * FLASH_BLOCK_SIZE * CYGNUM_FLASH_SERIES);
+    (FLASH_NUM_REGIONS * FLASH_BLOCK_SIZE * CYGNUM_FLASH_SERIES) -1;
   dev->num_block_infos = 1;
   priv->block_info[0].blocks = FLASH_NUM_REGIONS * CYGNUM_FLASH_SERIES;
   priv->block_info[0].block_size = FLASH_BLOCK_SIZE;
@@ -266,7 +265,6 @@ sst_erase_block(struct cyg_flash_dev *de
             }
             prev_state = state;
         }
-
         // Verify loaded data bytes
         while (len > 0) {
             if (*addr_ptr != FLASH_BlankValue) {
@@ -278,7 +276,6 @@ sst_erase_block(struct cyg_flash_dev *de
             len -= sizeof(*addr_ptr);
         }
     }
-
     return CYG_FLASH_ERR_OK;
 }