diff packages/io/flash/current/src/legacy_dev.c @ 1730:3f6b1c304c7a

* src/flash.c: Offset into the block is not calculated correctly when the flash start is not aligned on a flash block. * src/legacy_dev.c (legacy_flash_read): Fixed typo.
author asl
date Thu, 30 Sep 2004 18:09:20 +0000
parents e290a0372578
children e308039f4579
line wrap: on
line diff
--- a/packages/io/flash/current/src/legacy_dev.c
+++ b/packages/io/flash/current/src/legacy_dev.c
@@ -181,14 +181,14 @@ legacy_flash_read (struct cyg_flash_dev 
                    void* data, const size_t len)
 {
 #ifdef CYGSEM_IO_FLASH_READ_INDIRECT
-  typedef int code_fun(void *, void *, int, unsigned long, int);
+  typedef int code_fun(const cyg_flashaddr_t, void *, int, unsigned long, int);
   code_fun *_flash_read_buf;
   size_t block_size = dev->block_info[0].block_size;
   size_t block_mask = ~(block_mask -1);
 
   _flash_read_buf = (code_fun*) __anonymizer(&flash_read_buf);
   
-  return = (*_flash_read_buf)(base, data, len, block_mask, buffer_size);
+  return (*_flash_read_buf)(base, data, len, block_mask, block_size);
 #else
   memcpy(data,(void *)base, len);
   return CYG_FLASH_ERR_OK;