comparison packages/devs/flash/intel/strata/current/src/flash_program_buf.c @ 182:f62680ef1804

Merge from eCos master repository on 2001-09-07-06:43:02-BST
author jlarmour
date Wed, 12 Sep 2001 00:59:17 +0000
parents 42f843b391aa
children e0c0827131d1
comparison
equal deleted inserted replaced
181:d61da071934c 182:f62680ef1804
95 } 95 }
96 *BA = FLASH_Write_Buffer; 96 *BA = FLASH_Write_Buffer;
97 } 97 }
98 *BA = FLASHWORD(wc-1); // Count is 0..N-1 98 *BA = FLASHWORD(wc-1); // Count is 0..N-1
99 for (i = 0; i < wc; i++) { 99 for (i = 0; i < wc; i++) {
100 #ifdef CYGHWR_FLASH_WRITE_ELEM
101 CYGHWR_FLASH_WRITE_ELEM(addr+i, data+i);
102 #else
100 *(addr+i) = *(data+i); 103 *(addr+i) = *(data+i);
104 #endif
101 } 105 }
102 *BA = FLASH_Confirm; 106 *BA = FLASH_Confirm;
103 107
104 ROM[0] = FLASH_Read_Status; 108 ROM[0] = FLASH_Read_Status;
105 timeout = 5000000; 109 timeout = 5000000;
123 } 127 }
124 #endif 128 #endif
125 129
126 while (len > 0) { 130 while (len > 0) {
127 ROM[0] = FLASH_Program; 131 ROM[0] = FLASH_Program;
132 #ifdef CYGHWR_FLASH_WRITE_ELEM
133 CYGHWR_FLASH_WRITE_ELEM(addr, data);
134 #else
128 *addr = *data; 135 *addr = *data;
136 #endif
129 timeout = 5000000; 137 timeout = 5000000;
130 while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) { 138 while(((stat = ROM[0]) & FLASH_Status_Ready) != FLASH_Status_Ready) {
131 if (--timeout == 0) { 139 if (--timeout == 0) {
132 goto bad; 140 goto bad;
133 } 141 }