changeset 1340:f18f448991bc

* include/flash_at29cxxxx.inl: Improves driver, to work with 16 bit wide access. The driver have to write 256 times after each command sequence, but with two 8 bit divices parallel, the driver writes only 128 times.
author asl
date Thu, 30 Oct 2003 19:25:44 +0000
parents 3fd78c0401ac
children d43f5e29476a
files packages/devs/flash/atmel/at29cxxxx/current/ChangeLog packages/devs/flash/atmel/at29cxxxx/current/include/flash_at29cxxxx.inl
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/flash/atmel/at29cxxxx/current/ChangeLog
+++ b/packages/devs/flash/atmel/at29cxxxx/current/ChangeLog
@@ -1,3 +1,10 @@
+2003-10-02  Roland Cassebohm  <r.cassebohm@visionsystems.de>
+
+	* include/flash_at29cxxxx.inl: Improves driver, to work with 16 bit
+	wide access. The driver have to write 256 times after each command 
+	sequence, but with two 8 bit divices parallel, the driver writes
+	only 128 times.
+
 2001-09-13  Jesper Skov  <jskov@redhat.com>
 
 	* include/flash_at29cxxxx.inl: Added support for AT29LV1024. Added
--- a/packages/devs/flash/atmel/at29cxxxx/current/include/flash_at29cxxxx.inl
+++ b/packages/devs/flash/atmel/at29cxxxx/current/include/flash_at29cxxxx.inl
@@ -232,10 +232,9 @@ flash_erase_block(void* block, unsigned 
         addr_ptr2 = addr_ptr;
         len2 = len;
 
-        // Always load 256 bytes
-        for (i = 0; i < 256;) {
+        // Always load 256 times
+        for (i = 0; i < 256; i++) {
             *addr_ptr2++ = FLASH_BlankValue;
-            i += sizeof(*addr_ptr2);
         }
 
         // Wait for completion (bit 6 stops toggling)
@@ -305,15 +304,14 @@ flash_program_buf(void* addr, void* data
         data_ptr2 = data_ptr;
         len2 = len;
 
-        // Always load 256 bytes
-        for (i = 0; i < 256;) {
+        // Always load 256 times
+        for (i = 0; i < 256; i++) {
             if (len2 > 0) {
                 *addr_ptr2++ = *data_ptr2++;
                 len2 -= sizeof(*data_ptr2);
             } else {
                 *addr_ptr2++ = FLASH_BlankValue;
             }
-            i += sizeof(*data_ptr2);
         }
 
         // Wait for completion (bit 6 stops toggling)