diff packages/io/flash/current/src/legacy_dev.c @ 1729:e290a0372578

* src/flash.c (cyg_flash_init): Add assert checking that the end address matches the block information. * src/legacy_dev.c (legacy_flash_init): Ensure that the end address is the last valid address, not the first invalid address.
author asl
date Tue, 14 Sep 2004 16:04:53 +0000
parents 3845779eca10
children 3f6b1c304c7a
line wrap: on
line diff
--- a/packages/io/flash/current/src/legacy_dev.c
+++ b/packages/io/flash/current/src/legacy_dev.c
@@ -92,7 +92,7 @@ legacy_flash_init (struct cyg_flash_dev 
 
   if (!err) {
     dev->start = (cyg_flashaddr_t)flash_info.start;
-    dev->end = (cyg_flashaddr_t)flash_info.end;
+    dev->end = flash_info.block_size * flash_info.blocks - 1; 
     dev->num_block_infos = 1;
     dev->block_info = block_info;
     block_info[0].block_size = flash_info.block_size;