diff packages/devs/flash/atmel/dataflash/current/include/dataflash.h @ 1768:ef75ad79dfe3

* include/dataflash.h: Allow the package to be compiled without io/flash. Return correct value from cyg_dataflash_get_page_count()
author asl
date Wed, 29 Jun 2005 20:12:42 +0000
parents 96ec7e534d98
children
line wrap: on
line diff
--- a/packages/devs/flash/atmel/dataflash/current/include/dataflash.h
+++ b/packages/devs/flash/atmel/dataflash/current/include/dataflash.h
@@ -97,7 +97,7 @@ typedef struct cyg_dataflash_device_s
 } cyg_dataflash_device_t;
 
 //----------------------------------------------------------------------------
-
+#ifdef CYGPKG_IO_FLASH
 #include <cyg/io/flash.h>
 #include <cyg/io/flash_dev.h>
 
@@ -129,6 +129,7 @@ externC struct cyg_flash_dev_funs cyg_da
                      & cyg_dataflash_priv_ ## name                              \
         )
     
+#endif
 //----------------------------------------------------------------------------
 
 static inline cyg_uint8
@@ -146,7 +147,7 @@ cyg_dataflash_get_page_size(cyg_dataflas
 static inline cyg_uint16
 cyg_dataflash_get_page_count(cyg_dataflash_device_t *dev)
 {
-    return dev->info->page_size;
+    return dev->info->page_count;
 }
 
 static inline cyg_uint16